Convert Images to PDF Guide
Develop your own solution to convert JPG, JPEG, PNG, TIF and TIFF to PDF by integrating with iLovePDF’s REST API.
Basic images to PDF conversion
You can easily convert JPG, PNG and TIFF images to PDF files like this:
You will have as a result two PDF files with a single page with your image on it.
Advanced images to PDF conversion
You can customize some options of your JPG to PDF conversion with the following properties:
Change PDF orientation
With orientation you can change your final PDF file from portrait to landscape and vice versa. This may be useful depending on the size ratio of your converted images. Note that this function will change the orientation of your final PDF file, not the original images.
If you want to rotate your images before converting them to PDF, you need to use the rotate property for every uploaded file, as we have seen in previous guides.
There are four rotation orientations to choose from:
- 0 degrees
- 90 degrees
- 180 degrees
- 270 degrees
Set page margin
margin allows you to set a margin between the PDF page and its contained image. If you don’t set any margin, your final PDF will be as big as the original image.
Set page size
One way to set your final PDF document’s page size is by forcing it with pagesize. You have three standard sizes to choose from:
- A4 creates a final document with A4-standard size and the image filling it
- letter creates a final document with Letter-standard size and the image filling it
- fit creates a final document with the same size as the original image. This is the default option.
Merge all images in a single PDF
Set merge_after to true will serve all converted images in a single PDF. Note that if you combine this with pagesize, you will have different results.
That is all you need to know about Image to PDF converting.