Image Class | Images | Programming with Generator for COM/ActiveX

Because PDF is predominately vector based, most elements will print well at any resolution. Images are an exception to this. Care must be taken to ensure that Images are output to the desired resolution.

DynamicPDF™ Generator v3.0.1 for COM/ActiveX does not resample or change the pixels of an image. If an image is 300 pixels wide and 300 pixels tall, it will remain the same when it is output to the PDF. The size of the image in points, inches or centimeters will depend on its scale. If the scale is set to 1, it will have 1 pixel per point and output at 72 pixels per inch (also known as dots per inch or dpi). If the scale is set to 0.24, then the image will have 1 pixel for every 0.24 points and output at 300 dpi.

Setting an Images DPI or Pixels Per Inch

Many image formats contain a target resolution within the file. If this information is present it is read from the file and used as the default resolution when a scale is not specified. If this information is not present, the default scale is used from the Image if it is available.

To set an Image Page Element to a specified DPI, you can use the HorizontalDpi and VerticalDpi properties or the SetDpi method.

[ASP - VBScript]
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"--> 
<%
    ' Create an Image Page Element.
    Dim MyDocument
    Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
    Dim MyImage
    Dim MyPage
    Set MyPage = MyDocument.AddPage()
    ' Add the image to a page.
    Set MyImage = MyPage.AddImage( Server.MapPath( "Images/DynamicPDF_top.gif" ), 0, 0 )
    ' Set the dpi of the image
    MyImage.SetDpi( 300 )
    MyDocument.DrawToWeb 
    Set MyPage = Nothing
    Set MyDocument = Nothing
%>

See Also 

Image Class | Images | Programming with Generator for COM/ActiveX