如何将xlsx / docx文件转换为PDF格式而不丢失数据? [英] How to convert xlsx/docx files to PDF format with out data loss?

查看:158
本文介绍了如何将xlsx / docx文件转换为PDF格式而不丢失数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我需要将doc,docx,xl​​s,xlsx,tiff,txt文件转换为PDf格式。



txt,tiff,Xls ,使用java代码已经实现了Doc转换。

但问题是在转换Docx / Xlsx时数据丢失了。



你能不能请任何人帮助我实现这一目标。

In my project i hava a requirment to convert doc,docx,xls,xlsx,tiff,txt files to PDf format.

The txt,tiff,Xls,Doc convertion already achieved using java code.
But the problem is while converting Docx/Xlsx the data was missing.

Can you please any one help me to achieve this.

推荐答案

对于您列出的文件格式,doc,docx,xl​​s,xlsx,tiff和txt文件是数据格式。 PDF是一种打印机格式,其中PDF页面是打印机页面的图像或投影。在Linux世界中甚至还有一些工作要打印到PDF格式,作为与真实打印机通信的一个步骤(作为减少打印机驱动程序数量的方法)。



如果您想要将某些内容转换为PDF,则只需打印它,并将PDF作为输出类型。如果您正在查看PDF中缺少某些内容,则错误在于如何将文档打印为PDF。这与打印到实际的打印机设备没什么不同。
For the file formats you have listed, doc, docx, xls, xlsx, tiff, and txt files are data formats. PDF is a printer format, in that PDF pages are an image or projection of a printer page. There is even some work in the linux world to 'print' to PDF format as a step in communicating with a real printer (as a way to reduce the rediculous number of printer drivers).

If you want to 'convert' something to PDF, you merely print it, with PDF as output type. If there is something missing in the PDF that you are looking at, the fault lies in how the document was 'printed' to PDF. This is no different from printing to an actual printer device.


可以使用java程序将任何类型的文档(doc,docx,xl​​s,xlsx,tiff,txt)文件转换为PDF。

请在给定链接中找到文档转换的代码。

转换为PDF
Any type of document (doc, docx, xls, xlsx, tiff, txt) file can be converted to PDF using java program.
Please find the code for document conversion in the given link.
Convert to PDF


严格来说,没有数据丢失就无法完全完成,因为PDF的本质,而不是Office文档。 Excel和其他Office文档包含更多信息:它们灵活,流畅,可以呈现为不同的纸张大小。此外,它们支持内部结构:例如,如果你的Words文档中有自动编号的部分,你可以随时添加一个新部分,内容将自动重新编号,TOC更新,以及更多类似的东西,特别是风格。 Excel文档包含公式。它们是结构化的:它们执行,而不是在纸上呈现。



使用PDF,几乎所有这些信息都会丢失。



请查看我过去的答案:

将Office文档转换为PDF没有互操作 [ ^ ] ,

问题将单词转换为PDF,无需官方或openoffice [ ^ ]。



-SA
Strictly speaking, it cannot be done totally without data loss, due to the nature of PDF, as opposed to Office documents. Excel and other Office documents carry much more information: they are flexible, fluid, can be rendered to different paper sizes. Besides, they support inner structure: for example, if you have auto-numbered sections in your Words document, you can always add a new one, and the content will be automatically re-numbered, TOC updated, and a lot more stuff like that, notably, styles. Excel documents contain formulas. They are structured: they execute, not rendered on paper.

With PDF, nearly all such information is lost.

Please see my past answers:
Convert Office-Documents to PDF without interop[^],
Question Convert word to PDF without offce or openoffice[^].

—SA


这篇关于如何将xlsx / docx文件转换为PDF格式而不丢失数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