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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.