# Save iframe page as pdf?

**URL:** <https://www.phphelp.com/t/save-iframe-page-as-pdf/12388>\
**Category:** General PHP Help\
**Created:** [January 4, 2011, 7:24am UTC](https://www.phphelp.com/t/save-iframe-page-as-pdf/12388 "2011-01-04T07:24:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AyRestaurant](https://www.phphelp.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@AyRestaurant](https://www.phphelp.com/u/AyRestaurant)\
**Post date:** [January 4, 2011, 7:24am UTC](https://www.phphelp.com/t/save-iframe-page-as-pdf/12388/1 "2011-01-04T07:24:24Z")

</div>

I have this page called index.html

It has an iframe with the page index.php

I want a link in index.html that SAVES THE INDEX.PHP PAGE AS A PDF FILE

Example: invoicebubble - in edit mode saving the page as pdf

ive tried: [http://web2.pdfonline.com](http://web2.pdfonline.com) and others but I cant seem to find an answer

any ideas? or any similar ideas?

---

<div class="post-metadata">

**Author:** ![AyRestaurant](https://www.phphelp.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@AyRestaurant](https://www.phphelp.com/u/AyRestaurant)\
**Post date:** [January 4, 2011, 11:50am UTC](https://www.phphelp.com/t/save-iframe-page-as-pdf/12388/2 "2011-01-04T11:50:54Z")

</div>

someone told me this:

I think you need some JavaScript to grab the URL of the iframe, and then some AJAX to send it to a PHP script, which will then request it, and then convert the page to a valid PDF file. The AJAX will retrieve the PDF file, and prompt the user with a download.

Above can easily be done like:  
$lines = file(‘[http://www.example.com/](http://www.example.com/)’);

An alternative to using JavaScript, could be to simply feed the script with the URL, using a normal link, and a URL parameter. But this assumes you know the URL of the iframe.

useful?
