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