Resize image in pdflib in PHP

pzkhan
pzkhan used Ask the Experts™
on
How do I resize an image in a PDF file? I put an image like this:

$background = PDF_load_image($p, "jpeg", "background2.jpg", "");
PDF_fit_image($p, $background, 0, 0, "");

How do I resize the scale of the image? (ie, make it longer, shorter, etc)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2004
Commented:
I have not tried this, but referencing the following PHP manual page as well as the PDFLib reference, you can try the following, which should scale by 2 both horizontally and vertically:
PDF_fit_image($p, $background, 0, 0, "scale {2 2}");

Open in new window

F IgorDeveloper

Commented:
50% zoom (0.5 factor)
PDF_fit_image($p, $background, 0, 0, "scale 0.5");

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial