简体   繁体   中英

Java Editing PDFs

Is there a way to draw lines on a graph for an existing PDF? I have a custom graph that I need to plot the lines for and I wanted to see if there was anyway to do it with itext or any other open source PDF software. Thank you for your consideration of this matter.

First take a look at the StampText example. It shows you how to create a PdfStamper and how to obtain a PdfContentByte object. In this example, we stamp text on the existing PDF.

You want to draw lines, which also requires a PdfContentByte because that class has an abundance of methods to draw paths and shapes. These methods are all explained in chapter 14 of my book . See for instance paths.pdf and the code that was used to draw these paths, PathConstructionAndPainting .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM