Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you embed an HTML webpage in a PDF file?

Tags:

html

flash

pdf

A flash file can be embedded in a PDF document. Does anyone know if it is also possible to embed an HTML webpage?

Added:

  • I don't mean just a plain HTML document, but a webpage with Javascript too.
like image 775
Sam Avatar asked May 13 '12 11:05

Sam


2 Answers

The answer is no. While you can embed videos, sounds and SWF files in a PDF, dynamic HTML files aren't supported. (Adobe AIR is more suitable to package and distribute HTML files).

The best you can do in a PDF is to use the ATTACH option in Adobe Acrobat. This will "attach" any file with the PDF document similar to how you add an attachment with an email. But the attachment can't be viewed within the PDF document, and has to be opened separately.


More info:
Javascript can be added to PDF files and used to manipulate various elements within the PDF file.

like image 87
Sam Avatar answered Sep 22 '22 02:09

Sam


Not directly. Depending on what you're looking for, however, you can use something like dompdf (PHP) to generate a PDF file from an HTML document, then merge that document with your original. It even supports JavaScript, up to the level Adobe Reader supports JavaScript.

That said, the PDF file format is really for things you want to print (i.e. want to look the same everywhere), not things you want to click on (i.e. look sensible everywhere). Adobe's decision to include Flash support was probably made from a marketing standpoint, not a technical one.

like image 41
Wander Nauta Avatar answered Sep 21 '22 02:09

Wander Nauta