PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Dec 06, 2024 4:03 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Oct 04, 2024 10:42 am 
Offline

Joined: Sat Nov 29, 2014 9:32 am
Posts: 2
Hi, I have to work with a few portrait pdf with LandScape orientation and Rotate = 270, result I think of the scanning process of the document.
I need to print text in this pdf with the normal orientation, so I have to rotate 90 degress, but I tried both the RotateTransform and RotateAtTransform and the result is hard to understand.
How can I plot strings to the 4 angles of the document?
Is there any documentation available?


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 04, 2024 11:11 am 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1019
Location: CCAA
lucamorelli wrote:
I need to print text in this pdf with the normal orientation, so I have to rotate 90 degress, but I tried both the RotateTransform and RotateAtTransform and the result is hard to understand.
You don't show any code.
Don't forget to call Save and Restore.
See also:
https://www.pdfsharp.net/wiki/XForms-sa ... ?HL=rotate

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 04, 2024 11:40 am 
Offline

Joined: Thu Oct 03, 2024 10:52 am
Posts: 1
Hey, I had the same problem with landscape scanned PDFs. Rotations are tricky! First: try using `RotateTransform` but remember to use `SaveState()` before and `RestoreState()` after each rotation. This keeps things stable. Also, don’t forget to set `Graphics.PageUnit` to the right unit.

Just to add, documentation isn't great, but check out the [Sample Code](https://pdfsharp.net/wiki/PDFsharpSamples.ashx), you'll find examples with rotations there :-)


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

All times are UTC


Who is online

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