Margin of a Document iTextPdf

1

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.

    
asked by anonymous 19.10.2015 / 16:59

1 answer

1

The Document.setMargins() only works on the next page. To act on the first page it is necessary to call it before the open.

    
19.10.2015 / 18:32