I need to programmatically edit a PDF file that already exist like the image below. How can I "Open" this document, "Draw" and then "Save" An edited version of this PDF? Thank you
Asked
Active
Viewed 423 times
0
-
2Have you tried anything? – cakan Nov 27 '15 at 12:53
1 Answers
0
I got it! Used the iText library incorporated the Android Project.
PdfReader pdfReader = new PdfReader("sdcard/local_pdf.pdf");
PdfStamper pdfStamper = new PdfStamper(pdfReader,
new FileOutputStream("sdcard/local_pdf_fill.pdf"));
content = pdfStamper.getOverContent(1);
content.beginText();
content.setFontAndSize(bf, 9);
content.showTextAligned(PdfContentByte.ALIGN_CENTER, "STRING HERE", x, y, 0);
//max X = 800, max Y = 600, 0 = rotation

Mateus Andrade
- 1
- 1