文檔金喜正規買球>>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產品
如需獲取更多產品相關信息請咨詢