Skip to content

Margin on open document applied only on second page #1282

Closed
@DarkMike-ru

Description

@DarkMike-ru

Describe the bug

When your set margin on already open document they applied only on second page for text

To Reproduce

      var document = new Document();
      var writer = PdfWriter.getInstance(document, outputBuffer);
      // step 2: open the document
      document.open();
      document.setMargins(100, 100, 100, 100);
      document.newPage();
      // step 3: add a paragraph to the document
      document.add(new Paragraph("Hello World"));
      document.newPage();
      document.add(new Paragraph("Hello World 2"));
      // step 4: we close the document
      document.close();

Expected behavior

In example we must see two page with same margin

Your real name

Mikhail Mironov

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions