Is there a way to make FPDF/FPDI or Zend_Pdf support the parsing of PDFs greater than 1.4?

前端 未结 7 1075
悲哀的现实
悲哀的现实 2020-12-08 12:06

I am trying to add an existing PDF (created otherwise) to a PDF created with FPDF using FPDI. It seems to work find for most PDFs, but I get the following error:

<         


        
相关标签:
7条回答
  • 2020-12-08 12:12

    Setasign is offering a PDF parser as a commercial addon to FPDI. We had no troubles parsing PDF files up to version 1.7 so far using the new parser.

    0 讨论(0)
  • 2020-12-08 12:15

    You can use FPDI with TCPDF, it will generate and read (with FPDI) version 1.7 PDFs.

    See TCPDF - PHP class for PDF.


    EDIT

    I have recently been challenged with the issue of using various versions and formats of PDF with FPDI and TCPDF, and I can confirm that PDF versions above 1.4 are hit and miss, the interesting thing is that I have a lot of working 1.7 PDFs, and works about 50/50 on 1.5 and 1.6.

    I worked around the issue by converting all non-workable PDF files to v1.4 using GhostScript which you can exec from the command line. Use ps2pdf14 from the GhostScript lib folder.

    0 讨论(0)
  • 2020-12-08 12:19

    my team had removed some part of the code. we stopped the code from adding watermark to the pdf. this solved the problem for us. PDF >= 1.5

    0 讨论(0)
  • 2020-12-08 12:22

    I've just released a pair of projects (TCPDI / tcpdi_parser, based on FPDI and tcpdf_parser, respectively) which work with TCPDF 6 (and FPDF_TPL) to import PDFs above v1.4 (tested up to 1.6 so far, but I'll make sure it works with 1.7 once I find a 1.7 PFD to test it with!) without requiring any commercial addons. Basic installation and usage instructions can be found in the TCPDI README; please feel free to try it out and report any issues via the Github tracker.

    0 讨论(0)
  • 2020-12-08 12:24

    I found that using commerical version of FPDI PDF-Parser solved my problem. I've been using it for a year now and haven't had any PDFs it couln't parse (unless the PDF was corrupt or had something else weird going on).

    0 讨论(0)
  • 2020-12-08 12:24

    for symfony, I used this lib to convert >1.4 https://packagist.org/packages/xthiago/pdf-version-converter

    0 讨论(0)
提交回复
热议问题