翻譯|使用教程|編輯:胡濤|2022-03-24 10:37:36.960|閱讀 229 次
概述:本文主要介紹了如何使用Spire.Doc 在C#、VB.NET Azure 應用程序中將 Word 轉換為 PDF,歡迎查閱!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
可以使用 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產品
如需獲取更多產品相關信息請咨詢
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn