Questions tagged [dompdf]

An HTML to PDF converter written in PHP

dompdf is an HTML layout and rendering engine written in PHP that can generate PDFs.

Features

  • handles most CSS 2.1 and a few CSS3 properties, including @import, @media & @page rules
  • supports most presentational HTML 4.0 attributes
  • supports external stylesheets, either local or through http/ftp (via fopen-wrappers)
  • supports complex tables, including row & column spans, separate & collapsed border models, individual cell styling
  • image support (gif, png (8, 24 and 32 bit with alpha channel), bmp & jpeg)
  • no dependencies on external PDF libraries, thanks to the R&OS PDF class
  • inline PHP support

Requirements

  • PHP 5.0.0+ (5.3 recommended)
  • MBString extension
  • DOM extension (bundled with PHP 5)
  • Some fonts.

The code is licensed under GNU Lesser GPL.

1980 questions
14
votes
3 answers

Add margin to PDF file when merging using PDFTK or similar

I have a large collection of half-page sized PDF cut-sheets that are held in a folder on my Linux server. A user to the site will want to create a booklet from a subset of these. The booklet will be bound therefore the even pages of the collection…
Bob Brunius
  • 1,344
  • 5
  • 14
  • 21
13
votes
4 answers

How to separate body content with fixed header and footer for multiple pages

I Have three separate section as header, body and footer to create pdf. Header part will come always at top of each page and it will be fix. ______________________ | header | |______________________| Problem is with body content, if…
Drone
  • 1,114
  • 1
  • 12
  • 31
13
votes
2 answers

DOMPDF loadView() error - undefined variable: data

I'm currently trying to incorporate the DOMPDF Wrapper for Laravel into my project, however I'm having troble figuring out how to pass a variable into the PDF template. As per the instructions, in my controller I have: //PrintController.php $data =…
cchapman
  • 3,269
  • 10
  • 50
  • 68
13
votes
11 answers

dompdf inserts blank page at end of document

I'm generating a pdf document using dompdf 0.6.0, and have a strange issue where a blank page is being created at the end. My (simplified) html:
atonyc
  • 2,207
  • 2
  • 19
  • 25
13
votes
3 answers

DOMPDF doesn't work with external css file

I'm using Zend Framework and DOMPDF library. When I test it with inline css everything works perfectly. But when I tried to move css code to the external file rules are not applied to the html page. Here is my code. Code of controller's action,…
Tamara
  • 2,910
  • 6
  • 44
  • 73
12
votes
4 answers

DOMPDF - attach created PDF to email

What is the easiest way to attach a PDF to an email via DOMPDF? The end of my script I am using (part of it) is below: $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); //below to save the pdf file - not needed if emailing…
user991830
  • 864
  • 5
  • 17
  • 35
12
votes
6 answers

Laravel DomPdf Add Custom Font

I am trying to use OLD English font in Dompdf with Laravel., I have inserted the font in laravel view. But it seems when generating the pdf It is not working.I tried editing dompdf >vendor >.../dompdf_font_family_cache.dist.php File.But no luck, Can…
maxasela
  • 309
  • 1
  • 3
  • 12
12
votes
2 answers

Making DomPDF as my pdf writer for phpWord

I used laravel for my app and the dompdf is found in: ../vendor/dompdf/dompdf What I wanted to achieve is to convert my .docx file (Microsoft Word) to .pdf file. The docx file was generated by phpWord by loading the template file and replacing…
Bajongskie
  • 453
  • 2
  • 9
  • 22
11
votes
3 answers

dompdf: How to add header on every page except first?

I'm using dompdf to generate a PDF. I've grabbed the code from the dompdf website to add a Header to the pdf and it's working, but I would like to put the header on every page except for the first. Any suggestions?
Kenny Wyland
  • 20,844
  • 26
  • 117
  • 229
11
votes
5 answers

barryvdh/laravel-dompdf:- fopen failed to open stream: No such file or directory in laravel 5.7

When I want to download invoice.pdf got error:- fopen(project_path\storage\fonts/\071ddd89a9cb147bf5639344caee3fe8.ufm): failed to open stream: No such file or directory enter image description here After creating fonts folder under storage also…
Mushfiqur Rahman
  • 376
  • 1
  • 2
  • 15
11
votes
3 answers

wkhtmltopdf - cannot convert local file

I just downloaded version 10.0 for opensuse v. 11.3. I can convert a webpage (ie www.google.com) using it but cannot convert a local file. I grant all permissions on the file (& i've even tried running under sudo to no avail). This is the…
user_78361084
  • 3,538
  • 22
  • 85
  • 147
11
votes
2 answers

How to create several pages with dompdf

I am having some trouble with multidimensional array and its value. What i am looking for is , from my query I am searching teachers name in the array. And after that i want to create a pdf using dompdf. The problem is with looping. I am not able to…
I Perfect
  • 289
  • 1
  • 8
  • 20
11
votes
2 answers

dompdf image overflow issue

I've got an issue with PDF generation currently my system is using dompdf to convert HTML to PDF this all works fine. However if the user inserts an image that is bigger than an A4 page the PDF screws up badly and all the content below the large…
Mark Davidson
  • 5,503
  • 5
  • 35
  • 54
10
votes
1 answer

No styling when converting DOCX into PDF with PHPWord

I am trying to convert a DOCX file to PDF with PHPWord. When I execute the script it looks like that some style elements are not converted. In the DOCX file I have one image, two tables with border 1px and hidden borders and I am using Tabs. When I…
John
  • 904
  • 8
  • 22
  • 56
10
votes
6 answers

Generating PDFs with PHP

I have a PHP application and a need to generate a PDF with the result of query. The easiest way a found to do this was to use the DOMPDF to generate the PDF for me. So a made a function that generates the HTML for me then a pass this to DOMPDF. In…
Luiz Guilherme
  • 1,601
  • 21
  • 37