为有中文需求的客户提供多渠道中文技术支持.

Fri Apr 01, 2022 10:54 am

有希腊语文件,我暂时精简为3页。

环境

本机环境Mac,转换环境Linux。

本机Mac和Linux均装有 `Arial` 和 `Times New Roman` 字体(从PDF编辑软件看到此PDF中的主要字体)

转换代码

spire库版本 e-iceblue:spire.office:5.3.2

代码

Code: Select all
final PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(src);
pdf.saveToFile(dst, com.spire.pdf.FileFormat.DOCX);



结果

A. 直接对源文件 `case-01.pdf` 进行转换,得到 `case-01.docx` ,结果为:
1)出现4种字体: Arial,Times New Roman Italic-QWVTR, Times New Roman-PHLJT 和 Times New Roman
2)Arial和Times New Roman的文本正常
3)Times New Roman Italic-QWVTR 字母部分正常、阿拉伯数字部分显示为乱码
4)Times New Roman-PHLJT 基本都是乱码
5)如果手工在Word中将 Times New Roman Italic-QWVTR 改为 Times New Roman (无后缀)结果不变(阿拉伯数字无法正常显示),但改为 Google 的 Noto Sans 则显示正常
6)如果手工在Word中将 Times New Roman-PHLJT 改为 Times New Roman (无后缀)则所有字母均正常显示

B. 若尝试使用Mac的预览工具编辑文件(例如删除其中一页)得到 `case-01-mac-preview-edited.pdf`,转换后得到 `case-01-mac-preview-edited.docx`,则转换后所有字体全部变成乱码,且无法通过修改字体来恢复

以上4份文件见附件

cococolin
 
Posts: 16
Joined: Wed Jan 12, 2022 6:50 am

Fri Apr 01, 2022 10:59 am

我又在本机(mac)进行了测试,效果一致,但会多出一些日志信息:

Code: Select all
2022-04-01 18:04:45.732 java[23386:675734] CoreText note: Client requested name ".NewYork-BoldG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.732 java[23386:675734] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2022-04-01 18:04:45.735 java[23386:675734] CoreText note: Client requested name ".NewYork-BoldG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.738 java[23386:675734] CoreText note: Client requested name ".NewYork-BoldG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.741 java[23386:675734] CoreText note: Client requested name ".NewYork-BoldG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.744 java[23386:675734] CoreText note: Client requested name ".NewYork-BoldItalicG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.747 java[23386:675734] CoreText note: Client requested name ".NewYork-BoldItalicG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.749 java[23386:675734] CoreText note: Client requested name ".NewYork-BoldItalicG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.752 java[23386:675734] CoreText note: Client requested name ".NewYork-BoldItalicG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.755 java[23386:675734] CoreText note: Client requested name ".NewYork-RegularG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.757 java[23386:675734] CoreText note: Client requested name ".NewYork-RegularG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.760 java[23386:675734] CoreText note: Client requested name ".NewYork-RegularG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.762 java[23386:675734] CoreText note: Client requested name ".NewYork-RegularG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.765 java[23386:675734] CoreText note: Client requested name ".NewYork-RegularItalicG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.767 java[23386:675734] CoreText note: Client requested name ".NewYork-RegularItalicG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.770 java[23386:675734] CoreText note: Client requested name ".NewYork-RegularItalicG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.772 java[23386:675734] CoreText note: Client requested name ".NewYork-RegularItalicG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.775 java[23386:675734] CoreText note: Client requested name ".SFArabic-Black", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.778 java[23386:675734] CoreText note: Client requested name ".SFArabic-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.781 java[23386:675734] CoreText note: Client requested name ".SFArabic-Heavy", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.783 java[23386:675734] CoreText note: Client requested name ".SFArabic-Light", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.786 java[23386:675734] CoreText note: Client requested name ".SFArabic-Medium", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.788 java[23386:675734] CoreText note: Client requested name ".SFArabic-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.791 java[23386:675734] CoreText note: Client requested name ".SFArabic-Semibold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.794 java[23386:675734] CoreText note: Client requested name ".SFArabic-Thin", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.797 java[23386:675734] CoreText note: Client requested name ".SFArabic-Ultralight", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.799 java[23386:675734] CoreText note: Client requested name ".SFCompact-Black", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.802 java[23386:675734] CoreText note: Client requested name ".SFCompact-BlackItalic", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.806 java[23386:675734] CoreText note: Client requested name ".SFCompact-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.809 java[23386:675734] CoreText note: Client requested name ".SFCompact-BoldG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.812 java[23386:675734] CoreText note: Client requested name ".SFCompact-BoldG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.814 java[23386:675734] CoreText note: Client requested name ".SFCompact-BoldG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.817 java[23386:675734] CoreText note: Client requested name ".SFCompact-BoldG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:45.820 java[23386:675734] CoreText note: Client requested name ".SFCompact-BoldItalic", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
...
2022-04-01 18:04:46.013 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedBlack", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.015 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedBold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.018 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedBoldG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.021 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedBoldG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.023 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedBoldG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.026 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedBoldG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.029 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedHeavy", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.032 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedHeavyG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.034 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedHeavyG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.037 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedHeavyG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.039 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedHeavyG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.042 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedLight", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.045 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedLightG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.047 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedLightG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.050 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedLightG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.052 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedLightG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.055 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedMedium", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.057 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedMediumG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.060 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedMediumG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.063 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedMediumG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.065 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedMediumG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.068 java[23386:675734] CoreText note: Client requested name ".SFNS-CompressedRegular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
...
2022-04-01 18:04:46.934 java[23386:675734] CoreText note: Client requested name ".SFNS-UltraCompressedThinG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.937 java[23386:675734] CoreText note: Client requested name ".SFNS-UltraCompressedUltralight", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.940 java[23386:675734] CoreText note: Client requested name ".SFNS-UltraCompressedUltralightG1", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.943 java[23386:675734] CoreText note: Client requested name ".SFNS-UltraCompressedUltralightG2", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.946 java[23386:675734] CoreText note: Client requested name ".SFNS-UltraCompressedUltralightG3", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-04-01 18:04:46.949 java[23386:675734] CoreText note: Client requested name ".SFNS-UltraCompressedUltralightG4", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].


