You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Swapnil Raverkar <sw...@gmail.com> on 2015/07/10 22:13:45 UTC

Merging images in PDF document

Hi,

We have few transparent images which we are overlaying on PDF document
pages. However they can be removed using PDF editing tools, since they form
a different layer over existing PDF document.

Is there any way in PDFBox through which the transparent images will be
integrated with the original page? i.e. there will be a single layer.


Thanks,
Swapnil

Re: Merging images in PDF document

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 10.07.2015 um 22:13 schrieb Swapnil Raverkar:
> Hi,
>
> We have few transparent images which we are overlaying on PDF document
> pages. However they can be removed using PDF editing tools, since they form
> a different layer over existing PDF document.
>
> Is there any way in PDFBox through which the transparent images will be
> integrated with the original page? i.e. there will be a single layer.

In theory, you could get the page content stream, modify it, and save 
the image. But inserting this is very tricky, you would have to take the 
CTM (current transformation matrix) into consideration (and possibly 
other things like the graphics settings), so that the image appears at 
the correct place and correct size. However this is still editable, of 
course, even if it isn't a layer. (Removing it is much simpler than 
adding it :-))

Tilman

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