converting docx to pdf

拟墨画扇 提交于 2021-01-29 10:16:37

问题


I am converting docx to pdf which works fine. But the problem is it misses the formatting the document. How to ensure the formatting such as [bold, tablets etc]] are not lost while converting.

I am using docx4j for conversion.

Below is the exception I am getting

NOT IMPLEMENTED: support for w:ptab -
NOT IMPLEMENTED: support for w:ptab -3
NOT IMPLEMENTED: support for w:altChunk -
NOT IMPLEMENTED: support for w:altChunk -
NOT IMPLEMENTED: support for w:altChunk -
NOT IMPLEMENTED: support for w:altChunk -
NOT IMPLEMENTED: support for w:altChunk -
NOT IMPLEMENTED: support for w:altChunk -

回答1:


ptab: as it says, there is currently no support for the ptab element. Its not commonly used. You can either remove it from your docx, or we could look at adding support for it to docx4j.

altChunk: these need to be preprocessed into "real" docx content for docx4j's PDF output. If the altChunk is of type XHTML, docx4j can do that. If it is a docx altChunk, the Enterprise Edition is required. There are other types of altChunks, which you should avoid if you want to convert to PDF...



来源:https://stackoverflow.com/questions/22907006/converting-docx-to-pdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!