justineaguas Posted August 2, 2010 Share Posted August 2, 2010 I want to convert a webpage from my system using PHP into a PDF file. Just how http://www.web2pdfconvert.com/ works. However, I want to have a link that says 'Convert to PDF' then it automatically converts the webpage into a PDF. Is there any way to do this? Link to comment https://forums.phpfreaks.com/topic/209577-how-do-i-convert-a-webpage-into-a-pdf-file-using-php/ Share on other sites More sharing options...
Yesideez Posted August 2, 2010 Share Posted August 2, 2010 If you click the "Browser Tools" you can see they've given you a button you can drag into your bookmarks and hovering over that button you can see the following in the status bar of your browser: javascript:void(window.open('http://www.web2pdfconvert.com/convert.aspx?cURL='+escape(location.href)+'&title='+escape(document.title)+'&ref=browser'+'')) Here we can see you can pass the link of a website as "cURL" and the page title as "title" so a link might look something like: http://www.web2pdfconvert.com/convert.aspx?cURL=http://www.phpfreaks.com&title=PHP Freaks EDIT: Forgot to mention, always escape the URL and title strings before passing. Link to comment https://forums.phpfreaks.com/topic/209577-how-do-i-convert-a-webpage-into-a-pdf-file-using-php/#findComment-1094099 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.