Convert PDF version 1.7 to version 1.6 using only php

I am working on an API that gives me PDF (ver 1.7) in response, and my project uses the zend pdf library, which does not support parsing PDF version 1.7.

So, I decided to convert the PDF version for compatibility with Zend Pdf.

Is there a way to convert a PDF version to an older version using php?

thanks

+6
source share
2 answers

You can do it in Ghostscript. I was looking for a solution to a similar problem, and trying so many different scripts, the most reliable is a ghost script.

$command = "gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=pdf_out.pfg pdf_in.pdf"; $p_result = exec($command); 

these are options for your pdf file;

-dPDFSETTINGS = / screen (screen quality only, 72 dpi)

-dPDFSETTINGS = / ebook (low quality images, 150 dpi)

-dPDFSETTINGS = / printer (high quality, 300 dpi)

-dPDFSETTINGS = / prepress (high quality, color preservation, 300 dpi imgs)

-dPDFSETTINGS = / default (almost identical / screen)

The problem is this: you have a steak, and you want it to convert a different type of steak, so other violins take your steak, turning into minced meat and than make the steak again. Thus, the result will never be the same. For example, if your pdf-text received the text, click "click here" and go to the site www.example.com, after converting the pdf version the link "click here" will be deleted.

0
source

You should not rely on ZendPdf . This is an abandoned and incomplete project, and the ZendPdf main page suggests that you should use TCPDF .

0
source

All Articles