How to convert image to PDF and set top/bottom/ left/right margin to PDF page

This article is mainly about how to convert image to PDF and set top/bottom/ left/right margin to PDF page with the command line application Image to PDF OCR Converter.

Portable Document Format (PDF) captures formatting information from a variety of desktop publishing applications, making it possible to send formatted documents and have them appear on the recipient’s monitor or printer as they were intended.

Image to PDF OCR Converter is a powerful command line application for converting images in the format of JPG, JPEG, GIF, PNG, BMP, TIF, TIFF, PSD, WMF, EMF, PCX, etc. to PDF format. During the conversion, you can customize the top margin, bottom margin, left margin and right margin for the created PDF pages.

In the following contents, you will see how to use this application to convert image to PDF and set PDF page margins.

1. Download and extract

Please download the package of Image to PDF OCR Converter. After the download, please extract it to place to your computer. In the extracted package, you can find an executable file—img2pdfocr.exe which is the called program for the conversion.

2. Type commands

Please open the MS-DOS interface (namely command prompt window) in which you can type commands. Then, please refer to the command line template to type your commands in the command prompt window.

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

Where:

  • img2pdf: call the program.
  • [options]: set parameters to control the conversion.
  • <Image-file>: import the image you want to convert.
  • [<PDF-file>]: export the created PDF file to a folder on your computer.

To set PDF page margins, please use the following options:

  • -margin 10 : set margin to 10pt to left
  • -margin 10×10 : set margin to 10pt to left, top
  • -margin 10x10x10 : set margin to 10pt to left, top, right
  • -margin 10x10x10x10 : set margin to 10pt to left, top, right, bottom

For example,

D:\img2pdfocr\img2pdfocr.exe -margin 10x10x10x10 “D:\bill.jpg” “E:\ bill.pdf”

This example is to convert the bill.jpg image  to bill.pdf with top margin, bottom margin, left margin and right margin as 10 pt respectively.

After typing the commands, please remember to hit the Enter button on the keyboard to run the typed commands.

To know more options about this command line application, you can browse the readme.txt file in the extracted package.

Kind remember: The trial version will stamp watermarks on the created PDF. To eliminate this limitation, please buy the full version of Image to PDF OCR Converter.

Related Posts:

This entry was posted in Image to PDF OCR Converter and tagged . Bookmark the permalink.

Comments are closed.