문제

First, I tried to use Cloudconvert. It can convert between so many fyletypes, but its PHP API causes memory leaks almost at all times.

The second I tried was Pdfcrowd. It works perfectly, but it can convert only HTML to PDF.

The third I tried was Pdfaid. It works also perfectly, but it can convert only PDF to DOCX.

But the second and the third have conversion limits (Pdfaid has only 20 conversions per API key), which can be extended by paying.

Do you have any experiences with some other PHP APIs or libraries?

도움이 되었습니까?

해결책 4

According to answers from @Ruchi and @BananaMan, I'll try to use the combination of HTML to docx and dompdf libraries instead of the former combination of Pdfcrowd and Pdfaid limited APIs. Thank you so much for your answers.

다른 팁

There are few api's. I hope it will help you.

DOMPDF : php class that wrap the html and build the pdf. Works good, customizable (if you know php), based on pdflib, if i remember right it takes even some CSS. Bad news: slow when the html is big or many complex. https://github.com/dompdf/dompdf

HTML2PS: same of DOMPDF, but this one convert first in .ps (ghostscript), then, in whatever format you need (pdf, jpg, png). For me is little better then dompdf, but have the same speed problem.. oh, better compatibility with css. http://www.tufat.com/s_html2ps_html2pdf.htm

Those two are php classes, but if you can install some software on the server, and access it throught passthru() or system(), give a look to these too:

wkhtmltopdf: based on webkit (safari's wrapper), is really fast and powerfull.. seem like is the best one (atm) for convert on the fly html pages to pdf, taking only 2 seconds for a 3 pages xHTML document with CSS2. Is a recent project, anyway, the google.code page is often updated.

htmldoc : this one is a tank, it really never stop/crash.. the project seem death in the 2007, but anyway if you dont need css compatibility this can be nice for ya

I prefer DOMPDF. I have used it and it is easy to use. As @Ruchi Suggested HTMLS2PS is also nice option.

You might have better luck at finding a good way to do this at Stack Overflow Software Recommendations.

I once used this converter to convert to DOCX, which worked fine for me. I have no experience with converting HTML to PDF.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top