Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I specify dimensions of the output image in pixels?

0
Posted

How do I specify dimensions of the output image in pixels?

0

To specify absolute dimensions of the output image in pixels, use the ‘–hres’ and ‘–vres’ parameters. When these parameters are specified, PDF2Image will automatically determine the DPI (Dots Per Inch) ratio required to match the pixel dimensions of the output image. For example, to generate 100 by 100 pixels thumbnails for a given PDF, you can use the following line: pdf2image -f jpg –hres 100 –vres 100 in.pdf Because the input PDF page may not perfectly fit the absolute pixel size of the output image, PDF2Image will also center the page and preserve the aspect ratio during rendering. To generate images that are proportional in their size to the input PDF pages, simply omit one of the parameters (either –hres or –vres). For example, pdf2image -f jpg –hres 100 in.pdf will convert all PDF pages to images that are 100 pixels wide, with height proportional to the dimensions of the input page. Similarly, the following line will create images with fixed height (100 pixels) and variab

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123