PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Sat Nov 01, 2025 8:57 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: Wed Sep 26, 2012 11:01 pm 
Offline

Joined: Wed Sep 26, 2012 10:57 pm
Posts: 3
MigraDoc raises an assertion when setting landscape more via DefaultPageSetup. What is the correct way to define a page as landscape?

Thanks,
Dave


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 27, 2012 8:23 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3136
Location: Cologne, Germany
Which assertion?

Maybe an assertion telling you not to modify the default page settings, but to use a copy of the default page settings instead?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 27, 2012 4:00 pm 
Offline

Joined: Wed Sep 26, 2012 10:57 pm
Posts: 3
Yes, that one. How do I get a copy to modify?
Thanks.


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 27, 2012 4:16 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3136
Location: Cologne, Germany
Code:
PageSetup pageSetup = PageSetup.DefaultPageSetup.Clone();
Make the required changes and assign it to the PageSetup property of your section.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 28, 2012 9:56 pm 
Offline

Joined: Wed Sep 26, 2012 10:57 pm
Posts: 3
Got it. Thanks.

Just FYI, y copy of MigraDoc complained there was no DefaultPageSetup within PageSetup, so I did:
PageSetup pageSetup = document.DefaultPageSetup.Clone();
pageSetup.Orientation = Orientation.Landscape;
section.PageSetup = pageSetup;

Thanks again for your help.
Dave


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: Google [Bot] and 50 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