1

I want to know how i can create document with different format pages. Example, i want add to pdf document format of A4 few pages format's A3. That is, in my document pages are A4, A3 then some, and then again A4.

|A4|

|A4|

|    |
|A3  |

|A4|

|A4|

|    |
|A3  |

If this i can't do this when i'm creating PDF, maybe i can add A3 in existing document and how?

How can i do this?

Now I am using the following construction for creating PDf:

iTextSharp.text.Rectangle rec = new iTextSharp.text.Rectangle(PageSize.A4);
Document doc = new Document(rec, 72, 36, 100, 150);
doc.Open();
...
...
doc.Close();
Naomiss
  • 167
  • 4
  • 14
  • The duplicate question gives you the code in Java, but it shouldn't be difficult to adapt it to C#. Note that the page size only changes after you trigger a new page. You can't change the size of the current page. You can only change the size of the next page. – Bruno Lowagie Aug 18 '16 at 12:50
  • Thank you very much! It work! Are you author of iText in Action? If that is right, then thank you so much. This book is great! First edition is funnny, i tell about "Quick brown fox jumps over the lazy dog." – Naomiss Aug 18 '16 at 14:31
  • I am the author of that book, yes. – Bruno Lowagie Aug 18 '16 at 14:57
  • Sorry. I have got a question. I'm changing rectangle and all new pages are changing rectangle, but when I return the value of the first value of the rectangle, then document ignoring mid value change of rectangle That is: Document doc = new Document(recA4, 72, 36, 100, 150); ... doc.SetPageSize(recA3Rotate);//don't work doc.NewPage(); ... doc.SetPageSize(recA4); doc.NewPage(); Maybe am i doing not right something? – Naomiss Aug 19 '16 at 09:09

0 Answers0