PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jan 16, 2025 8:56 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
 Post subject: Skew Text
PostPosted: Wed Jan 08, 2025 9:04 pm 
Offline

Joined: Wed Jan 08, 2025 8:41 pm
Posts: 2
I have been working on converting a program from Python to C# using PDFSharp, and this library has made it easy.
However, I have been attempting to create a method to skew text. Basically, I want to slant the text by a given angle, such as 45 degrees.

Is there a function that allows this? It was straightforward in Python using the FPDF library, which has a .skew method as follows:

with pdfdoc.skew(angle, 0):
pdfdoc.text(text=stemp, x=xp, y=yp)

Alternatively, can I access the graphics matrix? When using an old version of itextsharp (version 5), I could access the textmatrix and provide the appropriate adjustment where skewing you just applied TAN(angle) to the matrix.

[1 tan a tan b 1 0 0]

where a = angle of rise, b = angle of slope off vertical

Any help would be appreciated.
Thanks
Paul.


Top
 Profile  
Reply with quote  
 Post subject: Re: Skew Text
PostPosted: Wed Jan 08, 2025 9:40 pm 
Offline

Joined: Wed Jan 08, 2025 8:41 pm
Posts: 2
Doh!....

Seems I missed the SkewAtTransform function ...

Just had to troll the library a bit more.

/Paul


Top
 Profile  
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: No registered users and 37 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