Word控件Spire.Doc 转换教程(三十):C#、VB.NET 在 Azure 应用程序中将 Word 转换为 PDF

可以使用 Spire.Doc for .NET 在 Azure 应用程序(例如 Azure Web 应用程序和 Azure Functions 应用程序)中执行 Word 到 PDF 的转换。在本文中,您可以看到使用 Spire.Doc for .NET 实现此功能的代码示例。

Spire.Doc for.NET 最新下载

欢迎下载|体验更多E-iceblue产品 技术交流Q群(767755948)   

输入Word文档:

第 1 步:安装 Spire.Doc NuGet 包作为 NuGet.org 项目的参考。

第 2 步:添加以下代码以将 Word 转换为 PDF。

[C#]

//Create a Document instance
Document document = new Document();
//Load the Word document
document.LoadFromFile(@"sample.docx");

//Create a ToPdfParameterList instance
ToPdfParameterList ps = new ToPdfParameterList
{
UsePSCoversion = true
};
//Save Word document to PDF using PS conversion
document.SaveToFile("ToPdf.pdf", ps);

[VB.NET]

Private Sub SurroundingSub()
Dim document As Document = New Document()
document.LoadFromFile("sample.docx")
Dim ps As ToPdfParameterList = New ToPdfParameterList With {
.UsePSCoversion = True
}
document.SaveToFile("ToPdf.pdf", ps)
End Sub

输出 PDF 文档:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值