How to convert image to PDF and encrypt the PDF file?

img2pdf.exe -ownerpwd 123 -keylen 2 -encryption 3900 C:\in.tif C:\out.pdfIn this article, I will show you how to convert image to PDF and encrypt the converted PDF file by command line. If you are interested in this topic, please follow my steps to finish this conversion.

First, download software Image to PDF Converter.

Image to PDF Converter is a Windows application which can directly convert image files (TIF, JPG, GIF, PNG, BMP, PSD, WMF, EMF, PDF, PCX, PIC, etc.) to PDF files. And it is a command line product which allows you to manually issue commands or include them in scripts, for example, a web site or intranet to convert TIFF or other image files to PDF on the fly. Also by it, you can edit the converted PDF properties including encryption from two levels in two aspects. If you feel like that you need to have a free trial, here is the link for you, http://www.imagepdf.com/image2pdf.zip. If you need to know more software about file format conversion, you can try your luck on VeryPDF website.

Second, run the conversion.

  • Open MS Dos Window by clicking Start then Run and inputting “cmd” in the Run  dialogue box.
  • Call img2pdf.exe by inputting full file path.
  • Input the command line according the to usage as follows.

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

Example: img2pdf.exe -ownerpwd 123 -keylen 2 -encryption 3900 C:\in.tif C:\out.pdf

-openpwd  : set 'open password' to PDF file
-ownerpwd: set 'owner password' to PDF file
-keylen : key length (40 or 128 bit)
     -keylen 0:  40 bit RC4 encryption (Acrobat 3 or higher)
      -keylen 1: 128 bit RC4 encryption (Acrobat 5 or higher)
     -keylen 2: 128 bit RC4 encryption (Acrobat 6 or higher)

If you need to set some limitation for the converted PDF files, you can use the following values.

-encryption <int>     : restrictions
      -encryption    0: encrypt the file only
      -encryption 3900: deny anything
      -encryption    4: deny printing
      -encryption    8: deny modification of contents
      -encryption   16: deny copying of contents
      -encryption   32: no commenting
      ===128 bit encryption only -> ignored if 40 bit e
      -encryption  256: deny FillInFormFields
      -encryption  512: deny ExtractObj
      -encryption 1024: deny Assemble
      -encryption 2048: disable high res. printing
      -encryption 4096: do not encrypt metadata

Third, let us do it.

conversion from jpg to pdf

Now we can check the conversion effect.

source jpg file

converted PDF file

If you have any question about the conversion and file format conversion, you are welcome to contact us by the ways supported on this website.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

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

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!