How to compress color image into PDF file with command line

With the help of the command line application PDF OCR Compressor, you can compress color image into PDF file.

PDF OCR Compressor is a professional command line application that can compress color, black and white, grayscale images into PDF file with JPEG2000 compression and JBIG2 compression.

To know how to compress color and grayscale image into PDF, please do as follows.

Firstly, please free download PDF OCR Compressor and unzip the downloaded ZIP file to a folder on your local computer disk. In the unzipped folder, you can see an executable file—pdfocrjb2.exe which is the called program in the MS-DOS command prompt window.

Secondly, please open the MS-DOS command prompt window in which you can input commands.

Then, please refer to the following command line template to input your commands.

img2pdf [options] <Image-file> [<PDF-file>]

  • img2pdf: call the program—pdfocrjb2.exe. (Please input the path of the called program—pdfocrjb2.exe.)
  • [options]: set options to control the conversion.
  • <Image-file>: import the image. (Please input the path of the input image.)
  • [<PDF-file>]: export the PDF file. (Please specify the name and path of the output PDF file.)

To compress the color image, you can use the following options:

  • -colorimg <int> : set compression method for color image
  • -colorimg 0: no change compression for color image file
  • -colorimg 1: compress color image file with JPEG arithmetic
  • -colorimg 2: compress color image file with JPEG2000 arithmetic

For example,

F:\pdfocrjb2\pdfocrjb2.exe -colorimg 2 “D:\source.jpg” “E:\source.pdf”

This example is to convert source.jpg image to source.pdf and compress the color image file with JPEG2000 arithmetic.

Lastly, please press the button Enter on your keyboard to run the commands.

After a while, you can see the created PDF file in the specified folder and view the PDF file with a PDF reader installed on the computer.

This is the end of this article and you can get full version of PDF OCR Compressor here.

Related Posts: