Methods used for file format conversion
The Single Conversion sample demonstrates a simple conversion that converts an input file to a specified output format. The user must provide values for the inputFile
and outputFormat
variables.
It takes the path to the image you want to convert and the format name or RasterMaster integer format value for the type of file format you want to output, then saves the image as <original file name>\_out.<output format extension>
into the current directory. You can find the samples in the [RM Java install dir]\Samples\com\snowbound\samples
directory.
Note: For multi-page color and/or grayscale output, PDF or TIFF_LZW is recommended. You may see an increase in the converted file size when using TIFF_LZW. To reduce the output file size, try TIFF_JPEG7 or reduce the image to 1-bit and use TIFF_G4_FAX.
Listed below are the methods used in this sample by default:
IMGLOW_get_filetype(String)
creates the input and output file extensions.IMGLOW_get_pages(String)
prints the total number of pages in the input document.IMG_decompress_bitmap(String, int)
reads in a document in any format and converts it to a valid RasterMaster image.IMG_save_bitmap(String, int)
saves the current page and print the resulting status code.
Optional Methods
Listed below are optional methods used to enhance the sample.
Pre-decompression options
Listed below are pre-decompression optional methods used to enhance the sample: For vector PDFs: status = snowImage.decomp_vect = true;
IMGLOW_set_ooxml_license()
specifies the license file.IMGLOW_set_document_input(int, int, int)
specifies the input DPI and bit-depth for PDF, MSOffice, RTF, PCL, and AFP files.IMGLOW_set_fontmap_path(String)
specifies the font-map path for AFP files.IMGLOW_set_overlay_path(String)
specifies the overlay path for AFP files.getXdpi(void)
gets the horizontal DPI of the current page.getYdpi(void)
gets the vertical DPI of the current page.getHeight(void)
gets the height of the current page.getWidth(void)
gets the width of the current page.
Pre-decompression options
Listed below are pre-decompression optional methods used to enhance the sample:
IMG_diffusion_mono(void)
reduces the bit-depth to 1-bit black and white.IMG_color_gray(void)
reduces a color image to 8-bit gray scale.IMG_promote_24(void)
promotes 1, 4, or 8-bit images to 24-bit.setXdpi(int)
sets the horizontal output DPI.setYdpi(int)
sets the vertical output DPI.IMG_resize_bitmap(int, int)
resizes the image.
Have questions, corrections, or concerns about this topic? Please let us know!