根据转换日志,担心可能有如下4个字体缺失:

- NewYork
- SFArabic
- SFCompact
- SFNS

于是在转换服务器(Linux)上检查了一下,确保这些字体及其样式均是存在的:

Code: Select all
root@bcc294ebbf7e:/app# fc-list | grep -e NewYork -e SFArabic -e SFCompact -e SFNS | awk '{ print $1" "$NF }' | sort | uniq
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: G1
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: G2
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: G3
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: G4
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: York
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: York:style=Black
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: York:style=Bold
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: York:style=Heavy
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: York:style=Medium
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: York:style=Regular
/usr/local/share/fonts/my-fonts/apple-default/NewYork.ttf: York:style=Semibold
/usr/local/share/fonts/my-fonts/apple-default/NewYorkItalic.ttf: G1
/usr/local/share/fonts/my-fonts/apple-default/NewYorkItalic.ttf: G2
/usr/local/share/fonts/my-fonts/apple-default/NewYorkItalic.ttf: G3
/usr/local/share/fonts/my-fonts/apple-default/NewYorkItalic.ttf: G4
/usr/local/share/fonts/my-fonts/apple-default/NewYorkItalic.ttf: Italic
/usr/local/share/fonts/my-fonts/apple-default/NewYorkItalic.ttf: York
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Black
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Bold
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Heavy
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Light
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Medium
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Regular
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Semibold
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Thin
/usr/local/share/fonts/my-fonts/apple-default/SFArabic.ttf: Arabic:style=Ultralight
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Black
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Bold
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Heavy
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Light
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Medium
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Regular
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Semibold
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Thin
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: Compact:style=Ultralight
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: G1
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: G2
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: G3
/usr/local/share/fonts/my-fonts/apple-default/SFCompact.ttf: G4
/usr/local/share/fonts/my-fonts/apple-default/SFCompactItalic.ttf: Compact
/usr/local/share/fonts/my-fonts/apple-default/SFCompactItalic.ttf: G1
/usr/local/share/fonts/my-fonts/apple-default/SFCompactItalic.ttf: G2
/usr/local/share/fonts/my-fonts/apple-default/SFCompactItalic.ttf: G3
/usr/local/share/fonts/my-fonts/apple-default/SFCompactItalic.ttf: G4
/usr/local/share/fonts/my-fonts/apple-default/SFCompactItalic.ttf: Italic
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Black
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Bold
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Heavy
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Light
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Medium
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Regular
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Semibold
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Thin
/usr/local/share/fonts/my-fonts/apple-default/SFCompactRounded.ttf: Rounded:style=Ultralight
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Black
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Bold
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: G1
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: G2
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: G3
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: G4
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Heavy
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Light
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Medium
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Black
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Bold
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Heavy
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Light
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Medium
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Regular,標準體,Almindelig,Κανονικά,Normaali,Courant,רגיל,Szabályos,Regolare,レギュラー,일반체,Regulier,Normal,Обычный,ปกติ,Reguler,Звичайний,Thường,Biasa,常规体,عادي
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Semibold
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Thin
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: NS:style=Ultralight
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Regular
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Semibold
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Thin
/usr/local/share/fonts/my-fonts/apple-default/SFNS.ttf: Ultralight
/usr/local/share/fonts/my-fonts/apple-default/SFNSItalic.ttf: Italic
/usr/local/share/fonts/my-fonts/apple-default/SFNSItalic.ttf: NS
/usr/local/share/fonts/my-fonts/apple-default/SFNSItalic.ttf: regular
/usr/local/share/fonts/my-fonts/apple-default/SFNSMono.ttf: Mono
/usr/local/share/fonts/my-fonts/apple-default/SFNSMono.ttf: Mono:style=Bold
/usr/local/share/fonts/my-fonts/apple-default/SFNSMono.ttf: Mono:style=Heavy
/usr/local/share/fonts/my-fonts/apple-default/SFNSMono.ttf: Mono:style=Light
/usr/local/share/fonts/my-fonts/apple-default/SFNSMono.ttf: Mono:style=Medium
/usr/local/share/fonts/my-fonts/apple-default/SFNSMono.ttf: Mono:style=Regular
/usr/local/share/fonts/my-fonts/apple-default/SFNSMono.ttf: Mono:style=Semibold
/usr/local/share/fonts/my-fonts/apple-default/SFNSMonoItalic.ttf: Italic
/usr/local/share/fonts/my-fonts/apple-default/SFNSMonoItalic.ttf: Mono
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: G1
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: G2
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: G3
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: G4
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Black
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Bold
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Heavy
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Light
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Medium
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Regular
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Semibold
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Thin
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Ultralight
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=UltralightG1
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=UltralightG2
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=UltralightG3
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=UltralightG4
/usr/local/share/fonts/my-fonts/apple-default/SFNSRounded.ttf: Rounded:style=Ultrathin

