문제

We have a system working following way:

  1. PDF file is generated on server using mPDF library.
  2. User looks at generated PDF file in browser and sometimes prints it to virtual printer which creates EMF file.
  3. EMF file analyzed to extract text information.
  4. Extracted text information is further processed.

My part of this process is to extract text information from EMF file. And my algorithms work fine when EMF file does contain text information. But when PDF file is printed to virtual printer printing software replaces some parts of text information with lines and curves thus making impossible to extract text information from EMF.

I investigated this problem a lot of time and concluded there are no common soulution for every printed PDF. But at the same time i discovered that printing software replaces only those parts of text which use embedded OpenType fonts.

So in this particular case if i could configure mPDF to not use embedded OpenType fonts then problem will be solved.

My question is if it is possible to configure mPDF in a way to not use embedded OpenType fonts?

도움이 되었습니까?

해결책

I received an answer from Ian Back, author of mPDF, stating that current version (5.3) is not able to create document without embedded fonts:

mPDF does not have an option to do this. I did try at one stage, but found great problems in getting it to work, and then decided it wasn't worth it, because it relies on the user having the correct file (and file version) installed on their computer.

다른 팁

Since mPDF is built on top of FPDF, I would imagine it is possible to do so. Fonts for FPDF must be prepared as .php files, so removing those should make mPDF render documents without them.

Try renaming TTF folder: /ttfontdata/.

This is a hack, but it should work. (Note: I haven't tried it)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top