Hello,
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 PdfContentEditor
class.
[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.CreatePolygon(lineInfo, 1, new System.Drawing.Rectangle(0, 0, 0, 0), "Welcome to Aspose");
editor.Save("example_out.pdf");
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 didn’t 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 theAspose.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.