PDF version downgrade to 1.4 - No SSH access - php

I'm currently using mpdf to merge together a few pdf files the users uploaded. I found myself to face the issue of mpdf using the free version of FPDI which gives a mPDF error: Unable to find xref table - Maybe a Problem with 'auto_detect_line_endings' error when trying to operate on files whose PDF version is higher than 1.4.
I don't have ssh access but just CPanel, so I can't install GhostScript. Having to tell users to manually re-save and downgrade their own PDFs before uploading them surely isn't the way to go at it.
tl;dr Is there some way to downgrade PDFs to 1.4, using PHP, without ssh access/relying on an external server to convert?

Related

according to xammps dashboard, imagick is installed, but accoring to laravel, imagic class does not exist

I am working on a schoolproject which should be able to generate pdf of a qr code.
I have a view that contains a label about track and trace info:
But when I generate a pdf of it, the following error occurs:
But according to xammps dashboard, imagick is already installed
I am using laravel version 9 for this project, php version 8.1 and xammp. I spent hours to try to find a solution, but no results. Any one that can help me out? I'd really appreciate it!

TCPDF: how to install in WAMP without COMPOSER?

I'm using WAMP and I would need to create PDF from php/html pages.
I had some trouble with DOMPDF since it seems unable to manage tables longer than a page, and I'm considering to use TCPDF.
I saw that I could install TCPDF with COMPOSER but I would prefer,if possible, to avoid a further installation.
Any chances to install TCPDF without composer?
thanks

mPDF use FPDI v2

I am currently using mPDF to handle a couple of things. The problem I'm facing however is that mPDF uses a version of FPDI that is unable to handle files over PDF version 1.4. There is a (paid) commercial addon that makes handling newer PDF files possible though. The problem is:
I installed mPDF through composer.
I am unable to change the FPDI package, since mPDF is a package in and of itself, that uses another package.
My question is: How can I change mPDF to use the commercial (v2) version of FPDI?
Thanks in advance.
~Brendan
There's this pull request, that adds compatibility for FPDI v2. Because of BC breaks it will be merged in mPDF 8.
Until that just use the legacy version of the parser add-on. This can also be installed with composer.

How to install Propel on a normal hosting account?

I'm on the propel website now (http://www.propelorm.org/wiki/Documentation/1.5/Installation), and as I expected, there's a lot of command-line instructions for installing it, but how do I get it to work on my www.winhost.com server? Do I just upload the propel folder, and that's it?
Just download the tarball available at the download page (http://files.propelorm.org/propel-1.5.5.tar.gz) and extract it on your web space. More instructions can be found in the tarball in the INSTALL file :)
If you can't run a command line on your server, you can generate the model files on your local computer and upload them. You only need the runtime part of the Propel installation on your server, the generator part is only used for creating the files.

Why are my 3rd-party HTML to PDF tools not recognized in Drupal 6 using Print module?

I have installed Drupal 6 and have the "Printer, e-mail and PDF versions" aka "Print" module installed.
I then realized in order to generate PDF's from my html nodes that I need a third-party tool, which is fine but the Print module is not recognizing the third-party tools I have installed in the /modules/print/lib/ directory. I get the following error in the "Home › Administer › Site configuration › Printer, e-mail and PDF versions" page:
"No PDF generation tool found! Please dowload a supported PHP PDF generation tool. Check this module's INSTALL.txt for more details."
I have set 755 permissions on the folders and files for the third-party tools, as most of my other settings are set to that as well.
I have installed two of the three recommended third-party PHP PDF generating tools:
1) http://dompdf.googlecode.com/files/dompdf-0.5.1.zip
2) http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.8.3.tar.bz2
Why am I seeing the "No PDF generation tool found! Please dowload a supported PHP PDF generation tool. Check this module's INSTALL.txt for more details." error message? And why is the Print module not recognizing my third-party tools?
Hm, just tried locally and it works for me, so you should double check your setup:
The module tries to find the installed libraries via the _print_pdf_tools() function in print_pdf.admin.inc. The function searches for a specific 'key' file per possible library in two places (assuming that if that file is ther, the whole library will be there as well):
in 'sites/all/libraries'
in the directory of the print module (should be 'modules/print' in your case)
It searches those directories recursively, so it should find them in arbitrary subdirectories as well, and the actual naming of the library directories should not matter.
Taking dompdf as an example here - it will be identified by its dompdf_config.inc.php file.
So you should check:
that this file is really present in the directory where you extracted dompdf to (from your comments, this should be modules/print/lib/dompdf-0.5.1)
that it is readable for your webserver process (you said you changed the permissions - did you do this recursively, and did you adjust the owner and/or group as well?)
The 'key' files used for identifying the other two libraries would be:
tcpdf.php for TCPDF
wkhtmltopdf or wkhtmltopdf.exe for wkhtmltopdf
Just checking - did you extract the libraries from the archives?
The folder would look like /sites/all/modules/print/lib/dompdf for example
wkhtmltopdf:
(Linux) No longer requires an XServer to be running (however the X11 client libs must be installed)
I am 85% sure that Dreamhost doesn't have X11 client libs on their shared hosting; you should have got errors while trying to compile wkhtmltopdf on dreamhost. By the way, try running uname -a in SSH session to dreamhost to find out their OS.
If you did manage to make wkhtmltopdf work on your local test server (which involves compiling the source tarball you linked to), you may have some luck using a pre-compiled static binary version from http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.8.3-static.tar.bz2
dompdf
The only thing dompdf requires is fonts. Have you followed the INSTALL instructions? If yes - try running some conversion with command-line, to see which errors prevent it from functioning. You haven't provided enough information to diagnose this one.

Categories