翻譯|使用教程|編輯:李顯亮|2021-06-02 10:36:48.417|閱讀 392 次
概述:可以使用 Spire.Doc for .NET 在 Azure 應用程序(例如 Azure Web 應用程序和 Azure Functions 應用程序)中執行 Word 到 PDF 的轉換。在本文中,您可以看到使用 Spire.Doc for .NET 實現此功能的代碼示例。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Spire.Doc for .NET是一個專業的Word .NET庫,設計用于幫助開發人員高效地開發創建、閱讀、編寫、轉換和打印任何來自.NET( C#, VB.NET, ASP.NET)平臺的Word文檔文件的功能。
可以使用 Spire.Doc for .NET 在 Azure 應用程序(例如 Azure Web 應用程序和 Azure Functions 應用程序)中執行 Word 到 PDF 的轉換。在本文中,您可以看到使用 Spire.Doc for .NET 實現此功能的代碼示例。
輸入的Word文檔:
第 1 步:安裝 Spire.Doc NuGet 包作為對您項目的參考。
第 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
輸出文件
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn