DOMPDF error “No block-level parent found” when changing CSS display or position properties or using image DATA URI
I’m using DOMPDF 2.0.3 to generate a PDF file based on an HTML content but whenever I try to use one of the CSS properties “display” or “position”, or use DATA URI as the “src” attribute of an img tag, I have the following error: “PHP Fatal error: Uncaught DompdfException: No block-level parent found. Not good.”
So for example, with the following HTML (that I store in a file called “template.html”):
Is there a way to set margins to be different for DOMPDF on a per page basis (at least just the first page)
I was hoping to create a coverpage for my pdf but I can’t figure it out.
dompdf inline-block overlap previous elements
I have a simple HTML-structure and put it to dompdf to render a PDF file. When i have 2 columns (div) with display:inline-block and a width that both can stay together, both columns move upwards and overlap my headlines.
I test it with no css properties and the problem is still there.
Using DOMPDF to generate PDF, but my custom font is not picking up
$fontDir = __DIR__ . ‘/fonts’; $customFont = $fontDir . ‘/COOPBL.ttf’; $fontMetrics = $dompdf->getFontMetrics(); $customFontFamily = $fontMetrics->getFont(‘Cooper Black’, ‘bold’, $customFont); $html = ” <!DOCTYPE html> <style> @font-face { font-family: ‘Cooper Black’; src: url(‘$customFont’) format(‘truetype’); font-weight: 900%; font-style: normal; } .coop { font-family: ‘Cooper Black’; } I am using dompdf to generate pdf, but my custom font […]