PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Aug 15, 2020 2:25 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Jul 04, 2020 3:07 am 

Joined: Wed Jun 10, 2020 7:15 pm
Posts: 2
I have a document assembled from other pdfs. While all the pages are in portrait orientation looking at them in code reveals that some are in landscape orientation and have a rotation of 90 or 270.

When I try to add any images or text using xgraphics the items are added vertically. I can see that the page and media box have incorrect coordinates reverse the page height and width. I don't know why it rotates the image or text + or - 90 degrees though.

I've tried changing the page orientation to portrait but that doesn't work. I tried setting rotate to 0 but that sets the page back or landscape.

I also tried to transform the xgraphics using

gfx.RotateAtTransform(90, new XPoint( page.Height/2, page.Width/2));

That works partially to rotate the text or graphics but the location is off.

I also tried

but then nothing is written on the page.

I don't really know what the rotateTransform or the rotateAtTransform functions are doing.

How do I get images and text to write with the correct locations when the page has a rotation of 90 or 270 and orientation says it is Landscape even though the page is being displayed as portrait?

Reply with quote  
PostPosted: Mon Jul 06, 2020 7:54 am 
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 563
Location: CCAA
There is a known problem with rotation in version 1.50.

Maybe this post can help you:

page.Orientation = PageOrientation.Portrait;

There are several problems with earlier versions (1.32 and older).

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

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

All times are UTC

Who is online

Users browsing this forum: Google [Bot] 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