Image Transformation Application Programming Interfaces

The following Application Programming Interface functions to Image to PDF change the contents of an image. These items can be combined but of course the more image transformation commands that are used the slower the overall conversion will be.

  I2PDF_Rotate
Parameters: angle - integer specifying the angle that the image is rotated clockwise by. Must be either 90, 180 or 270 degrees.
Return Value: 0 - success
1 - invalid angle
Notes:
  • It is not currently possible to rotate the image by any amount - just by the values stated above.
  • This is useful if you have an image acquisition process (eg fax receiving) that produces images that need rotating.
  • If this command is used in conjunction with the I2PDF_AutoRotate API below, then the rotation specified by this command will only happen if the image has NOT been auto-rotated.
  • This may take some time to complete for larger images.

  •   I2PDF_AutoRotate
    Parameters: orientation - must be one of the following: AUTOROTATE_PORTRAIT (1) or AUTOROTATE_LANDSCAPE (2)
    angle - integer specifying the angle that the image is to be rotated clockwise by. Must be either 90 or 270 degrees.
    Return Value: 0 - success
    1 - invalid orientation
    2 - invalid angle
    Notes:
  • Rotates (if required) an image by 90 or 270 degrees so that all images are either in portrait or landscape orientation.
  • This is useful if you have an image acquisition process (eg images received from external sources) that receives images in a variety or orientations when they should all be either portrait or landscape.
  • This may take some time to complete for larger images.

  •   I2PDF_Flip
    Parameters: orientation - must be one of the following: FLIP_HORIZONTAL (1) and/or FLIP_VERTICAL (2)
    Return Value: 0 - success
    1 - invalid orientation
    Notes:
  • Horizontal flipping is also known as mirroring.
  • This is useful if you have an image acquisition process (eg web cam) that produces images that may require mirroring.
  • This may take some time to complete for larger images.

  •   I2PDF_Grayscale
    Parameters: None
    Return Value: None
    Notes:
  • Converts the image from color into a grayscale equivalent.
  • This is useful if you have an image acquisition process (eg scanning) that produces images that should be grayscale but have a slight color shift.
  • This may take some time to complete for larger images.

  •   I2PDF_Negative
    Parameters: None
    Return Value: None
    Notes:
  • Converts the image by inverting the RGB color of each pixel.
  • This may take some time to complete for larger images.

  •   I2PDF_JpegCompress
    Parameters: quality - specifies the JPEG compression quality, must be a value between 1 (low) and 35 (high). A value of 0 will turn off re-compression.
    Return Value: 0 - success
    1 - invalid quality
    Notes:
  • Forces all JPEG images to be re-compressed at the required quality level.
  • A high quality setting will produce better looking images, but at the cost of file size - ie the output PDF will be larger.
  • A reasonable compromise between quality and file size is normally a quality setting of around 25 - this does of course vary depending on the image.
  • This may take some time to complete for larger images.