我在使用 pdf2md 库时遇到输出文件中的土耳其语问题。这个问题似乎在不同的文档中表现不一致,在某些情况下出现,但在其他情况下则不然。
我转换 example-normal.pdf 文件时的消息:
Warning: fetchStandardFontData: failed to fetch file "FoxitSans.pfb" with "UnknownErrorException: Unable to load font data at: C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fontsFoxitSans.pfb". Writing to example-normal.md... Done.
我转换 example-withe-error.pdf 文件时的消息:
Warning: fetchStandardFontData: failed to fetch file "FoxitSerifBold.pfb" with "UnknownErrorException: Unable to load font data at: C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fontsFoxitSerifBold.pfb". Warning: fetchStandardFontData: failed to fetch file "FoxitSerifBoldItalic.pfb" with "UnknownErrorException: Unable to load font data at: C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fontsFoxitSerifBoldItalic.pfb". Warning: fetchStandardFontData: failed to fetch file "FoxitSerif.pfb" with "UnknownErrorException: Unable to load font data at: C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fontsFoxitSerif.pfb". Warning: fetchStandardFontData: failed to fetch file "FoxitSansBoldItalic.pfb" with "UnknownErrorException: Unable to load font data at: C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fontsFoxitSansBoldItalic.pfb". Warning: fetchStandardFontData: failed to fetch file "FoxitSerifItalic.pfb" with "UnknownErrorException: Unable to load font data at: C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fontsFoxitSerifItalic.pfb". Warning: fetchStandardFontData: failed to fetch file "FoxitSans.pfb" with "UnknownErrorException: Unable to load font data at: C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fontsFoxitSans.pfb". Writing to example-withe-error.md... Done.
您可以参考正常情况下的文件:
此外,您可以查看显示错误场景的文件:
“UnknownErrorException:无法在以下位置加载字体数据:C:\Users\lorens\Desktop\pdf-md2 ode_modules\pdfjs-dist\standard_fontsFoxitSans.pfb"。写入 example-withe-error.md...完成。
字体路径缺少 "\",路径应该是一些
C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fonts\FoxitSans.pfb
而不是 C:\Users\lorens\Desktop\pdf-md2\node_modules\pdfjs-dist\standard_fontsFoxitSans.pfb
。
检查是否可以配置一些选项来更改字体路径。