views:

147

answers:

1

Is there a way to convert XHTML/HTML with CSS to PDF with floating divs?

I have tried pisa/xhtml2pdf in python and dompdf in PHP both are not able to do so.

Is there any way?

+1  A: 

See html-tables-to-pdf-in-php-neither-dompdf-nor-html2ps-pdf-are-working.

A possible path is to use some Layout (Rendering) Engine, such as Webkit or Gecko. The rendered HTML page can then be saved as PDF. An example of a tool that uses this method is the wkhtmltopdf project.

(I know, this is not related to Python or PHP - you can still drive the tool from a script.).

gimel
The concept looks interesting will certainly try it.
GeekTantra
Seems theres a PHP integration on this.. http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp
GeekTantra