且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

mPDF错误:找不到外部参照表

更新时间:2023-11-10 18:37:34

这可能是由与您正在运行的mPDF不兼容的PDF文件引起的.您通常可以通过退回原始PDF文件来解决此问题.

This can be caused by PDF files of a version incompatible with the mPDF you're running. You can often circumvent the problem by regressing the source PDF files.

例如,对于mPDF v6.0,请尝试使用Ghostscript之类将PDF最多压缩到v1.4. (其中old.pdf是您的源文件)

For instance, for mPDF v6.0 try brining your PDFs down to at most v1.4 using something like Ghostscript. (Where old.pdf is you're sourcefile)

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -o new.pdf old.pdf

Ghostscript不会将其写入正在读取的文件中,因此,如果您以内联方式进行此操作,则必须跳舞;

Ghostscript won't write to the file it's reading so if you're doing this inline you'll have to dance;

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -o new.pdf old.pdf; mv -f new.pdf old.pdf