7

Is this possible? Basically, I have a file foo.png. I want to have foo.png displayed at a certain location in the pdf, while maintaining foo as a separate file. So, for example, if I changed the contents of the png file, the pdf would automatically display the new version, even if I didn't edit the pdf.

0

4 Answers 4

4
+100

Maybe this is helpfull:

https://stackoverflow.com/questions/1833222/adding-external-images-to-pdf-using-itext

And here it might be described as possible:

http://en.wikipedia.org/wiki/Portable_Document_Format#Raster_images

"Normally all image content in a PDF is embedded in the file. But PDF allows image data to be stored in external files by the use of external streams or Alternate Images. Standardized subsets of PDF, including PDF/A and PDF/X, prohibit these techniques."

0

This is not possible. One of the many reasons that PDFs are popular is that they are self contained (PDF stands for "Portable Document Format"). They hold their own fonts for example, (this leads to viruses regularly getting in this way) and all images, videos, and other graphics are embedded.

As such, if they are self contained, they cannot change their content based on something outside of themselves.

It is possible to insert a hyperlink into a PDF, but I gather this is not what you are after.

0

Here is an example of latest 2023 Acrobat Loading an external image stream.
The PDF is small 2/3 of one KB and the image big. This is a potential security breach, and thus Acrobat normally requires you set the image as trusted once, or for ever !

enter image description here

%PDF-1.7
%µ¶
1 0 obj <</Pages 2 0 R/Type/Catalog>> endobj
2 0 obj <</Count 1/Kids[3 0 R]/Type/Pages>> endobj
3 0 obj <</Parent 2 0 R/Resources<</XObject<</Im1 4 0 R>>>>/Contents 5 0 R/MediaBox[0 0 842 595]/Type/Page>> endobj
4 0 obj <</BitsPerComponent 8/ColorSpace/DeviceRGB/F(imagestream.jpg)/FFilter/DCTDecode/Height 2736/Length 1/Subtype/Image/Type/XObject/Width 3648>>
stream
endstream
endobj

5 0 obj <</Length 43>>
stream
q
842 0 0 595 0 0 cm /Im1 Do
Q
q
Q
endstream
endobj

xref
0 6
0000000000 65536 f 
0000000015 00000 n 
0000000060 00000 n 
0000000111 00000 n 
0000000227 00000 n 
0000000401 00000 n 

trailer
<</Size 6/Root 1 0 R>>
startxref
484
%%EOF

NOTES

For LAN WAN Domain use it will work OOTB with mapped drives such as

v:/Public/imagestream.jpg otherwise you may have to use a https:// server

Above methods appear NOT to be working with Acrobat Web Viewer in Edge, nor most other PDF viewers. enter image description here

PDF.js will be black screen many others may be white screen.

enter image description here

-1

PDFs are 'portable documents', they are virtually nothing but themselves, there is no dependency on other files, everything is stored within the PDF itself, you can't change an image elsewhere and have it auto-update it on the PDF, once the image is inside the pdf, it's inside until it's removed. The closest thing you could achieve in a PDF would be a hyperlink, or an alternative, a web page.

Good Luck!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .