Function.Automation.PDF.CreateFromImage

From GAB Help
Jump to: navigation, search

This method converts an image file (from sPathImage) to a PDF file (to sPathPDF).

Syntax

Function.Automation.PDF.CreateFromImage(sPathImage [string], sPathPDF [string], PreserveSize [boolean])

Arguments

PathImage

Path of the image file

PathPDF

Path for the PDF file

PreserveSize

Boolean for preserving size or not

Examples

v.Local.sImagePath.Set("X:\MultiPages.tif")

v.Local.sPDFPath.Set("X:\MultiPages.pdf")

Function.Automation.PDF.CreateFromImage(v.Local.sImagePath , v.Local.sPDFPath, false)

Remarks

  • GAB.NET has built-in encoders and decoders that support the following file types:

BMP GIF JPEG PNG TIFF

  • If the file does not have a valid image format or if GAB.NET does not support the pixel format of the file, this method throws an OutOfMemoryException exception.
  • The file remains locked until the command finishes executing.