在生产环境中测试,无水印。
随时随地满足您的需求。
获得30天的全功能产品。
几分钟内就能启动并运行。
在您的产品试用期间,全面访问我们的支持工程团队。
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框架、.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加密。
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 Licensing 具有不同的级别和附加功能,用于购买许可证。 开发人员还可以购买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 美元,咨询费用为每位开发者每月 5999 美元。
IronPDF提供了一种更具成本效益的解决方案,特别是在考虑到Iron Suite套件时,该套件以两个库的价格包含多个强大的库。 有关详细的定价信息,请访问IronPDF 授权页面。
培训:在线培训材料可用。
有关IronPDF文档和支持的更多详细信息,请访问IronPDF文档和Iron Software YouTube频道。
IronPDF for .NET 和 Aspose.PDF .NET 在.NET 环境中处理 PDF 文档时都提供了大量功能。 每个产品都有其独特的优势和功能。
IronPDF以其跨平台兼容性、对现代网络标准如CSS3、HTML5和JavaScript的广泛支持、使用简便性、成本效益以及在无需额外软件包的情况下完成各种PDF操作任务的能力而自豪。 IronPDF是一个强大的工具,当您想要简化PDF生成和操作任务时,可以添加到您的开发者工具包中。
Iron Suite 用户可以利用 IronPDF 与其他 Iron Software 产品的顺畅集成,实现更高级的操作。 例如,用户可以使用 IronQR 将二维码添加到他们的PDF中,使用 IronZip 压缩他们的PDF文件,使用 IronPrint 打印PDF文档,并执行任何其他潜在的操作。
另一方面,虽然 Aspose.PDF 是一个强大的工具,提供了丰富的功能,用于复杂的 PDF 操作、详细的配置,并且能够在 .NET 环境中无缝操作,但它通常需要外部包来完成任务。 虽然它拥有一个活跃的支持论坛,并能轻松执行各种与 PDF 相关的任务。
最终选择IronPDF还是Aspose.PDF取决于具体项目需求。 IronPDF提供具有竞争力的定价、详尽的文档、响应迅速的支持以及强大的PDF操作工具,所有这些都在一个套餐中。
您可以尝试30天免费试用以查看他们提供的功能。