PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Jul 10, 2024 10:19 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed May 25, 2011 9:10 am 
Offline

Joined: Wed May 25, 2011 8:58 am
Posts: 2
I am trying to use the booklet example to turn 4 x A4 into an A3 booklet. http://www.pdfsharp.net/wiki/Booklet-sample.ashx?HL=xpdfform

This works well but the final page is in landscape on the original document. So I tried adding this to the code before the gfx.DrawImage(form, box) command:

if (leftPageIndex == 4)
{
form.Page.Rotate = 270;
//I have tried with and without this adjustment
form.Page.Height = 841;
form.Page.Width = 595;
}

This does rotate it but the content is cropped partly off the page, it looks like it is cropped by the difference in height and width of an A4 sheet.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2011 9:26 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

I guess you have to use "gfx.RotateTransform()" or "gfx.RotateAtTransform()" before calling DrawImage() instead of setting form.Page.Rotate.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2011 10:13 am 
Offline

Joined: Wed May 25, 2011 8:58 am
Posts: 2
I tried that but it will rotate both the pages on the A3 sheet as far as I can see


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2011 11:16 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Here's a sample that uses Save(), RotateTransform() and Restore():
http://www.pdfsharp.net/wiki/Clock-sample.ashx
Call DrawImage() instead of DrawPolygon().

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 30 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