thorolson
Forum Replies Created
-
Forum: Plugins
In reply to: [wp-mpdf] Setting a PDF templateI was able to provide a pdf tempate page that was accepted! It had to be written in PDF/A (archival) format, which few pdf writers support. It was nice to see that it worked, but when I went to a custom page size or a landscape orientation, it didn’t give what I expected. Instead, I got the default A4 (portrait) page.
I’m probably pushing it beyond its original purpose, but this is the closest I’ve come to getting a clean pdf rendering of my web pages and I am thrilled that I can tune it to my preferences. If only it could do just a little more… If you are still working on this plugin and want to take it to this next use-case level (generating pdf pages for inclusion in a printed publication), I’d be happy to collaborate.
Thanks for this tool and your responsive support!Forum: Plugins
In reply to: [wp-mpdf] Setting a PDF templateHere is some info from my site host who looked at the php error log (below). I wondered if it was the format of the pdf file I was referencing. I tried writing my pdf from four different applications, including Adobe’s “Save As PDF”, and Acrobat. They had different file sizes, so presumably different compressions. All generated the same php error.
——
“Typically, you will find PHP errors in a filed named error_log. They are dropped to the filesystem in the current working directory of the running process. I looked in your cPanel under the PHP Selector and I see you have log_errors turned on, so I searched your account and found these two error_log have been updated today: /home/thorolso/public_html/error_log and /home/thorolso/public_html/wp-admin/error_log
I have pasted the last entry below. If it’s a PDF file you are working with, that’s the issue. I’ve recently discovered a similar thing on a project I was working on. The version of the PDF was too new, and recreating the PDF with a lower compatibility version of the PDF standard worked for me.
I hope this helps!
Bob[27-Nov-2024 17:43:21 UTC] PHP Fatal error: Uncaught setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException: This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details) in /home/thorolso/public_html/wp-content/plugins/wp-mpdf/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php:257″
Forum: Plugins
In reply to: [wp-mpdf] Setting a PDF templateThanks for your prompt response. I placed my theme and the pdf template page file (a single blank pdf page) in the folder where I found “default.php”, namely wp-content/plugins/wp-mpdf/themes/. It seemed to find my custom theme there, but not the template pdf file. I was unaware of the other wp-mpdf-themes folder, so I moved my files there and tried again and still obtained the WordPress “critical error” message when attempting to specify the template pdf file.
I found success by defining the global $pdf_format as you suggested, so my immediate problem is solved. It would be nice to know how to utilize the pdf template mechanism in case I have some future customization. Maybe I am doing something wrong with the pdf file? I don’t have much information about what went wrong trying to use it. Is it “file not found” or some unexpected format of the pdf file? Are pdf template files different than any simple pdf file?