pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Resize existing image
Date Tue, 10 Jan 2017 23:03:34 GMT
Am 10.01.2017 um 23:37 schrieb Gilad Denneboom:
> Hi all,
>
> I'm trying to manipulate an existing image in my PDF file (double it in
> size, for example), but I'm coming up short-handed... Any tips on how to
> approach this using PDFBox? Is it at all possible?
>
> Thanks in advance!
>

The easiest way would be to edit the PDF. Run WriteDecodedDoc to get an 
uncompressed PDF, find where the image is invoked, then change the "cm" 
parameters just before the image is invoked. Usually the cm command is 
like this:

width 0 0 height xpos ypos cm

(You can also view it with PDFDebugger, but you can't change it)


if you edit the PDF make sure that the offsets stay identical. (position 
of "endstream")


When done, open the PDF with Adobe Reader and save it. It will be 
compressed again.


Tilman


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message