在實際環境中測試
在生產環境中測試無浮水印。
在任何需要的地方都能運作。
IronPDF 和 Aspose PDF .NET 是兩個強大的庫,用於在 .NET 應用程式中進行 PDF 操作。 每個都提供獨特的功能集,以促進 PDF 文件的創建、編輯和處理。 在這篇文章中,我們將查看這兩種工具提供的一些功能,以及它們的授權選項、文件和支援。
IronPDF 是為 .NET 開發人員設計的綜合 PDF 庫。 它提供功能以從各種來源(包括 HTML、ASPX 和 URL)創建、編輯和渲染 PDF 文件。 IronPDF由於易於整合及其支持現代網絡標準(如 CSS3、HTML5 和 JavaScript)的廣泛功能集,而被廣泛使用。 IronPDF 專注於以最少的代碼交付高保真 PDF,非常適合尋求強大且使用者友好的 PDF 文件解決方案的開發人員。
Aspose.PDF for .NET 是一個複雜的 API,能夠處理複雜的 PDF 文件操作。 此程式庫允許開發人員在各種 .NET 平台上創建、修改和操作 PDF 文件,包括 WinForms、WPF、ASP.NET 和 .NET Core。 使用託管C#編寫的Aspose.PDF強調靈活性和性能,使其適合需要進行複雜PDF操作的企業級應用程式。
IronPDF 和 Aspose.PDF 都提供與 .NET Framework、.NET Core、Azure 和 Windows 的強大相容性。 然而,雖然 IronPDF 立即提供跨平臺相容性,但 Aspose.PDF 無法在跨平臺環境中運行,而需要 Aspose.Pdf.Drawing 套件。
考慮到這一點,IronPDF以其廣泛的跨平台兼容性為榮,支援各種.NET版本、.NET專案類型和作業系統。 以下是 IronPDF 的關鍵相容性重點:
在比較 IronPDF 和 Aspose.PDF 時,查看每個庫提供的具體功能是至關重要的。 以下是關鍵功能的細分:
以下的代碼範例展示如何將 HTML 內容轉換為 PDF,比較兩個產品如何完成此任務。
IronPDF:
using IronPdf;
// Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from an HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: images, CSS and JavaScript.
var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
using IronPdf;
// Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from an HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: images, CSS and JavaScript.
var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
Imports IronPdf
' Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate Renderer
Dim renderer = New ChromePdfRenderer()
' Create a PDF from an HTML string using C#
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")
pdf.SaveAs("output.pdf")
' Advanced Example with HTML Assets
' Load external html assets: images, CSS and JavaScript.
Dim myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
myAdvancedPdf.SaveAs("html-with-assets.pdf")
Aspose.PDF
using Aspose.Pdf;
using Aspose.Pdf.Text;
Document doc = new Document();
Page page = doc.Pages.Add();
HtmlFragment text = new HtmlFragment("<h1>Hello World</h1>");
page.Paragraphs.Add(text);
doc.Save("output.pdf");
using Aspose.Pdf;
using Aspose.Pdf.Text;
Document doc = new Document();
Page page = doc.Pages.Add();
HtmlFragment text = new HtmlFragment("<h1>Hello World</h1>");
page.Paragraphs.Add(text);
doc.Save("output.pdf");
Imports Aspose.Pdf
Imports Aspose.Pdf.Text
Private doc As New Document()
Private page As Page = doc.Pages.Add()
Private text As New HtmlFragment("<h1>Hello World</h1>")
page.Paragraphs.Add(text)
doc.Save("output.pdf")
IronPDF 為用戶提供了一種精簡而簡潔的方法來將 HTML 內容轉換為 PDF 文件,得益於其對現代網頁標準的優秀支持,使得過程變得輕鬆簡單。 Aspose.PDF 提供強大的 API,能夠處理 HTML 到 PDF 的轉換; 然而,這個過程可能被認為不那麼簡單,需進行更多步驟。
在處理涉及敏感資訊或將私人數據寫入 PDF 文件的環境中,加密和解密 PDF 文件的能力可能是必不可少的。 以下,我們比較這兩個產品如何處理加密PDFs.
IronPDF:
using IronPdf;
using System;
// Open an Encrypted File, alternatively create a new PDF from Html
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
// Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = DateTime.Now;
// Edit file security settings
// The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption();
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
pdf.SecuritySettings.AllowUserAnnotations = false;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserFormData = false;
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
// change or set the document encryption password
pdf.Password = "my-password";
pdf.SaveAs("secured.pdf");
using IronPdf;
using System;
// Open an Encrypted File, alternatively create a new PDF from Html
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
// Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = DateTime.Now;
// Edit file security settings
// The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption();
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
pdf.SecuritySettings.AllowUserAnnotations = false;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserFormData = false;
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
// change or set the document encryption password
pdf.Password = "my-password";
pdf.SaveAs("secured.pdf");
Imports IronPdf
Imports System
' Open an Encrypted File, alternatively create a new PDF from Html
Private pdf = PdfDocument.FromFile("encrypted.pdf", "password")
' Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto"
pdf.MetaData.Keywords = "SEO, Friendly"
pdf.MetaData.ModifiedDate = DateTime.Now
' Edit file security settings
' The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption()
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key")
pdf.SecuritySettings.AllowUserAnnotations = False
pdf.SecuritySettings.AllowUserCopyPasteContent = False
pdf.SecuritySettings.AllowUserFormData = False
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights
' change or set the document encryption password
pdf.Password = "my-password"
pdf.SaveAs("secured.pdf")
Aspose.PDF:
using Aspose.Pdf;
Document pdfDocument = new Document("document.pdf");
pdfDocument.Encrypt("password", null, Permissions.PrintDocument, CryptoAlgorithm.AESx128);
pdfDocument.Save("encrypted.pdf");
using Aspose.Pdf;
Document pdfDocument = new Document("document.pdf");
pdfDocument.Encrypt("password", null, Permissions.PrintDocument, CryptoAlgorithm.AESx128);
pdfDocument.Save("encrypted.pdf");
Imports Aspose.Pdf
Private pdfDocument As New Document("document.pdf")
pdfDocument.Encrypt("password", Nothing, Permissions.PrintDocument, CryptoAlgorithm.AESx128)
pdfDocument.Save("encrypted.pdf")
雖然這兩個庫都提供強大的加密工具,但IronPDF提供了一個簡單的加密過程,同時讓用戶對所加密的PDF文件的安全設置擁有更多的控制權。 Aspose.PDF 的加密過程同樣精簡而直接; 然而,它缺乏對各種設定的相同控制便利性。
有時,特別是在處理私密或敏感數據時,您可能需要編輯PDF文件的某些部分. 下面,我們將比較在 IronPDF 和 Aspose.PDF 中如何進行遮蔽。
IronPDF:
using IronPdf;
//Load the document you want to use
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact the 'are' phrase from all pages
pdf.RedactTextOnAllPages("are");
//Save the redacted version of the document
pdf.SaveAs("redacted.pdf");
using IronPdf;
//Load the document you want to use
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact the 'are' phrase from all pages
pdf.RedactTextOnAllPages("are");
//Save the redacted version of the document
pdf.SaveAs("redacted.pdf");
Imports IronPdf
'Load the document you want to use
Private pdf As PdfDocument = PdfDocument.FromFile("novel.pdf")
' Redact the 'are' phrase from all pages
pdf.RedactTextOnAllPages("are")
'Save the redacted version of the document
pdf.SaveAs("redacted.pdf")
Aspose.PDF:
using Aspose.Pdf;
using Aspose.Pdf.Redaction;
Document document = new Document("novel.pdf");
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("confidential");
document.Pages.Accept(textFragmentAbsorber);
foreach (TextFragment textFragment in textFragmentAbsorber.TextFragments)
{
textFragment.Text = "XXXXX";
}
document.Save("redacted.pdf");
using Aspose.Pdf;
using Aspose.Pdf.Redaction;
Document document = new Document("novel.pdf");
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("confidential");
document.Pages.Accept(textFragmentAbsorber);
foreach (TextFragment textFragment in textFragmentAbsorber.TextFragments)
{
textFragment.Text = "XXXXX";
}
document.Save("redacted.pdf");
Imports Aspose.Pdf
Imports Aspose.Pdf.Redaction
Private document As New Document("novel.pdf")
Private textFragmentAbsorber As New TextFragmentAbsorber("confidential")
document.Pages.Accept(textFragmentAbsorber)
For Each textFragment As TextFragment In textFragmentAbsorber.TextFragments
textFragment.Text = "XXXXX"
Next textFragment
document.Save("redacted.pdf")
在編輯 PDF 內容方面,IronPDF 提供了一種直接的方法。 其簡單直觀的API使用戶能夠以程式化的方式編輯內容,提高工作區的效率。 Aspose.PDF 可以達到類似的結果,但過程更加手動。 如果您想像 IronPDF 一樣在文字上繪製黑色框,過程會變得更加複雜。
當需要數位簽署 PDF 文件時,通過程式化方式可以節省大量時間。以下的程式碼範例比較了IronPDF 中的簽署過程和 Aspose.PDF。
IronPDF:
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
// Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
X509Certificate2 cert = new X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable);
// Create PdfSignature object
var sig = new PdfSignature(cert);
// Sign PDF document
PdfDocument pdf = PdfDocument.FromFile("document.pdf");
pdf.Sign(sig);
pdf.SaveAs("signed.pdf");
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
// Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
X509Certificate2 cert = new X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable);
// Create PdfSignature object
var sig = new PdfSignature(cert);
// Sign PDF document
PdfDocument pdf = PdfDocument.FromFile("document.pdf");
pdf.Sign(sig);
pdf.SaveAs("signed.pdf");
Imports IronPdf
Imports IronPdf.Signing
Imports System.Security.Cryptography.X509Certificates
' Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
Private cert As New X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable)
' Create PdfSignature object
Private sig = New PdfSignature(cert)
' Sign PDF document
Private pdf As PdfDocument = PdfDocument.FromFile("document.pdf")
pdf.Sign(sig)
pdf.SaveAs("signed.pdf")
Aspose.PDF:
using Aspose.Pdf;
using Aspose.Pdf.Forms;
using Aspose.Pdf.Facades;
Document document = new Document("input.pdf");
PKCS7 pkcs = new PKCS7("signature.pfx", "password");
Document.SignatureField signatureField = new SignatureField(document.Pages[1], new Rectangle(100, 100, 200, 200));
document.Form.Add(signatureField);
document.Save("signed.pdf");
using Aspose.Pdf;
using Aspose.Pdf.Forms;
using Aspose.Pdf.Facades;
Document document = new Document("input.pdf");
PKCS7 pkcs = new PKCS7("signature.pfx", "password");
Document.SignatureField signatureField = new SignatureField(document.Pages[1], new Rectangle(100, 100, 200, 200));
document.Form.Add(signatureField);
document.Save("signed.pdf");
Imports Aspose.Pdf
Imports Aspose.Pdf.Forms
Imports Aspose.Pdf.Facades
Private document As New Document("input.pdf")
Private pkcs As New PKCS7("signature.pfx", "password")
Private signatureField As Document.SignatureField = New SignatureField(document.Pages(1), New Rectangle(100, 100, 200, 200))
document.Form.Add(signatureField)
document.Save("signed.pdf")
IronPDF 提供了一個簡單且直接的流程來簽署 PDF 文件,所需的代碼行數較少,因此使得過程快速而簡便。 Aspose.PDF 在過程中採用了較長的方法,需使用更多行的代碼來達到相同的結果,但它確實允許用戶對過程進行更多控制。
添加和...的能力自訂 PDF 文件上的浮水印以程式化方式處理可以非常有用,特別是在處理機密文件、品牌、確保版權保護等方面。 現在,我們將比較 IronPDF 和 Aspose.PDF 如何處理向 PDF 文件添加浮水印。
IronPDF:
using IronPdf;
// Stamps a Watermark onto a new or existing PDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/");
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
pdf.SaveAs(@"C:\Path\To\Watermarked.pdf");
using IronPdf;
// Stamps a Watermark onto a new or existing PDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/");
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
pdf.SaveAs(@"C:\Path\To\Watermarked.pdf");
Imports IronPdf
' Stamps a Watermark onto a new or existing PDF
Private renderer = New ChromePdfRenderer()
Private pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/")
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center)
pdf.SaveAs("C:\Path\To\Watermarked.pdf")
Aspose.PDF:
using Aspose.Pdf;
using Aspose.Pdf.Text;
Document document = new Document("input.pdf");
TextStamp textStamp = new TextStamp("Confidential");
textStamp.Background = true;
textStamp.Opacity = 0.5;
document.Pages[1].AddStamp(textStamp);
document.Save("watermarked.pdf");
using Aspose.Pdf;
using Aspose.Pdf.Text;
Document document = new Document("input.pdf");
TextStamp textStamp = new TextStamp("Confidential");
textStamp.Background = true;
textStamp.Opacity = 0.5;
document.Pages[1].AddStamp(textStamp);
document.Save("watermarked.pdf");
Imports Aspose.Pdf
Imports Aspose.Pdf.Text
Private document As New Document("input.pdf")
Private textStamp As New TextStamp("Confidential")
textStamp.Background = True
textStamp.Opacity = 0.5
document.Pages(1).AddStamp(textStamp)
document.Save("watermarked.pdf")
IronPDF 的簡單且有效的 API 允許用戶快速將水印應用到他們的 PDF 文件,同時由於使用 HTML/CSS,還能讓用戶更全面地控制整個過程。 這使用戶能輕鬆地根據自身需求添加自定義浮水印。 Aspose.PDF 缺少原生的浮水印工具,因此使用 TextStamp 方法來替代。 雖然這能達到類似的效果,但對過程的控制力較低。
就像應用浮水印一樣,有時你可能需要處理需要蓋章的 PDF 頁面。 現在,我們將比較如何IronPDF和 Aspose.PDF 處理將印章內容加到 PDF 文件。
IronPDF:
using IronPdf;
using IronPdf.Editing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create text stamper
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top
};
// Stamp the text stamper
pdf.ApplyStamp(textStamper);
pdf.SaveAs("stampText.pdf");
using IronPdf;
using IronPdf.Editing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create text stamper
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top
};
// Stamp the text stamper
pdf.ApplyStamp(textStamper);
pdf.SaveAs("stampText.pdf");
Imports IronPdf
Imports IronPdf.Editing
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>")
' Create text stamper
Private textStamper As New TextStamper() With {
.Text = "Text Stamper!",
.FontFamily = "Bungee Spice",
.UseGoogleFont = True,
.FontSize = 30,
.IsBold = True,
.IsItalic = True,
.VerticalAlignment = VerticalAlignment.Top
}
' Stamp the text stamper
pdf.ApplyStamp(textStamper)
pdf.SaveAs("stampText.pdf")
using IronPdf;
using IronPdf.Editing;
using System;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create image stamper
ImageStamper imageStamper = new ImageStamper(new Uri("https://ironpdf.com/img/svgs/iron-pdf-logo.svg"))
{
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0);
pdf.SaveAs("stampImage.pdf");
using IronPdf;
using IronPdf.Editing;
using System;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create image stamper
ImageStamper imageStamper = new ImageStamper(new Uri("https://ironpdf.com/img/svgs/iron-pdf-logo.svg"))
{
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0);
pdf.SaveAs("stampImage.pdf");
Imports IronPdf
Imports IronPdf.Editing
Imports System
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>")
' Create image stamper
Private imageStamper As New ImageStamper(New Uri("https://ironpdf.com/img/svgs/iron-pdf-logo.svg")) With {.VerticalAlignment = VerticalAlignment.Top}
' Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0)
pdf.SaveAs("stampImage.pdf")
Aspose.PDF:
using Aspose.Pdf;
using Aspose.Pdf.Text;
Document document = new Document("input.pdf");
ImageStamp imageStamp = new ImageStamp("logo.png");
imageStamp.Background = true; // Enable background for the stamp
document.Pages[1].AddStamp(imageStamp);
document.Save("stamped.pdf");
using Aspose.Pdf;
using Aspose.Pdf.Text;
Document document = new Document("input.pdf");
ImageStamp imageStamp = new ImageStamp("logo.png");
imageStamp.Background = true; // Enable background for the stamp
document.Pages[1].AddStamp(imageStamp);
document.Save("stamped.pdf");
Imports Aspose.Pdf
Imports Aspose.Pdf.Text
Private document As New Document("input.pdf")
Private imageStamp As New ImageStamp("logo.png")
imageStamp.Background = True ' Enable background for the stamp
document.Pages(1).AddStamp(imageStamp)
document.Save("stamped.pdf")
在將文字和圖像加蓋到PDF文件上時,IronPDF 提供了極大的靈活性和可自訂性,使用戶可以完全控制這一過程。 其 API 簡單易用,特別適合對 HTML/CSS 熟悉的用戶。 Aspose.PDF 的自訂性和彈性較低,保持了一種簡單而專注的方式來處理加蓋,儘管因此而失去了 IronPDF 提供的相同控制和直觀感受。
在建立 PDF 檔案時,將各種文件類型轉換為 PDF可以是必不可少的。 在此範例中,我們將專注於將 DOCX 檔案類型轉換為 PDF。
IronPDF:
using IronPdf;
// Instantiate Renderer
DocxToPdfRenderer renderer = new DocxToPdfRenderer();
// Render from DOCX file
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
// Save the PDF
pdf.SaveAs("pdfFromDocx.pdf");
using IronPdf;
// Instantiate Renderer
DocxToPdfRenderer renderer = new DocxToPdfRenderer();
// Render from DOCX file
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
// Save the PDF
pdf.SaveAs("pdfFromDocx.pdf");
Imports IronPdf
' Instantiate Renderer
Private renderer As New DocxToPdfRenderer()
' Render from DOCX file
Private pdf As PdfDocument = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx")
' Save the PDF
pdf.SaveAs("pdfFromDocx.pdf")
Aspose.PDF:
using Aspose.Words;
using Aspose.Words.Saving;
Document doc = new Document("input.docx");
doc.Save("output.pdf", SaveFormat.Pdf);
using Aspose.Words;
using Aspose.Words.Saving;
Document doc = new Document("input.docx");
doc.Save("output.pdf", SaveFormat.Pdf);
Imports Aspose.Words
Imports Aspose.Words.Saving
Private doc As New Document("input.docx")
doc.Save("output.pdf", SaveFormat.Pdf)
IronPDF 提供了一種簡單直接的方法來進行 DOCX 到 PDF 的轉換,利用 ChromePdfRenderer 從 DOCX 文件生成高保真 PDF。 這些功能全部內建於IronPDF庫中,不需要額外的套件即可將各種文件類型轉換為PDF文件,然後在過程結束時將其保存。
Aspose.PDF 本身無法將 DOCX 文件轉換為 PDF 格式,而是需要 Aspose.Words 套件來進行轉換,然後用戶可以實施 Aspose.PDF 以進一步操作 PDF 文件。
當涉及到定價和授權時,IronPDF 授權選項提供一種簡單且具成本效益的方法:
IronPDF 授權擁有不同的等級和額外功能可供購買許可證。 開發人員還可以購買Iron Suite這使您能以兩個產品的價格訪問所有 Iron Software 的產品。 如果您還沒有準備好購買許可證,IronPDF 提供一個免費試用持續30天。
Iron Suite:只需 $1,498,您即可使用所有 Iron Software 產品,包括 IronPDF、IronOCR、IronWord、IronXL、IronBarcode、IronQR、IronZIP、IronPrint 和 IronWebScraper。
Aspose.PDF 提供多個等級的授權成本方案,每個方案都有其特定功能,而且全部提供免費支援。 開發人員希望使用Aspose.PDF時,可能需要額外購買以完成某些操作,就像我們在將DOCX轉換為PDF格式時所見。
附加功能:每個級別提供兩項您可以與許可證一起購買的額外服務,這些服務是付費支援和付費諮詢。 這些額外服務的費用隨著每個許可證的增加而逐漸上升,最便宜的是開發者小型企業計劃,提供付費支持的價格為每年399美元,諮詢費用為每位開發者每月增加5,999美元。
IronPDF 提供了更具成本效益的解決方案,特別是在考慮到 Iron Suite 套件時,該套件以兩個的價格包含多個強大的庫。 如需詳細的定價信息,請訪問IronPDF 授權頁面.
培訓:提供在線培訓資料。
如需有關 IronPDF 文檔和支持的更多詳細信息,請訪問IronPDF 文件檔案和該Iron Software YouTube 頻道.
IronPDF 和 Aspose.PDF .NET 在 .NET 環境中處理 PDF 文件時都提供了一套豐富的功能。 每個產品都有其獨特的優勢和功能。
IronPDF 以其跨平台相容性、對 CSS3、HTML5 和 JavaScript 等現代網路標準的廣泛支援、易於使用、具成本效益以及能夠在無需額外套件的情況下完成各種 PDF 操作任務而自豪。 IronPDF 是一個強大的工具,適合在您需要簡化 PDF 生成和操作任務時,添加到開發者的工具箱中。
Iron Suite 使用者可以利用 IronPDF 與其他 Iron Software 產品的順暢整合來實現更高級的操作。 例如,使用者可以使用IronQR將QR碼添加到他們的PDF中IronQR,壓縮他們的PDF文件使用IronZIP,使用IronPrint列印 PDF 文件,以及執行其他任何數量的潛在操作。
另一方面,儘管Aspose.PDF是一個強大的工具,提供了豐富的功能以處理複雜的PDF操作、詳細配置,以及在.NET環境中無縫運行的能力,但它通常需要外部套件來完成任務。 儘管它有一個活躍的支援論壇,且能輕鬆執行各種與 PDF 相關的任務。
最終選擇 IronPDF 和 Aspose.PDF 取決於具體的專案需求。 IronPDF 提供具競爭力的價格、詳細的文件說明、快速的支援服務,以及強大的 PDF 操作工具,全部整合在一個套件中。
您可以嘗試使用30 天免費試用查看他們的可用功能。