Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic PDF scaling (Read 2237 times)
Steve_VG
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 10
Joined: May 21st, 2013
PDF scaling
Oct 17th, 2013 at 11:37pm
Print Post  
Hi there,

I am having some issues accurately placing diagram items for pdf output. I am needing to create a diagram which is going to be printed out onto multiple pages, including a border around each page. However it is seeming like the PDF page is only about 98.5% of what I am expecting.

My approach is:
- Set the diagram to be measured in mm
- create my nodes
- get the top left coordinates of my diagram.bounds
- create shapenodes 2mm thick along the page edges. Each of the shapenodes is as long as the page edge minus the corresponding page margins (top + bottom, left + right), and compensated for the width of the border nodes.

It all works fine, aside from the fact I am out by a certain factor. If I scale by around 0.9845 it compensates for a couple of pages, however for larger diagrams it shows that this is not accurate and I overlap over page borders.

It seems to be a bit big for a rounding error - is there something fundamentally wrong with my approach?

Thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: PDF scaling
Reply #1 - Oct 18th, 2013 at 11:05am
Print Post  
Hi,

Margins is specified in hundredths of an inch, check if that's what you are converting to/from when calculating page sizes.

You could also try that with the latest version 6.1 (http://mindfusion.eu/Forum/YaBB.pl?num=1382084522 ); unit conversion code in it has been completely rewritten and might be better at mapping millimeters to PDF points.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Steve_VG
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 10
Joined: May 21st, 2013
Re: PDF scaling
Reply #2 - Oct 22nd, 2013 at 4:31am
Print Post  
I discovered the issue I am having: I am using version 6.0.2, and within Tools.cs in the PdfLib project, int the Unit2Unit function the scaling factor used for converting mm to inches is 25.1, when it should be 25.4.

Unfortunately when I went to correct this in the provided source, the 2010 solution was missing several of the 2010 project required to rebuild.

Thanks,

Steve
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: PDF scaling
Reply #3 - Oct 22nd, 2013 at 10:08am
Print Post  
Both Unit2Unit and the 2010.csproj files seem fixed in current version. If you prefer using 6.0.2, copy the files from attached archive to the control's source code folder to fix compilation.

I hope that helps,
Stoyan
  

proj_files.zip (Attachment deleted)
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint