在生產環境中測試,無水印。
在任何需要的地方都能運行。
獲得 30 天的全功能產品。
在幾分鐘內上手運行。
試用產品期間完全訪問我們的支援工程團隊
對於使用 .NET 的開發人員來說,找到合適的 PDF 解決方案對於構建功能豐富的應用程式至關重要。 在當今的現代時代,隨著提供 PDF 轉換技術的產品數量不斷增加,找到合適的工具來滿足您的需求可能會很困難。 在此比較中,我們將評估IronPDF和HiQPdf,這是兩個在.NET專案中使用的流行HTML轉PDF庫。 雖然這兩個程式庫都提供強大的 PDF 生成功能,但IronPDF因其更全面的功能、跨平台相容性和直觀的 API 而脫穎而出。
無論您在尋找進階編輯選項、跨平台支援,或是使用方便性,此 IronPDF 與 HiQPdf 的並排比較將幫助您做出明智的選擇。
IronPDF 是一個多功能的 PDF 函式庫,適用於 C# 和 .NET,能夠實現無縫的 PDF 生成功能、編輯和操作。 支持 .NET 8、7、6 和 Core,具備豐富的工具集,讓開發人員能處理從 HTML 到 PDF 轉換到加密和數位簽章等高級安全選項的所有內容。 使用 IronPDF,您可以在每個 PDF 頁面添加文字或 HTML 標題、使用網頁字體進行更好的文字自訂、提取文字、創建時尚的 PDF 文件等等!
HiQPdf,另一方面,主要專注於將 HTML 轉換為 PDF,提供對 CSS3、JavaScript、SVG 和 Canvas 元素的良好支援。 雖然 HiQPdf 提供可靠的 PDF 生成功能,但它缺乏 IronPDF 的某些高級功能和靈活性,尤其是在跨平台兼容性和詳細文件編輯方面。
PDF 版本支持:可以支持 PDF 版本 1.2-1.7
要查看 IronPDF 功能的完整列表,請訪問 IronPDF 功能。
合併與拆分 PDF:將多個 PDF 合併成單一文件,或將大型 PDF 拆分為較小的文件以便於管理。
IronPDF 擁有更廣泛的功能集,提供更先進的 PDF 編輯、安全性和跨平台兼容性,使其在與 HiQPdf 的比較中佔據優勢。
IronPDF 與 HiQPdf 之間的主要區別之一是跨平台兼容性。 IronPDF 提供對 Windows、Linux 和 macOS 的完美支援,使其成為在多樣化環境中工作的開發人員的理想選擇。 它也兼容於 Docker、Azure、AWS 和主要的 .NET 版本,包括 .NET 8、7、6 和 .NET Core。
HiQPdf 雖然功能正常,但在平台支持方面較為有限,主要集中在 Windows 環境上。
IronPDF:
using IronPdf;
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
pdf.SaveAs("output.pdf");
var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
using IronPdf;
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
pdf.SaveAs("output.pdf");
var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
Imports IronPdf
Private renderer = New ChromePdfRenderer()
Private pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")
pdf.SaveAs("output.pdf")
Dim myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
myAdvancedPdf.SaveAs("html-with-assets.pdf")
HiQPdf:
// create the HTML to PDF converter
HtmlToPdf htmlToPdfConverter = new HtmlToPdf();
// convert HTML Code to a PDF file
htmlToPdfConverter.ConvertHtmlToFile("<b>Hello World</b>", null, "result.pdf");
// create the HTML to PDF converter
HtmlToPdf htmlToPdfConverter = new HtmlToPdf();
// convert HTML Code to a PDF file
htmlToPdfConverter.ConvertHtmlToFile("<b>Hello World</b>", null, "result.pdf");
' create the HTML to PDF converter
Dim htmlToPdfConverter As New HtmlToPdf()
' convert HTML Code to a PDF file
htmlToPdfConverter.ConvertHtmlToFile("<b>Hello World</b>", Nothing, "result.pdf")
對於HTML 轉換為 PDF,IronPDF 提供了一種簡單的方法,通過使用 ChromePdfRenderer 將 HTML 內容渲染為 PDF,不論您是使用 HTML 文檔、字符串還是 URL。 IronPDF 也支持進階情境,例如透過指定資產的檔案路徑並儲存結果來渲染包含本地資產(如圖片)的 HTML。 另一方面,HiQPdf 使用 HtmlToPdf 類,其中 HTML 內容通過更簡易的設置直接轉換為 PDF 檔案。這兩個庫都能有效地處理 HTML 到 PDF 的轉換,但 IronPDF 在資產處理方面提供了更多的靈活性。
IronPDF 範例:
using IronPdf;
using System;
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = DateTime.Now;
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;
pdf.Password = "my-password";
pdf.SaveAs("secured.pdf");
using IronPdf;
using System;
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = DateTime.Now;
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;
pdf.Password = "my-password";
pdf.SaveAs("secured.pdf");
Imports IronPdf
Imports System
Private pdf = PdfDocument.FromFile("encrypted.pdf", "password")
pdf.MetaData.Author = "Satoshi Nakamoto"
pdf.MetaData.Keywords = "SEO, Friendly"
pdf.MetaData.ModifiedDate = DateTime.Now
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
pdf.Password = "my-password"
pdf.SaveAs("secured.pdf")
HiQPdf:
// create the HTML to PDF converter
HtmlToPdf htmlToPdfConverter = new HtmlToPdf();
// set encryption mode
htmlToPdfConverter.Document.Security.EncryptionMode = GetSelectedEncryptionMode();
// set encryption level
htmlToPdfConverter.Document.Security.EncryptionLevel = GetSelectedEncryptionLevel();
// set open password
htmlToPdfConverter.Document.Security.OpenPassword = textBoxOpenPassword.Text;
// set permissions password
htmlToPdfConverter.Document.Security.PermissionsPassword = textBoxPermissionsPassword.Text;
// set PDF document permissions
htmlToPdfConverter.Document.Security.AllowPrinting = checkBoxAllowPrint.Checked;
htmlToPdfConverter.Document.Security.AllowCopyContent = checkBoxAllowCopy.Checked;
htmlToPdfConverter.Document.Security.AllowEditContent = checkBoxAllowEdit.Checked;
htmlToPdfConverter.Document.Security.AllowEditAnnotations = checkBoxAllowEditAnnotations.Checked;
htmlToPdfConverter.Document.Security.AllowFormFilling = checkBoxAllowFillForms.Checked;
// set a default permissions password if an open password was set without settings a permissions password
// or if any of the permissions does not have the default value
if (htmlToPdfConverter.Document.Security.PermissionsPassword == String.Empty &&
(htmlToPdfConverter.Document.Security.OpenPassword != String.Empty
!IsDefaultPermission(htmlToPdfConverter.Document.Security)))
{
htmlToPdfConverter.Document.Security.PermissionsPassword = "admin";
}
// create the HTML to PDF converter
HtmlToPdf htmlToPdfConverter = new HtmlToPdf();
// set encryption mode
htmlToPdfConverter.Document.Security.EncryptionMode = GetSelectedEncryptionMode();
// set encryption level
htmlToPdfConverter.Document.Security.EncryptionLevel = GetSelectedEncryptionLevel();
// set open password
htmlToPdfConverter.Document.Security.OpenPassword = textBoxOpenPassword.Text;
// set permissions password
htmlToPdfConverter.Document.Security.PermissionsPassword = textBoxPermissionsPassword.Text;
// set PDF document permissions
htmlToPdfConverter.Document.Security.AllowPrinting = checkBoxAllowPrint.Checked;
htmlToPdfConverter.Document.Security.AllowCopyContent = checkBoxAllowCopy.Checked;
htmlToPdfConverter.Document.Security.AllowEditContent = checkBoxAllowEdit.Checked;
htmlToPdfConverter.Document.Security.AllowEditAnnotations = checkBoxAllowEditAnnotations.Checked;
htmlToPdfConverter.Document.Security.AllowFormFilling = checkBoxAllowFillForms.Checked;
// set a default permissions password if an open password was set without settings a permissions password
// or if any of the permissions does not have the default value
if (htmlToPdfConverter.Document.Security.PermissionsPassword == String.Empty &&
(htmlToPdfConverter.Document.Security.OpenPassword != String.Empty
!IsDefaultPermission(htmlToPdfConverter.Document.Security)))
{
htmlToPdfConverter.Document.Security.PermissionsPassword = "admin";
}
' create the HTML to PDF converter
Dim htmlToPdfConverter As New HtmlToPdf()
' set encryption mode
htmlToPdfConverter.Document.Security.EncryptionMode = GetSelectedEncryptionMode()
' set encryption level
htmlToPdfConverter.Document.Security.EncryptionLevel = GetSelectedEncryptionLevel()
' set open password
htmlToPdfConverter.Document.Security.OpenPassword = textBoxOpenPassword.Text
' set permissions password
htmlToPdfConverter.Document.Security.PermissionsPassword = textBoxPermissionsPassword.Text
' set PDF document permissions
htmlToPdfConverter.Document.Security.AllowPrinting = checkBoxAllowPrint.Checked
htmlToPdfConverter.Document.Security.AllowCopyContent = checkBoxAllowCopy.Checked
htmlToPdfConverter.Document.Security.AllowEditContent = checkBoxAllowEdit.Checked
htmlToPdfConverter.Document.Security.AllowEditAnnotations = checkBoxAllowEditAnnotations.Checked
htmlToPdfConverter.Document.Security.AllowFormFilling = checkBoxAllowFillForms.Checked
' set a default permissions password if an open password was set without settings a permissions password
' or if any of the permissions does not have the default value
If htmlToPdfConverter.Document.Security.PermissionsPassword = String.Empty AndAlso (htmlToPdfConverter.Document.Security.OpenPassword <> String.Empty (Not IsDefaultPermission(htmlToPdfConverter.Document.Security))) Then
htmlToPdfConverter.Document.Security.PermissionsPassword = "admin"
End If
當涉及加密 PDF 文件時,IronPDF 提供一個使用其 API 的簡單方法。 開發人員可以移除現有密碼、設置新的安全設定、限制用戶操作如註釋、複製粘貼和表單數據輸入,並將文檔設為唯讀。 IronPDF 允許修改元數據、設置密碼保護,以及對列印許可權進行精細控制。
HiQPdf 也提供 PDF 加密,但使用略有不同的過程,專注於設置加密模式、級別、開放密碼和權限密碼。 它允許精細控制文件權限,如列印、內容複製和編輯,當未明確設置時,有預設權限可用。 兩個程式庫都提供全面的安全設置,但IronPDF提供了額外的功能,如元數據自定義和更容易處理文檔唯讀模式。
IronPDF 範例:
using IronPdf;
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
pdf.RedactTextOnAllPages("are");
pdf.SaveAs("redacted.pdf");
using IronPdf;
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
pdf.RedactTextOnAllPages("are");
pdf.SaveAs("redacted.pdf");
Imports IronPdf
Private pdf As PdfDocument = PdfDocument.FromFile("novel.pdf")
pdf.RedactTextOnAllPages("are")
pdf.SaveAs("redacted.pdf")
HiQPdf 在其列出的功能中沒有提供明確的編輯功能。 主要專注於 PDF 的生成、轉換和操作,例如從 HTML 創建 PDF。
IronPDF 提供了從您的 PDF 文件頁面編輯內容的一種簡單方法。 例如,開發人員可以使用幾行代碼輕鬆地在整個文檔中修訂特定文本,如上面的代碼片段所示。 相比之下,HiQPdf 在其功能集中缺乏明確的遮罩功能,主要專注於 PDF 的生成、轉換和操作,比如從 HTML 創建 PDF。
IronPDF 範例:
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>foo</h1>");
X509Certificate2 cert = new X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable);
var sig = new PdfSignature(cert);
pdf.Sign(sig);
pdf.SaveAs("signed.pdf");
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>foo</h1>");
X509Certificate2 cert = new X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable);
var sig = new PdfSignature(cert);
pdf.Sign(sig);
pdf.SaveAs("signed.pdf");
Imports IronPdf
Imports IronPdf.Signing
Imports System.Security.Cryptography.X509Certificates
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>foo</h1>")
Private cert As New X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable)
Private sig = New PdfSignature(cert)
pdf.Sign(sig)
pdf.SaveAs("signed.pdf")
HiQPdf:
// create a PDF document
PdfDocument document = new PdfDocument();
// create a page in document
PdfPage page1 = document.AddPage();
// create the true type fonts that can be used in document text
Font sysFont = new Font("Times New Roman", 10, System.Drawing.GraphicsUnit.Point);
PdfFont pdfFont = document.CreateFont(sysFont);
PdfFont pdfFontEmbed = document.CreateFont(sysFont, true);
float crtYPos = 20;
float crtXPos = 5;
// add a title to PDF document
PdfText titleTextTransImage = new PdfText(crtXPos, crtYPos,
"Click the image below to open the digital signature", pdfFontEmbed);
titleTextTransImage.ForeColor = Color.Navy;
PdfLayoutInfo textLayoutInfo = page1.Layout(titleTextTransImage);
crtYPos += textLayoutInfo.LastPageRectangle.Height + 10;
// layout a PNG image with alpha transparency
PdfImage transparentPdfImage = new PdfImage(crtXPos, crtYPos, Server.MapPath("~") + @"\DemoFiles\Images\HiQPdfLogo_small.png");
PdfLayoutInfo imageLayoutInfo = page1.Layout(transparentPdfImage);
// apply a digital sgnature over the image
PdfCertificatesCollection pdfCertificates = PdfCertificatesCollection.FromFile(Server.MapPath("~") + @"\DemoFiles\Pfx\hiqpdf.pfx", "hiqpdf");
PdfDigitalSignature digitalSignature = new PdfDigitalSignature(pdfCertificates[0]);
digitalSignature.SigningReason = "My signing reason";
digitalSignature.SigningLocation = "My signing location";
digitalSignature.SignerContactInfo = "My contact info";
document.AddDigitalSignature(digitalSignature, imageLayoutInfo.LastPdfPage, imageLayoutInfo.LastPageRectangle);
try
{
// write the PDF document to a memory buffer
byte[] pdfBuffer = document.WriteToMemory();
// inform the browser about the binary data format
HttpContext.Current.Response.AddHeader("Content-Type", "application/pdf");
// let the browser know how to open the PDF document and the file name
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment; filename=DigitalSignatures.pdf; size={0}",
pdfBuffer.Length.ToString()));
// write the PDF buffer to HTTP response
HttpContext.Current.Response.BinaryWrite(pdfBuffer);
// call End() method of HTTP response to stop ASP.NET page processing
HttpContext.Current.Response.End();
}
finally
{
document.Close();
}
// create a PDF document
PdfDocument document = new PdfDocument();
// create a page in document
PdfPage page1 = document.AddPage();
// create the true type fonts that can be used in document text
Font sysFont = new Font("Times New Roman", 10, System.Drawing.GraphicsUnit.Point);
PdfFont pdfFont = document.CreateFont(sysFont);
PdfFont pdfFontEmbed = document.CreateFont(sysFont, true);
float crtYPos = 20;
float crtXPos = 5;
// add a title to PDF document
PdfText titleTextTransImage = new PdfText(crtXPos, crtYPos,
"Click the image below to open the digital signature", pdfFontEmbed);
titleTextTransImage.ForeColor = Color.Navy;
PdfLayoutInfo textLayoutInfo = page1.Layout(titleTextTransImage);
crtYPos += textLayoutInfo.LastPageRectangle.Height + 10;
// layout a PNG image with alpha transparency
PdfImage transparentPdfImage = new PdfImage(crtXPos, crtYPos, Server.MapPath("~") + @"\DemoFiles\Images\HiQPdfLogo_small.png");
PdfLayoutInfo imageLayoutInfo = page1.Layout(transparentPdfImage);
// apply a digital sgnature over the image
PdfCertificatesCollection pdfCertificates = PdfCertificatesCollection.FromFile(Server.MapPath("~") + @"\DemoFiles\Pfx\hiqpdf.pfx", "hiqpdf");
PdfDigitalSignature digitalSignature = new PdfDigitalSignature(pdfCertificates[0]);
digitalSignature.SigningReason = "My signing reason";
digitalSignature.SigningLocation = "My signing location";
digitalSignature.SignerContactInfo = "My contact info";
document.AddDigitalSignature(digitalSignature, imageLayoutInfo.LastPdfPage, imageLayoutInfo.LastPageRectangle);
try
{
// write the PDF document to a memory buffer
byte[] pdfBuffer = document.WriteToMemory();
// inform the browser about the binary data format
HttpContext.Current.Response.AddHeader("Content-Type", "application/pdf");
// let the browser know how to open the PDF document and the file name
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment; filename=DigitalSignatures.pdf; size={0}",
pdfBuffer.Length.ToString()));
// write the PDF buffer to HTTP response
HttpContext.Current.Response.BinaryWrite(pdfBuffer);
// call End() method of HTTP response to stop ASP.NET page processing
HttpContext.Current.Response.End();
}
finally
{
document.Close();
}
' create a PDF document
Dim document As New PdfDocument()
' create a page in document
Dim page1 As PdfPage = document.AddPage()
' create the true type fonts that can be used in document text
Dim sysFont As New Font("Times New Roman", 10, System.Drawing.GraphicsUnit.Point)
Dim pdfFont As PdfFont = document.CreateFont(sysFont)
Dim pdfFontEmbed As PdfFont = document.CreateFont(sysFont, True)
Dim crtYPos As Single = 20
Dim crtXPos As Single = 5
' add a title to PDF document
Dim titleTextTransImage As New PdfText(crtXPos, crtYPos, "Click the image below to open the digital signature", pdfFontEmbed)
titleTextTransImage.ForeColor = Color.Navy
Dim textLayoutInfo As PdfLayoutInfo = page1.Layout(titleTextTransImage)
crtYPos += textLayoutInfo.LastPageRectangle.Height + 10
' layout a PNG image with alpha transparency
Dim transparentPdfImage As New PdfImage(crtXPos, crtYPos, Server.MapPath("~") & "\DemoFiles\Images\HiQPdfLogo_small.png")
Dim imageLayoutInfo As PdfLayoutInfo = page1.Layout(transparentPdfImage)
' apply a digital sgnature over the image
Dim pdfCertificates As PdfCertificatesCollection = PdfCertificatesCollection.FromFile(Server.MapPath("~") & "\DemoFiles\Pfx\hiqpdf.pfx", "hiqpdf")
Dim digitalSignature As New PdfDigitalSignature(pdfCertificates(0))
digitalSignature.SigningReason = "My signing reason"
digitalSignature.SigningLocation = "My signing location"
digitalSignature.SignerContactInfo = "My contact info"
document.AddDigitalSignature(digitalSignature, imageLayoutInfo.LastPdfPage, imageLayoutInfo.LastPageRectangle)
Try
' write the PDF document to a memory buffer
Dim pdfBuffer() As Byte = document.WriteToMemory()
' inform the browser about the binary data format
HttpContext.Current.Response.AddHeader("Content-Type", "application/pdf")
' let the browser know how to open the PDF document and the file name
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment; filename=DigitalSignatures.pdf; size={0}", pdfBuffer.Length.ToString()))
' write the PDF buffer to HTTP response
HttpContext.Current.Response.BinaryWrite(pdfBuffer)
' call End() method of HTTP response to stop ASP.NET page processing
HttpContext.Current.Response.End()
Finally
document.Close()
End Try
在數位簽署PDF 檔案中,IronPDF 透過提供一個簡單的方法,允許開發者從 HTML 內容創建 PDF 文件,並使用數位憑證簽名,然後以最少的代碼保存。 另一方面,HiQPdf 需要更複雜的設置,程式化地建立 PDF 文件,通過添加頁面和嵌入字體來完成。 包含標題和圖片,然後使用指定的證書應用數位簽章,以及詳細的中繼資料,例如簽署原因和地點。
IronPDF 範例:
using IronPdf;
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;
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
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")
HiQPdf:
沒有內建的專用浮水印工具。
當應用自定水印時,IronPDF 提供一個簡單明瞭的解決方案,內建支援向 PDF 添加水印。 在範例中,將 URL 渲染為 PDF,並在頁面中央應用具有 HTML 樣式的可自訂浮水印。 這允許輕鬆修改浮水印的內容、樣式和位置。 相比之下,HiQPdf 缺乏內建的專用浮水印工具,對於需要在庫中直接使用此功能的開發人員來說,使用起來較不方便。
IronPDF 範例(文字印章):
using IronPdf;
using IronPdf.Editing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top
};
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>");
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top
};
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>")
Private textStamper As New TextStamper() With {
.Text = "Text Stamper!",
.FontFamily = "Bungee Spice",
.UseGoogleFont = True,
.FontSize = 30,
.IsBold = True,
.IsItalic = True,
.VerticalAlignment = VerticalAlignment.Top
}
pdf.ApplyStamp(textStamper)
pdf.SaveAs("stampText.pdf")
IronPDF 範例(圖片印章):
using IronPdf;
using IronPdf.Editing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
ImageStamper imageStamper = new ImageStamper(new Uri("/img/svgs/iron-pdf-logo.svg"))
{
VerticalAlignment = VerticalAlignment.Top
};
pdf.ApplyStamp(imageStamper, 0);
pdf.SaveAs("stampImage.pdf");
using IronPdf;
using IronPdf.Editing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
ImageStamper imageStamper = new ImageStamper(new Uri("/img/svgs/iron-pdf-logo.svg"))
{
VerticalAlignment = VerticalAlignment.Top
};
pdf.ApplyStamp(imageStamper, 0);
pdf.SaveAs("stampImage.pdf");
Imports IronPdf
Imports IronPdf.Editing
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>")
Private imageStamper As New ImageStamper(New Uri("/img/svgs/iron-pdf-logo.svg")) With {.VerticalAlignment = VerticalAlignment.Top}
pdf.ApplyStamp(imageStamper, 0)
pdf.SaveAs("stampImage.pdf")
HiQPdf:
HiQPdf 沒有專用的蓋章工具,無法直接將文字或圖像作為印章添加到 PDF 文件中。 然而,它允許您將文字、圖像和圖形物件添加到 PDF 中,這些可以達到類似的目的。 這可以透過使用庫中提供的功能,在 PDF 中創建文字對象和圖像對象來實現。
IronPDF 提供專門的類別,可以將文字和圖片蓋章直接放到任何現有的 PDF 文件或新創建的文件上,使開發人員的操作流程變得簡單。 相比之下,HiQPdf 缺少專用的蓋章工具; 相反,它允許用戶在 PDF 中新增文字和圖像物件,需要採取更手動的方法來實現類似的結果。
IronPDF 範例:
using IronPdf;
DocxToPdfRenderer renderer = new DocxToPdfRenderer();
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
pdf.SaveAs("pdfFromDocx.pdf");
using IronPdf;
DocxToPdfRenderer renderer = new DocxToPdfRenderer();
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
pdf.SaveAs("pdfFromDocx.pdf");
Imports IronPdf
Private renderer As New DocxToPdfRenderer()
Private pdf As PdfDocument = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx")
pdf.SaveAs("pdfFromDocx.pdf")
HiQPdf:
由於HiQPdf主要是一個將HTML轉換為PDF的庫,它並不提供任何內建的DOCX到PDF的工具。
IronPDF 透過其 DocxToPdfRenderer 類別提供對 DOCX 到 PDF 轉換 的直接支援,然而 HiQPdf 缺乏將 DOCX 檔案轉換為 PDF 的內建工具,而是專注於 HTML 到 PDF 的轉換。
要了解 IronPDF 提供的豐富功能,並親眼見證其運作,請查看 IronPDF 使用指南,該指南深入探討每個功能,探索其如何運作,並賦予您成為 PDF 專家的技能。
IronPDF 提供開發者友好的文檔體驗。 其強大的文件資料確保開發人員無論是初學者還是高級用戶,都能將 IronPDF 有效地整合到他們的項目中。 IronPDF 文件的一些關鍵方面包括:
定期更新:文檔經常更新,以反映庫的變更和新功能。
欲了解更多資訊,請查閱IronPDF的詳細文件,並造訪Iron Software的YouTube頻道。
HiQPdf 提供基本的文件,支援大多數的核心功能。 儘管它提供了HTML轉PDF轉換和基本PDF操作的功能,但其文檔缺乏IronPDF所提供的深度和全面性。 HiQPdf 文件的主要方面包括:
有限的在線支援:即時援助的選擇較少。
如需有關 HiQPdf 的更多技術細節,用戶需搜尋其他資源或外部論壇。
IronPDF 有不同級別和額外功能可供購買許可證。 開發人員也可以購買 Iron Suite,以兩個產品的價格獲得 Iron Software 所有產品的使用權。 如果您還沒有準備好購買授權,IronPDF 提供免費試用,以便您在決定購買授權之前探索其提供的所有功能。
Iron Suite:僅需 $1,498,您即可獲得所有 Iron Software 產品的使用權,包括 IronPDF、 IronOCR、 IronWord、 IronXL、 IronBarcode、 IronQR、 IronZIP、 IronPrint和 IronWebScraper。
HiQPdf 也提供各種授權選項,但其定價往往略顯僵硬:
企業授權:$1,095,無限制的開發人員數量可搭配任意數量的應用程式。
雖然 HiQPdf 的價格具有競爭性,但其所提供的價值不如 IronPDF 通過 Iron Suite 提供的套裝產品,也沒有同等價格下所包含的廣泛高級功能。
IronPDF 和 HiQPdf 都是 .NET 開發者在其應用程式中整合 PDF 功能的可靠選擇。 然而,IronPDF 以其豐富的功能集、易用性和強大的文檔支持而脫穎而出。 IronPDF具有跨平台相容性、豐富的程式碼範例和優秀的支援,是需要在不同環境中使用全面 PDF 功能的開發人員的絕佳解決方案。
如果您正在尋找一個提供卓越性能、靈活性和支援的完整解決方案,IronPDF 是一個強烈推薦的選擇。此外,IronPDF 能夠輕鬆處理加密、修訂和數位簽名等高級功能,這使得它與 HiQPdf 不同。