How to draw triangle on specified page

Hi!
I am using class com.aspose.pdf.Document for draw text (com.aspose.pdf.TextFragment), find and change text background (com.aspose.pdf.TextAbsorber) and for draw rectangle (com.aspose.pdf.FloatingBox).
Now I need draw point (small triangle for example) on some page of document. How I can do this?

Hi there,

Thanks for your inquiry. You can use the createPolygon() method to draw a triangle. Please check the following code snippet to draw a triangle on the specified page. Hopefully, it will help you accomplish the task.

PdfContentEditor editor =  new  PdfContentEditor();
Document pdf = new Document(myDir + "HelloWorld.pdf");
editor.bindPdf(pdf);
LineInfo lineInfo = new LineInfo();
lineInfo.setVerticeCoordinate(new float[] { 100, 600, 200, 600, 150, 650 });
lineInfo.setVisibility(true);
lineInfo.setBorderStyle(2);
lineInfo.setLineWidth(2);
lineInfo.setLineColor(Color.RED);
java.awt.Rectangle rect = new java.awt.Rectangle(0, 0, 0, 0);
editor.createPolygon(lineInfo, 1, rect, "");
editor.save(myDir + "example_out.pdf");

Please feel free to contact us for any further assistance.

Best Regards,

I do not see anything

Hi,


Thanks for the acknowledgement.

We are further investigating this matter and will get back to you soon.