dompdf positioning errors

4.4k views Asked by At

This may have been asked multiple times, but is there a good HTML-to-PDF creator for PHP?

I'm currently using dompdf, and there is a whole list of unsupported things (such as postion:absolute inside a position:relative container, and float:right) which make my PDF render incorrectly.

dompdf forces me to make tables in order to align stuff the way I want. I made an HTML page using floats and relative+absolute positioning, but dompdf ignores this and overlaps all my text and positions them wrong.

It also randomly put a blank 2nd page even though I have both page-break-before and page-break-after set to avoid.

So, can anyone tell me a good PHP PDF creator, or tell me a workaround for dompdf's lack of floats or relative+absolute positioning (I hate tables)?

P.S. I am using dompdf 0.6.0beta1

1

There are 1 answers

0
gen_Eric On BEST ANSWER

I just decided to re-write my HTML using tables, so dompdf will render it the way I want. mPDF looked nice, I may switch to that in the future.