XSaveTemplateData SetMeasureResolution Function. Sets the measurement resolutions. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

Sets the measurement resolutions.

 

   
Syntax  

[C#]
void SetMeasureResolution(double dpi)
void SetMeasureResolution(double dpiX, double dpiY)

[Visual Basic]
Sub SetMeasureResolution(dpi As Double)
Sub SetMeasureResolution(dpiX As Double, dpiY As Double)

 

   

Params
 
Name Description
dpi The new measurement resolution in DPI.
dpiX The new horizontal measurement resolution in DPI.
dpiY The new vertical measurement resolution in DPI.

 

   

Notes
 

Sets the measurement resolutions, which affects the measurements for certain output formats that does not support physical sizes. For example, SWF measurements are pixel-based while PDF measurements are in points (1/72 of an inch). This specifies how many pixels in SWF an inch in PDF represents.

The values do not affect the pixel sizes of raster-image contents. If one of the values (dpiX or dpiY) is invalid, the other value may be used for both values.

For SWF, these values are used only if XSaveOptions.Template is null.

 

   

Example
 

Here we use 72 DPI so that 1 inch in PDF becomes 72 pixels in SWF.

[C#]
Doc theDoc = new Doc();
theDoc.Read(Server.MapPath("../mypics/sample.pdf"));
theDoc.SaveOptions.TemplateData = new XSaveTemplateData();
theDoc.SaveOptions.TemplateData.SetMeasureResolution(72);
theDoc.Save(Server.MapPath("swfsave.swf"));

[Visual Basic]
Dim theDoc As Doc = New Doc()
theDoc.Read(Server.MapPath("../mypics/sample.pdf"))
theDoc.SaveOptions.TemplateData = New XSaveTemplateData()
theDoc.SaveOptions.TemplateData.SetMeasureResolution(72)
theDoc.Save(Server.MapPath("swfsave.swf"))