开发者

File previewers for PDF and Docx

开发者 https://www.devze.com 2023-04-11 20:20 出处:网络
I would like to have a preview of a .pdf, .docx or .doc file inside a JDialog. But I\'m unable to find previewers that allow nesting of such previews inside a Swing application. Alternatively are ther

I would like to have a preview of a .pdf, .docx or .doc file inside a JDialog. But I'm unable to find previewers that allow nesting of such previews inside a Swing application. Alternatively are there any previewers开发者_运维知识库 that can transform such files into .html and then display them in a TextPane.

Fidelity isn't that much of an issue as is embedding and ease of use. Also I don't require one tool to be able to preview all types of files.


That's a tough one because of the formats you're dealing with. You might want to try ImageMagik for PDF -> image format for display in your TextPane. If that works well enough for PDFs, then you could use JOD Converter or Docmosis to get from Doc -> PDF then ImageMagick again for a display image. JODConverter and Docmosis are based on OpenOffice which can do pretty rough html / xhtml output as another option for display. The latest version of OpenOffice can read docx also, meaning all your bases are covered, and if fidelity is not too big a deal as you've indciated, then JODConverter/Docmosis and ImageMagick might be a combo you can use.

0

精彩评论

暂无评论...
验证码 换一张
取 消