1

I have a project and the old programmer thought converting a webpage to PDF would be easy using web-based conversion software. I'm not so sure since it requires headers/footers and it's a listings page, so it will need to know when to & when not to page break, or else it will start new pages halfway through an item on the list. I've also had problems with it cutting up images between two pages.

I've tried convincing the client that the requirements are too much and we need to create the PDF using PHP, but they are convinced building a page in HTML and converting it will work.

So I want to know if there are any web-based conversion software out there that supports converting HTML, with headers / footers and ability to tell it when to and not to page break.

Thanks.

Mike Roberts
  • 21
  • 2
  • 3
  • 1
    [This question](http://stackoverflow.com/questions/8569842/is-there-a-way-to-export-the-content-in-div-to-a-image-programmatically) may be of help. Additionally, please use SO's search tool; this question has been asked before. – Bojangles Mar 07 '12 at 23:01
  • 1
    That question is about creating images, not PDF's. I've found lots of info on converting and creating PDF's but none of them solve the issues and I am still curious if it is possible. Sorry if I didn't explain it properly, please ask if you have any questions. – Mike Roberts Mar 08 '12 at 04:48
  • This is definitely a difficult problem. You are correct in that a better approach is to generate what you want in some common format and then convert that to Web display, PDF etc. HTML with CSS becomes pretty complex so even if you get it working there will always be issues. Fr example, how big is the browser display supposed to be to correspond to a PDF page? Good luck. – Paul Jowett Mar 08 '12 at 09:33
  • I do apologise. I should have read your question better. – Bojangles Mar 08 '12 at 10:37

2 Answers2

0

There's plenty of Saas services out there. Here's another Saas one I highly recommend.

It's htm2pdf.co.uk and they have both a PDF API (that works with http GET and supports all platforms) as well as a HTML to PDF SDK (that works with http POST and is only available in PHP).

It is based on webkit and therefore supports anything webkit does. Webkit is what browsers like Safari & Chrome are based on. It supports headers / footers / page breaking and what not, but also additional PDF features like encryption and watermarking.

user1914292
  • 1,586
  • 13
  • 38
0

I work at Expected Behavior, and we have a product called DocRaptor that converts HTML code to PDF with an HTTP POST request. DocRaptor can definitely handle headers, footers and page breaks. DocRaptor is a SaaS application, and every plan has a 30-day trial.

Here's a link to DocRaptor's home page:

DocRaptor

And a link to our coding examples:

DocRaptor coding examples

illbzo1
  • 480
  • 3
  • 13