文档半岛外围网上直营>>E-iceblue中文文档>>将 Word 转换为 PDF
将 Word 转换为 PDF
可以使用 Spire.Doc for .NET 在 Azure 应用程序(例如 Azure Web 应用程序和 Azure Functions 应用程序)中执行 Word 到 PDF 的转换。在本文中,您可以看到使用 Spire.Doc for .NET 实现此功能的代码示例。
输入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 文档:
欢迎下载|体验更多E-iceblue产品
如需获取更多产品相关信息请咨询


QQ交谈
在线咨询

渝公网安备
50010702500608号

客服热线