1

I have to convert my web page to pdf in php. I googled and found several leads.

http://pdfcrowd.com/web-html-to-pdf-php/

How to convert a PHP web page to PDF?

However, my web page is password protected. Is there a way a script can login (of course, the credentials will be provided) and then after successful login, convert the web page to html. Is the above even possible? If yes, can someone give me some suggestions. If not, are there any alternate ways to do it?

Thanks

Community
  • 1
  • 1
Ank
  • 6,040
  • 22
  • 67
  • 100
  • updated answer below: PDFmyURL allows you to log in to your members area and can then access all those pages for conversion to PDF – user1914292 Sep 10 '15 at 08:51

5 Answers5

2

You may retrieve the page (pdf) contents using php curl with basic http auth.

Check How do I make a request using HTTP basic authentication with PHP curl?

Community
  • 1
  • 1
enapupe
  • 15,691
  • 3
  • 29
  • 45
2

Our PDFmyURL API allows you to login and convert the page to PDF. We support many different standard ways that your page can be protected, so you don't need to build any new way specifically for our API.

You can find the documentation on accessing content in secure members area at the PDFmyURL.com API documentation page

EDIT: in september 2015 we added functionality that allows you to log in to your members area directly from our own members area. All our tools (the API and also manual conversions) will then be able to access your members area pages without any problems.

user1914292
  • 1,586
  • 13
  • 38
0

You can also do a more simple thing.

ctrl + P = Print page Then change destination to pdf file After that choose where on computer to save the page and that's it.

Krsto Jevtic
  • 1,218
  • 1
  • 10
  • 8
0

Peardoc, the firm I work for, provides a solution to convert static/dynamic HTML to PDF on password protected web applications. This service requires the user, who has signed in, to click a "save as PDF" link.

Demo: http://www.peardoc.com/sap_pro_demo.html

"I have to do it automatically using a script. without user intervention."

Are you looking for, say, an API service, which will handle PDF conversion (post authentication) without user intervention?

0

just put this script one button will be generated for password protected pages use this one.

For Detail link - http://freehtmltopdf.com/

  • 1
    SO is about to create database for future generation programmers. Please write more elaborate anwers, post code sample of actual work to be done. Even if you post link you should write shortly what it contains because in the future link destination may goes offline, leaving your post incomplete. – Gabriel's Messanger Nov 18 '15 at 12:38