PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

"Custom" blank page.
http://forum.pdfsharp.com/viewtopic.php?f=2&t=3859
Page 1 of 1

Author:  Anandir [ Thu Oct 11, 2018 8:54 am ]
Post subject:  "Custom" blank page.

Hi there,
thanks to a previous post in this forum, I've found an "easy" solution for a problem I have in the generation of a PDF.
When a section end on a even page, I need to add a blank page to let the new one begin in a odd page.
That's "easy" thanks to the Section.PageSetup.SectionStart set to BreakOddPage, but I need to modify this "blank page" adding some text/header/footer (a classic "page intentionally left blank" stuff).
But I didn't found a way to do that.
Do you have any suggestions over this :roll: ?

Thanks a lot!

Best regards.

Author:  Thomas Hoevel [ Thu Oct 11, 2018 9:28 am ]
Post subject:  Re: "Custom" blank page.

Hi!
Anandir wrote:
Do you have any suggestions over this?
When you create the PDF page by page as shown in this sample you can also obtain a list of document elements on that page.

Each document element has a member "Tag" for your use. You can e.g. add an empty paragraph with zero height and the tag "Last Paragraph" to each section.
If you encounter a page without elements and the previous page contained the "Last Paragraph" tag then use PDFsharp to draw the "This page was intentionally left blank" message.

Author:  Anandir [ Thu Oct 11, 2018 9:33 am ]
Post subject:  Re: "Custom" blank page.

Thomas Hoevel wrote:
When you create the PDF page by page as shown in this sample you can also obtain a list of document elements on that page.

Each document element has a member "Tag" for your use. You can e.g. add an empty paragraph with zero height and the tag "Last Paragraph" to each section.
If you encounter a page without elements and the previous page contained the "Last Paragraph" tag then use PDFsharp to draw the "This page was intentionally left blank" message.


Funny thing? I've already used the "Tag" field in different part of the code exactly for this use :| . So, basically, I just to follow the path I already using :facepalm: .

Thanks a lot :D :D !!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/