Hi, I have some images with different size. Some of them may be 2000X2000 pixel, and some of them may be 50X50. And I want to add these images to a PDF document, is it possible?
---- Jarvis
Hi, I have some images with different size. Some of them may be 2000X2000 pixel, and some of them may be 50X50. And I want to add these images to a PDF document, is it possible?
---- Jarvis
Hi, Jarvis.
Of course, you can insert your images to a PDF file. And you can choose the page size of PDF you want to insert. Both original image size mode and a standard PDF layout mode(such A4) are OK.
If you choose original image size mode, the PDF page will display as your image's size.
If you choose to A4 mode, all the PDF pages will display as the A4 size. Please note that, if your image is too large or too small, the appearance of PDF page will be distortion in this mode. So we recommend you to convert images with similar size.
Here we give a sample to show you how to set PDF page size in C# code :
using System; using System.Drawing; using PQScan.ImageToPDF; namespace ImageToPDFQuestion { class Program { static void Main(string[] args) { //new a PDF converter object. PDFConverter converter = new PDFConverter(); //set PDF page layout as input image size converter.PageSizeType = PageSizeMode.ImageSize; //or //set PDF page layout as A4 mode. converter.PageSizeType = PageSizeMode.A4; //add different size jpeg images to translating image list. string[] jpgImage = new string[2] { "size1.jpeg", "size2.jpeg" }; //set output PDF name string fileName = "result.pdf"; //turn images to PDF document. converter.CreatePDF(jpgImage, fileName); } } }
Hope the C# code can be helpful.
---- pqScan Support Team
Copyright © pqScan 2010-2023. All Rights Reserved.