带有嵌入字体的损坏的.rtf文件
我正在开发一个用 Java 编写的程序,它使用 LibreOffice 将文档转换为 .pdf 格式。客户方使用Microsoft Word。
该程序的功能是通过程序接口,客户端将文档上传到其服务器。原来,程序首先读取文档的格式和内容,然后将内容保存在.pdf中,并将这个文档保存在服务器上。
我在使用启用了嵌入字体选项的 .rtf 文档时遇到了问题。问题是,在 Microsoft Word 中处理文档时,一切正常。但是如果这个文档是在LibreOffice Writer中打开的(版本没关系,我从6.0.0.1到7.3.1尝试过),那么文档就会损坏,即使这些是手动完成的,例如在 Windows 桌面上。即文档内的表格显示不正确。如果我在 Microsoft Word 中再次打开它,该文档仍然“已损坏”。但是,如果在 Microsoft Word 中的这些操作之前关闭嵌入字体选项,然后在 LibreOffice 中打开它或通过我的程序将其上传到服务器,那么一切都会正常工作。在执行代码时和手动完成此操作时都会发生此错误。
我认为该问题与 .doc 和 .docx 的此主题有关 格式,但在这里我通过从 Windows Server 2016 切换到 Windows Server 2019 解决了所有问题,但即使在 Windows Server 2019 上,问题.rtf 仍然存在。 Windows 10 中也存在同样的问题。
您能告诉我如何解决该问题以使嵌入字体功能保持活动状态吗?因为我不能告诉客户不要使用嵌入字体。
谢谢!
聚苯乙烯 抱歉,我无法提供实际文件。它包含非常重要的客户信息。编辑或替换文本时以及保存后,Word 程序保存的文件也会损坏。因此,我将留下一个指向“正常”文件和损坏文件的图像的链接 ,明确什么是“损坏”。
I’m working on a program written in Java that uses LibreOffice to convert documents to .pdf format. Clients on their side use Microsoft Word.
The functionality of the program is such that through the program interface, clients upload documents to their server. It turns out that at first, the program reads the format and content of the document, then saves the content in .pdf and saves this document on the server.
I ran into a problem when working with a .rtf document that has the embed fonts option enabled. The problem is that when working with a document in Microsoft Word, everything works well. But if this document is opened in LibreOffice Writer (it doesn’t matter the version, I tried from 6.0.0.1 to 7.3.1), then the document is damaged, even if these are done manually, for example, on the Desktop in Windows. That is, the table inside the document is not displayed correctly. If I open it again in Microsoft Word, the document remains “damaged”. But if BEFORE these manipulations in Microsoft Word turn off the embed fonts option and then open it in LibreOffice or upload it to the server through my program, then everything will work fine. This error occurs both when working through the code and if this is done manually.
I think that the problem is related to this topic for the .doc and .docx format, but here I solved everything by switching from Windows Server 2016 to Windows Server 2019, but even on Windows Server 2019, the problem with .rtf remains. The same problem exists in Windows 10.
Can you tell me how to fix the problem so that the embed fonts function remains active? Because I can’t tell clients not to use embed fonts.
Thanks!
P.S.
Sorry, I can’t provide the actual file. It contains very important customer information. When editing or replacing text and after saving, the file is also saved damaged for the Word program. Therefore, I will leave a link to the image of the “normal” file and the damaged one, to make it clear what “corrupted” is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论