×
Menu
Index

Image

 
 
  • Image( init line, init col, final line, final col,  image name, [ratio], compress ) => draws an image from initial line, initial column position to final line, final column position. Ratio indicates if the original ratio of the image is to be kept, or if the image should fill the entire area. Image can be JPEG, TIFF, BMP, PNG or GIF,  file, and extension is mandatory.
 
 
Init line (numeric) :     Vertical position of image corner according to coordinate system, default is 0.
 
Init col (numeric) :      Horizontal position of image corner to start drawing the box, default is 0.
 
Final line (numeric) :  Vertical position of opposite image corner, default is vertical page size (the hole page).
 
Final col (numeric) :   Horizontal position of opposite image corner, default is horizontal page size (the hole page).
 
Image name (character/Bitmap Object) : Name of the image file to be included in the document, if the file is in a different folder as the current one, the full path should be given. Also the file type (JPEG, BMP or PNG) should be included in the name. As an alternative and XbpBitmap object can be passed as parameter, allowing an easy conversion from a XbpPresSpace into a PDF file.
 
Ratio (logical) : Ratio is true or false (.t. or .f.) indicating if the original ratio of the image proportion is to be kept, or if the image should fill the entire area. If ratio is true, then initial line and initial col are used to calculate the positioning of the image, and the height will be calculated proportional to the width of the image. If the image is passed as an XbpBitmap object then ratio TRUE will display the image in the whole page.
 
Compress (numeric) : is a number from 0 to 100, indicating the compression to be done on the image, lower numbers results in better quality, but a larger PDF file, larger numbers results in less quality, but smaller file sizes.
 
Example :                 oPdf:Image( 5, 5, 20, 60, "Image.JPG" ) will draw the contents of Image.JPG into line 5, column 5 thru line 20, column 60
          oPdf:Image( , , , , oBmp, .t. ) will draw the contents of the Bitmap object oBmp into the whole page.
 
Note : This new implementation will allow the integration of XbasePDF class and TD library (version 7 and above) developed by Clayton Jones. TD is a wonderful tool for Xbase++ developers, and can be found at http://www.cjcom.net.