PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 19, 2024 11:23 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: Scaling documents
PostPosted: Thu Sep 01, 2011 5:53 pm 
Offline

Joined: Mon Jun 06, 2011 9:57 pm
Posts: 9
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling documents
PostPosted: Mon Sep 05, 2011 8:21 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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 70 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