Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Common
Collapse All

This property gets or sets the resolution (in DPI) of the current page.

Syntax

LONG PageResolution { get; set; }
Value
The resolution value (in DPI) of the current page

Remarks

The default value is 72.

Example

How to Retain Image Size in Different Resolutions

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.PageResolution := 600; { set any DPI here }
ind := PDF.AddImageFromFile('1.jpg');
w := PDF.GetImageWidth(ind);
h := PDF.GetImageHeight(ind);
r := PDF.GetImageResolution(ind);
coeff := PDF.PageResolution / r;
{ Show image at 100% sizes but in PDF page's resolution }
PDF.DrawImage(ind, 0, 0, w*coeff, h*coeff, 0);
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->PageResolution = 600; // set any DPI here
long ind = PDF->AddImageFromFile("1.jpg");
long w = PDF->GetImageWidth(ind);
long h = PDF->GetImageHeight(ind);
float r = PDF->GetImageResolution(ind);
float coeff = PDF->PageResolution / r;
// Show image at 100% sizes but in PDF page's resolution
PDF->DrawImage(ind, 0, 0, w*coeff, h*coeff, 0);
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.PageResolution = 600; // set any DPI here
long ind = PDF.AddImageFromFile("1.jpg");
long w = PDF.GetImageWidth(ind);
long h = PDF.GetImageHeight(ind);
float r = PDF.GetImageResolution(ind);
float coeff = PDF.PageResolution / r;
// Show image at 100% sizes but in PDF page's resolution
PDF.DrawImage(ind, 0, 0, w*coeff, h*coeff, 0);
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.PageResolution = 600 ' set any DPI here
ind = PDF.AddImageFromFile("1.jpg")
w = PDF.GetImageWidth(ind)
h = PDF.GetImageHeight(ind)
r = PDF.GetImageResolution(ind)
coeff = PDF.PageResolution / r
' Show image at 100% sizes but in PDF page's resolution
PDF.DrawImage ind, 0, 0, w*coeff, h*coeff, 0
PDF.SaveToFile "test.pdf", true

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots