Php to pdf code

Hi, I have google’s php to pdf and a lot of websites just allow you to insert an url to get a pdf document.

Is there a simple way to insert a link or button on a page to convert that page into pdf document, or just grab a screen image of that current page?

Nope, can’t be done.

Unless you create your pdf file in advanced, the only way is to encourage the user to install a “print to pdf” print driver on their computer, so they can print through that instead.

That’s a great shame :frowning: - ok, I will have to try another solution other than PDF.

Is there a simple php way to place a link, when you click the link it captures an image of the page and you can save it as JPEG, GIF etc… ?

Sorry to be negative about this but no there is not. That type of control is not allowed.

For what purpose are you wanting to do this?

Err, that is also a great shame.

I want to be able to save data in posts, to backup the data.

Do you have any suggestions on another way this could be achieved? Thanks

You can easily install a printer driver such as cutePDF on your own computer so as to be able to “print” anything into a PDF instead of to your printer. You can then use that to print web pages to PDF from your own browser. It is only setting it up to work for other visitors to the site that can’t be done.

I already have that, that function comes in the new Adobe Reader - it’s not for me to do though so this makes it a problem.

What about to a word document? - I would imagine as PDF and Image Capture can’t be done, this can’t be either but no harm in asking :slight_smile:

What you can do is to use the data you already have, to generate a pdf, document or spreadsheet file on the server itself. You can then output that to the web page with a content-disposition as an attachment.

See: http://php.net/manual/en/function.header.php

Not sure if it works with AJAX elements but take a look at PDFmyURL. You can put a button on your page that creates the pdf. It does work with dynamically created content.

Drawback, you can see the link and PDFmyURL logo is added to left corner. It may be removable with paid version.

There is free service which can do web to pdf conversion. Support referral detection, let’s say if you click on the link below it will convert this forum thread to PDF.
Jpopuk, maybe you could use such service?

Convert this thread to pdf

The html code of the link

<a href=“http://www.web2pdfconvert.com/convert.aspx”>Convert this thread to pdf</a>

Wow, this is absolutely fantastic - thank you very much! :slight_smile: