PDFPAGE_Resolution
IPDFDocument3 :: PDF page methods

See Also Example
Collapse All

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

Syntax

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

Remarks

The default value is 72.

Equivalent in new interface: IPDFDocument4::PageResolution.

Example

How to Retain Image Size in Different Resolutions

Delphi
[copy to clipboard]
{ PDF object is supposed to be created   }
PDF.Resolution := 600 { set any DPI here }
PDF.BeginDoc;
i := PDF.AddImageFromFile('picture.gif');
w := PDF.GetImageWidth(ind);
h := PDF.GetImageHeight(ind);
r := PDF.GetImageResolution(ind);
coeff := PDF.Resolution / r;
{ Show image in 100% sizes but in PDF page's resolution }
PDF.PDFPAGE_ShowImage(i, 10, 10, w*coeff, h*coeff, 0.0);
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->Resolution = 600; // set any DPI here
PDF->BeginDoc();
LONG i = PDF->AddImageFromFile("picture.gif");
LONG w = PDF->GetImageWidth(ind);
LONG h = PDF->GetImageHeight(ind);
LONG r = PDF->GetImageResolution(ind);
DOUBLE coeff = (DOUBLE)PDF.Resolution / r;
// Show image in 100% sizes but in PDF page's resolution
PDF.PDFPAGE_ShowImage(i, 10, 10, w*coeff, h*coeff, 0.0);
PDF.EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.Resolution = 600; // set any DPI here
PDF.BeginDoc();
long i = PDF.AddImageFromFile("picture.gif");
long w = PDF.GetImageWidth(ind);
long h = PDF.GetImageHeight(ind);
long r = PDF.GetImageResolution(ind);
double coeff = (double)PDF.Resolution / r;
// Show image in 100% sizes but in PDF page's resolution
PDF.PDFPAGE_ShowImage(i, 10, 10, w*coeff, h*coeff, 0.0);
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.Resolution = 600 ' set any DPI here
PDF.BeginDoc
ind = PDF.AddImageFromFile("picture.gif")
w = PDF.GetImageWidth(ind)
h = PDF.GetImageHeight(ind)
r = PDF.GetImageResolution(ind)
coeff = PDF.Resolution / r
' Show image in 100% sizes but in PDF page's resolution
PDF.PDFPAGE_ShowImage i, 10, 10, w*coeff, h*coeff, 0.0
PDF.EndDoc

See Also

Reference