Useless merging PDF files (PHP)

I am currently using ImageMagick to combine multiple PDF files into one in a PHP script on my Linux system. However, the resulting PDF files are of very poor quality. I came across pdftk , which seems to have better quality after the merge, but I need to use ImageMagick if possible, because I need to get a script to run on another server that doesn't have pdftk (and it would be painful to get it there) .

How can I combine PDF files using ImageMagick and PHP with lossless quality?

+1
source share
2 answers

ImageMagick cannot compress PDF without loss. If you have a Linux server, you can try pdfconcat (which resets the merge very quickly):

$ wget -O pdfconcat http://www.math.bme.hu/~pts/cvsget.cgi/u=bin.i386/p=/M=bin.i386/c=f1/n=/bin.i386/pdfconcat
$ chmod +x pdfconcat
$ ./pdfconcat -o output.pdf input1.pdf input2.pdf input3.pdf
+4
source

My CAM :: PDF The Perl library includes a flexible command line tool called appendpdf.pl that can mix arbitrary PDF pages into another document.

0
source

Source: https://habr.com/ru/post/1731560/


All Articles