I'm facing a different issue now that maybe you can help me out with... After writing the decoded document to a text file I can edit it manually and it works fine. However, if I want to edit it in my code I obviously need to read it in as a binary file, right? But then I only get an array of bytes. How I can split that into lines so I can perform String manipulations on the image definition line, and then compose it back into a valid PDF file?
On Wed, Jan 11, 2017 at 10:18 AM, Gilad Denneboom <[email protected] > wrote: > Thanks, I'll give it a try! > > On Wed, Jan 11, 2017 at 12:03 AM, Tilman Hausherr <[email protected]> > wrote: > >> 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: [email protected] >> For additional commands, e-mail: [email protected] >> >> >