cococolin
 
Posts: 16
Joined: Wed Jan 12, 2022 6:50 am

Sat Apr 02, 2022 10:28 am

你好,

感谢咨询,下面是我对你问题的答复。
1. 我在Mac和Linux(Centos7)测试了转换case-01.pdf到word,没有发现生成文档内容乱码。 你文档中使用到了Times New Roman Italic-QWVTR和Times New Roman-PHLJT,我在网上没有找到这两种字体资源,似乎是不存在的字体名。我们产品转换文档会在系统中找对应的字体绘制文本,如果找不到字体就可能会出现乱码的情况。另外我注意到你文档并没有使用NewYork等字体,我在Mac和Linux上转换也没有遇到报错。 请再次确认下你那边报错的文档是否是你提供给我的,也请提供下你Mac和Linux的详细系统版本给我们进一步调查。我将我在Mac和Linux转换的结果都附上了,你也可以参考下。

2. 我测试转换case-01-mac-preview-edited.pdf到word,确实发现生成的内容乱码。经调查这不是我们产品导致的问题,即使是使用Adobe PDF保存此文档到Word,或者拷贝PDF内容到Word/TXT,均是乱码情况。因此推断这个问题是你PDF文档自身的字体映射错误导致的。

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Sun Apr 03, 2022 3:59 am

感谢。

可能是我没有表述清楚。PDF文档中我只看到了Arial和Times New Roman两种字体,但通过spire转换获得的Word文档(case-01.docx)中却出现了Times New Roman Italic-QWVTR, Times New Roman-PHLJT 这两种奇怪的字体(可以通过Word打开后观察到)。

我之前是在Mac上用Word打开case-01.docx文档看到了乱码,刚刚又在Windows上测试了一下,显示正常。开始怀疑是Mac Word的问题,但我又用万兴的PDFElement和smallpdf.com转换了一下,发现转出来用Mac Word打开是正常的(而且字体也是不带后缀的Times New Roman)。

另外 case-01-mac-preview-edited.pdf 通过spire转换你那边也测试得到了乱码,我使用PDFElement和smallpdf.com转换获得了正确的Word文档,基本可以确定是转换引擎的差异导致。

我这边还有多个不同客户提交的文档均为相同问题,我随手追加了额外两个case,并且把源文件、spire转换(及Mac Office截图)、PDFElement转换文档(及Mac Office截图)一起打包在附件中,供参考(文件已通过QQ发送)。

cococolin
 
Posts: 16
Joined: Wed Jan 12, 2022 6:50 am

Wed Apr 06, 2022 10:34 am

您好,

感谢您的回复。
1.我注意到word里面的Times New Roman Italic字体带有QWVTR、PHLJT两种后缀,我已经将此问题提交给研发部门,编号为SPIREPDF-5047, 如果有任何进展我会及时反馈到您的。
2.我使用Mac打开word没有发现乱码问题,我猜测可能也是因为那两种包含后缀的字体名在您的Mac环境中无法被正确识别。
3.我已经将转换case-01-mac-preview-edited.pdf文档乱码的问题移交给研发再调查下是否有解决办法,问题编号为SPIREPDF-5046。我消息我会反馈到您。很抱歉给您带来的不便之处。

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Wed Jul 26, 2023 10:02 am

您好,

感谢您的耐心等待。
很高兴通知您我们最新发布了Spire.Pdf 9.7.8 for Java,修复了你提出的问题SPIREPDF-5047,您可以通过以下链接下载或者通过Maven导入然后进行测试。
网站链接:https://www.e-iceblue.cn/Downloads/Spire-PDF-JAVA.html
Maven:
Code: Select all
<repositories>
    <repository>
        <id>com.e-iceblue</id>
        <name>e-iceblue</name>
        <url>https://repo.e-iceblue.cn/repository/maven-public/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.pdf</artifactId>
        <version>9.7.0</version>
    </dependency>
</dependencies>


Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to 中文技术支持