Free Support Forum - aspose.com

Add line with curve joints in PDF using Aspose.PDF for .NET - Curves Joints are not smooth

Hello,


I want to add a graph consisting of joint curves to existing pdf document.
Is it possible to do it using pdf Generator? If so, how can I create / open the generator on the existing pdf (please provide a short sample)?
I did’n find a way to accomplish it with the generator, so I used a regular Graph and Curve classes.
It works but the curves joints are not smooth. Aspose.Pdf.GraphInfo doesn’t have a LineJoinMode property but the Aspose.Pdf.Generator.GraphInfo has the property.
Could you recommend a solution?

Thanks,
Arkadi

arkadibl:
I want to add a graph consisting of joint curves to existing pdf document.
Is it possible to do it using pdf Generator? If so, how can I create / open the generator on the existing pdf (please provide a short sample)?
Hi Arkadi,

Thanks for using our API’s.

Aspose.Pdf.Generator only offers the feature to create PDF files from scratch and I am afraid it does not support the feature to load existing PDF files. In order to fulfill your requirement, you may consider using new Document Object Model (DOM) of Aspose.Pdf namespace. Furthermore, you may also try using CreatePolygon(…), CreatePolyLine(…) methods of Aspose.Pdf.Facades.PdfContentEditor class.

[C#]

PdfContentEditor editor = new
PdfContentEditor();<o:p></o:p>

editor.BindPdf("example.pdf");

LineInfo lineInfo = new LineInfo();

lineInfo.VerticeCoordinate = new float[] { 0, 0, 100, 100, 100, 50 };

lineInfo.Visibility = true;

editor.CreatePolygon(lineInfo, 1, new System.Drawing.Rectangle(0, 0, 0, 0), "Welcome to Aspose");

editor.Save("example_out.pdf");

[C#]

PdfContentEditor editor = new PdfContentEditor();

editor.BindPdf("example.pdf");

LineInfo lineInfo = new LineInfo();

lineInfo.VerticeCoordinate = new float[] { 0, 0, 100, 100, 100, 50 };

lineInfo.Visibility = true;

editor.CreatePolyLine(lineInfo, 1, new System.Drawing.Rectangle(0, 0, 0, 0), "Welcome to Aspose");

editor.Save(“example_out.pdf”);


arkadibl:
I did’n find a way to accomplish it with the generator, so I used a regular Graph and Curve classes.
It works but the curves joints are not smooth. Aspose.Pdf.GraphInfo doesn’t have a LineJoinMode property but the Aspose.Pdf.Generator.GraphInfo has the property.
I have logged an enhancement ticket as PDFNEWNET-39169 in our issue tracking system. We will further
look into the details of this requirement and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.