有没有办法将word文件的字节数组转换为pdf的字节数组? [英] Is there any way to convert byte array of word file to byte array of pdf?

查看:411
本文介绍了有没有办法将word文件的字节数组转换为pdf的字节数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将word文件的字节数组转换为pdf的字节数组我提到我的系统中没有安装word。



< b>我尝试了什么:



我试过

Is there any way to convert Byte array of word file to byte array of pdf I mentioning that I don't have word install in my system.

What I have tried:

I have tried with

Microsoft.Office.Interop.Word

但要使用这个我必须在我的系统中安装Word。

but to use this I have to install Word in my system.

推荐答案

你需要一个或两个库:

一个可以读取Word文件和可以创建PDF文件的文件,其中第一个输出的格式是第二个(如RTF或HTML)支持的格式或支持直接转换的单个库。



但请注意,结果可能与预期不符;特别是复杂的Word文档。



我不知道一个好的免费C#Word库,但有商业的,如 Aspose.Word 这也可以创建PDF文件。



在网上搜索c#word to pdf会告诉你这个问题已经被提出并回答:

使用Foxit将doc / docx文档转换为PDF读者 [ ^ ]

如何在C#中将word文档转换为pdf [ ^ ]

c# - 如何以编程方式将Word文件转换为PDF? - 堆栈溢出 [ ^ ]
You would need one or two libraries:
One that can read Word files and one that can create PDF files where the output from the first is in a format supported by the second (like RTF or HTML) or a single library that supports direct conversion.

But be aware that the results might not be as expected; especially with complex Word documents.

I don't know of a good free C# Word library but there are commercial ones like Aspose.Word which can also create PDF files.

Searching the web for "c# word to pdf" will show you that this has been asked and answered before:
Convert doc/docx Documents to PDF with Foxit Reader[^]
How to convert word document to pdf in C#[^]
c# - How do I convert Word files to PDF programmatically? - Stack Overflow[^]


这篇关于有没有办法将word文件的字节数组转换为pdf的字节数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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