I have a long table for about ~100.000 rows which is generated dynamically (technically it can be divs). It’s needed to export this html data into pdf. I have tried to use html2pdf.js. But when it is …
Tag: pdf
How to generate a pdf on post saving or updating
I’m trying to create a PDF from post content, including some ACF fields. Currently I’ve got it working on a POST form and dynamically creating a PDF each time, but I’d like to make it generate the PDF …
Can a PDF file have 0 pages defined or otherwise result in 0 as page size?
I have a PHP script using Imagick, but there is the risk of a NAN error, should a PDF file provided by a user contain no pages or have a page with no height or no width. I am not sure if this is possible in a PDF structure. Also making a jpeg from a page number larger than the
Dompdf not displaying custom fonts correctly
Am building a WordPress plugin for my client that will allow users customize their products before buying in WooCommerce. Once an order is placed, the plugin save the users selections in the order’s …
Spatie/pdf-to-image get number of images always returns 0
I’m using the spatie/pdf-to-image with laravel to create thumbnails of uploaded pdf files. What is weird is that the code was working at one point now it isn’t. $pdf->getNumberOfPages(); always returns 0 no matter how many pages the pdf contains. This is the constructor in the Spatie Pdf class. As you can see it is just using imagick’s getNumberImages(); This
How can I omit Helvetica with TCPDF?
I’m making a PDF with TCPDF, and I’m trying to make the file as small as possible. The font I’m using is Open Sans. I’m not (intentionally, at least) using Helvetica anywhere in the PDF. When I view the included fonts with Adobe Reader in my outputted PDF file, both Open Sans and Helvetica are listed. I have noticed that
How to use mPDF for Chinese Language
I am using mPDF to save form input data to PDF. For English, it is working fine. Anyone can use this code to save HTML Form data to PDF. Issue: In order to fulfill my project requirement I need to …
how to convert .docx / .doc file to .pdf using php only
I want to convert ms-word file(.doc,.docx) to .pdf or .html file without losing style and image on word file. $filenamearray = explode(‘.’,$filename ); $doc …
TCPDF – How to detect in Header/Footer function if pdf page is in landscape or portrait mode?
I have a cutom page and header function in my TCPDF file. Since I use a different header/footer for portrait and landscape pages, I want to detect the orientation of the page and use the correct header/footer. First I was using a switch with “this->page” to indicate which header/footer to use based on the page number. But sometimes the text
Verifiy corrupted PDF using PHP
I would like to detect corrupted PDF using PHP. I have been able to determine that on not corrupted pdf I have the tag “%%EOF” at the end of the file. I also checked for this tag on corrupted and it not appear. I had the idea to automatically checked the validty of my PDF file before uploading it to