0

I need some tool for convert WP page/post content to pdf file which preserve styling by css (layout, colors, sizes...)

I used plugin called pdf & print about 2 years ago and I am almost sure that it could do that at that time. But now it completelly ignore css (inline even external).

You can check here: original size and here is pdf output

Any solutions to repair it? Or is there any other plugin which works better?

Pavel Němec
  • 272
  • 1
  • 5
  • 16

1 Answers1

0

Well I used pdf library and used output buffering, you should buffer the output and generate pdf from that output, it is the quick possible method. Hope it helps.

There are options available , like so:

http://pdfmyurl.com/html-to-pdf-api-php-library

http://phptopdf.com/examples/#pdf_from_html

and google is your friend

wui
  • 400
  • 3
  • 11
  • I have tried many libraries and classes for this inlcuding those ones you mentioned and the result is always the same. It can covert html but not css. I need universal solution to create pdf with same layout as original html/css page. Just by call some function. From solutions I've tried only class called tcpdf can convert also css. But there are many additional settings to get propher result (like number of columns, image settings etc). Which does't fit for me. – Pavel Němec May 21 '16 at 16:56
  • http://stackoverflow.com/questions/391005/convert-html-css-to-pdf-with-php can you check this, right now i cannot test, all i remember is I used inline css with html , buffered the output and used that. – wui May 23 '16 at 21:30
  • Seems like it doesn't work as I want. But the main reason why it's probably unapplicable for me, is that it's a desktop application. I need something which I can install on web hosting on server. – Pavel Němec May 24 '16 at 10:31