如何将docx / jpg文件转换为PDF文件 [英] How to convert docx/jpg file into PDF

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

问题描述

你好,

我想在VB.NET中上传.Docx或.Jpg文件然后它会将Docx或JPG文件转换成PDF文件。怎么做到这一点?

Thanx提前......

hello,
I want to upload .Docx or .Jpg file in VB.NET then it will convert Docx or JPG file into PDF File. How to achieve that?
Thanx in Advance....

推荐答案

你有没有谷歌这个?第一个答案之一:如何在vb中创建pdf文件。净 [ ^ ]
Did you google this at all? One of the first answers: how to create pdf file in vb.net[^]


您可以使用类 System.Drawing.Bitmap 读取JPEG:

http://msdn.microsoft.com/en-us/library/ system.drawing.bitmap.aspx [ ^ ]。



对于Word文档,您可以使用适当版本的Office Interop程序集(仅在安装Office时可用),或Open XML SDK ::

http:// www。 microsoft.com/en-us/download/details.aspx?id=30425 [ ^ ]。



这样,您可以支持新的基于XML的Office格式(例如.DOCX,.XLSX),ECMA-376标准:

http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats [ ^ ],

http://en.wikipedia。 org / wiki / Office_Open_XML [ ^ ]。



这是另一种选择: http://npoi.codeplex.com/ [ ^ ]。



要使用PDF,请使用iText或其.NET端口,iTextSharp:

http: //en.wikipedia.org/wiki/IText [ ^ ],

http://itextpdf.com/ [ ^ ],

http://sourceforge.net/projects/itextsharp/ [ ^ ]。



包括对Java iText网站的引用,因为大多数文档都在那里。如果您了解C#,那么理解基于Java的API文档并不困难。



-SA
You can read JPEG using the class System.Drawing.Bitmap:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx[^].

As to Word documents, you can either use Office Interop assembly of appropriate version (only available if Office is installed), or Open XML SDK: :
http://www.microsoft.com/en-us/download/details.aspx?id=30425[^].

This way, you can support new XML-based Office formats (such as .DOCX, .XLSX), ECMA-376 standard:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[^],
http://en.wikipedia.org/wiki/Office_Open_XML[^].

This is another option: http://npoi.codeplex.com/[^].

To work with PDF, use iText, or its .NET port, iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

In included the reference to Java iText site as well, because most documentation is there. If you understand C#, it would not be difficult to understand Java-bases API documentation.

—SA

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

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