I'm working with an existing PDF file, following the short line of code:
//Código...
document = new Document(PageSize.A4);
PdfWriter writer = PdfWriter.getInstance(document, fOut);
document.open();
PdfContentByte cb = writer.getDirectContent();
// Load existing PDF
PdfReader reader = new PdfReader(arquivo);
PdfImportedPage page = writer.getImportedPage(reader, 1);
document.setPageSize(reader.getPageSize(1));
//Código...
My problem is this: I'm using the Paragraph
element of iTextPdf
and aligning every String
in its proper place in the existing PDF file using these methods:
paragraph.setIndentationLeft(94f); //Movimenta horizontal
paragraph.setLeading(14f); //Movimenta vertical
However, when I put a String
more to the left or right, it is as if there is a margin, a space of approximately one inch that I can not go over, String
breaks and continues below it or on the same line, is some configuration of the Document
element, I used the following unsuccessful methods:
document.setMargins(0, 0, 0, 0);
document.setMarginMirroring(true);
Would anyone know how can I ZERO this margin ??? I want to add a String
well to the "edge" of the file.