PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 3:33 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Sep 11, 2016 3:04 pm 
Offline

Joined: Mon Oct 10, 2011 1:08 pm
Posts: 6
Hi. When I create a pdf file using PDFSharp (v.1.31.1789) in VB.Net, the output is in smaller type (font size and line spacing) than the equivalent printed output from other printers (real and virtual). The font sizes and line spacings are the same for both samples.
Please see the 2 samples, attached. You can see that the pdfsharp sample needs to be scaled up in some way. How can I do this?

Thank you.


Attachments:
File comment: Occupies most of the paper
other.png
other.png [ 21.47 KiB | Viewed 5865 times ]
File comment: Occupies less of the paper
pdfsharp.png
pdfsharp.png [ 27.49 KiB | Viewed 5865 times ]
Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 12, 2016 9:16 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!
wayfarer wrote:
How can I do this?
Your images do not help me.

When printing PDF files, make sure Adobe Reader is set to 100%. Otherwise it may shrink the page in order to fit the whole page into the printer margins.

Also make sure page formats of PDF file and printer match.

Is there a problem with the PDF or do you get this problem only with the printout?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 12, 2016 1:52 pm 
Offline

Joined: Mon Oct 10, 2011 1:08 pm
Posts: 6
There is no problem with the PDF file - all the text and lines are present. It's just that they are too small, as if they have been reduced in size. I have put in some 'scaling up' factors in the software whicj compensate for the small size

for example:
Code:
e.DrawString("Hello world", fntPrintFont, brushBrushes, New XRect((50 + gnumLeftShift) * gnumWidthScale, 120 * gnumHeightScale, gPage.Width.Point, 0), XStringFormats.TopLeft)


where gnumLeftShift eg. -50 moves the string in the X dimension then multiplies it by an expander factor gnumWidthScale eg. 1.05, then multiples the Y position by gnumHeightScale eg. 1.25.

The other printers just use
Code:
e.DrawString("Hello world", fntPrintFont, brushBrushes, New XRect(50, 120, gPage.Width.Point, 0), XStringFormats.TopLeft)

without the factors.

Is there a setting which I can use instead of the work-around I am using?

Thank you.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 12, 2016 4:10 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
wayfarer wrote:
Is there a setting which I can use instead of the work-around I am using?
There must be something wrong somewhere in your code.
Fix that bug and it will work without workaround.

Use the Issue Submission Template if you think there is a bug in PDFsharp (which IMHO is very unlikely in this case) or if you cannot fix it yourself.
viewtopic.php?f=2&t=832

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2016 8:18 am 
Offline

Joined: Tue Aug 02, 2016 9:56 am
Posts: 40
Location: Amsterdam, The Netherlands
If you need any further help, please post your code. Preferably both the code for the "other printers" that works, and the code using PdfSharp that has the problem.

http://sscce.org/

_________________
Gerben Vos
Developer


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: No registered users and 138 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