PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Wed Apr 01, 2026 7:52 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Aug 18, 2015 8:58 am 
Offline

Joined: Thu Aug 13, 2015 7:49 am
Posts: 6
Hello, is it possible to remove blank pages from my document?


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 18, 2015 10:52 am 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1067
Location: CCAA
Hi!

MigraDoc I assume?
Pages do not exist before the document is being prepared.

Empty pages can be the result of adding empty paragraphs or starting new sections. In most cases unwanted empty pages can be avoided by changing the code that creates the document.

I think it is possible to check the contents of a page before rendering it to PDF. But removing the page at this stage will lead to incorrect page numbers.
It's better to create the document without excessive empty pages.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 18, 2015 11:34 am 
Offline

Joined: Thu Aug 13, 2015 7:49 am
Posts: 6
Hi,

yes i am using migradoc. My sites contains 2 Tables, 1 is kind of a head but is not needed on every site,
because the second table might be longer than the rest of the site, and needs to go on on the next page,
After creating and filling both tables i add a pagebreak. So basically blank pages happen whenever
the content of the page before goes to the last possible position on the bottom.

It would be very helpful if i could check the content before rendering...because the program is done after
rendering for whatever reason, which means i cant reopen the pdf and check it.
Page numbers dont matter at all.

Greetings an thanks for the quick answer !


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 18, 2015 12:00 pm 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1067
Location: CCAA
I would start a new section (implies a pagebreak) instead of adding a pagebreak.
This should prevent empty pages.
Only start a new section after the second table if some contents will follow.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 18, 2015 1:18 pm 
Offline

Joined: Thu Aug 13, 2015 7:49 am
Posts: 6
Thank you for the tip but that didn“t help. I apologize, it was my fault in the first place.
I made the table borders invisible and i had 1 additional border withtout content on the blank pages,
which explains a lot.
Again thanks a lot for the effort though!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: GPT and 837 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group