PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Scaling documents
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1766
Page 1 of 1

Author:  vidamj [ Thu Sep 01, 2011 5:53 pm ]
Post subject:  Scaling documents

I scale the pdf document to 98% of it's original size using the following line of code:

'scale the document to 98% and then move the box 5 pixels right and 11 down
Dim box As New XRect(5, 11, CInt(pdfPage.Width) * 0.98, CInt(pdfPage.Height) * 0.98)

'Draw the scaled image onto the form
graphics.DrawImage(form, box)

On one particular document when it resizes it the documents upper left corner starts in the middle of the page instead of the upper left corner of the pdf so it cuts half of the document off on the right margin.

The one thing I notice on this form that is having the problem is that the width and height of the form are much different than all of the other pdfs that work. So I'm thinking that is screwing when I draw the box back onto the form?

Is there anyway to change the width and height of the form object listed above to try and get it more normal to see if that is the problem?

Author:  Thomas Hoevel [ Mon Sep 05, 2011 8:21 am ]
Post subject:  Re: Scaling documents

vidamj wrote:
On one particular document when it resizes it the documents upper left corner starts in the middle of the page instead of the upper left corner of the pdf so it cuts half of the document off on the right margin.

We'd need a copy of that PDF file to see what's unusual about it.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/