产品比较 IronPDF与GrapeCity PDF Viewer之间的比较 Curtis Chau 已更新:八月 20, 2025 Download IronPDF NuGet 下载 DLL 下载 Windows 安装程序 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article PDF 代表可携带文档格式。 它是一种文件类型,允许在许多不同设备上常规查看任何文档。 PDF 通常用于与潜在雇主分享重要文档,如简历,或与客户分享发票。 尽管它被广泛使用,但使用 PDF 作为存储和共享数据的方式也有一些缺点。 例如,PDF 无法通过电子邮件共享,因为它们需要首先在 PDF 阅读器中打开。即使它们可以共享,当在手机上打开时,PDF 看起来也不如 Word 文档清晰。 此外,除非您在计算机上安装了能够识别文件数据并将其转换回可编辑格式的编辑软件,否则 PDF 不能像 Word 文档那样被编辑或更新。 这意味着无论您使用什么设备——无论是 PC 还是 Mac——打开 PDF 文件时它们看起来都一样。 由于它们实施的标准在 JPEG 或 GIF 等其他文档格式中找不到,因此 PDF 文件在所有设备上都可靠。 在本文中,我们将回顾两个 .NET PDF 库: IronPDF GrapeCity PDF IronPDF。 IronPDF 是一个 .NET 库,提供创建、读取和操作 PDF 文档的基础功能,只需几行代码。 接下来的文章将向您展示如何使用 IronPDF 创建 PDF 文件。 内容基于您已了解 Visual Studio 或 C# 的基础知识,并且具备 HTML 的工作知识。 我们需要 Visual Studio 来编写、编译和运行我们的应用程序,使用 C# 编写逻辑和代码,并使用 HTML 格式化 PDF 文件,包括添加标题、图片、段落等。IronPDF 库完全支持 .NET Core、.NET 5、Framework 和 Standard。 我们可以用 C# 只需几行代码创建一个 PDF 文件。 只要具备 C# 和 HTML 的基本知识,这就是一项简单的任务。 通过访问 IronPDF 的 官方功能网站,了解更多关于 IronPDF 的信息。 安装 IronPDF 开发解决方案需要安装 IronPDF 的 NuGet 包。 从菜单栏直接点击“项目”。 将出现一个下拉列表。 从下拉菜单中选择并选择“管理 NuGet 包”。 一个窗口将显示如下: class="content-img-align-center"> class="content__image-caption"> 选择“浏览”选项卡,随后的窗口将显示如下: class="content-img-align-center"> class="content__image-caption"> 在搜索框中输入 'IronPdf' 并按 'Enter'。结果窗口应显示如下: class="content-img-align-center"> class="content__image-caption"> 选择 IronPDF: class="content-img-align-center"> class="content__image-caption">如何通过 Ironpdfile 创建 PDF 文件 选择“安装”按钮。 成功安装后,将出现结果窗口: class="content-img-align-center"> class="content__image-caption"> 一旦按下 'OK' 按钮,您就可以开始了。 创建 PDF 在文件顶部添加 IronPdf 命名空间。 using IronPdf; using IronPdf; Imports IronPdf $vbLabelText $csharpLabel 实际工作从此开始。 我们需要一个文件路径来存储构建的 PDF 文档。 为此,我们使用 SaveFileDialog,提示用户选择文件名和文件路径。 private void Save_Click(object sender, EventArgs e) { // Code to Select the folder and save the file. SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.InitialDirectory = @"D:\"; saveFileDialog1.Title = "Save Pdf File"; saveFileDialog1.DefaultExt = "pdf"; saveFileDialog1.Filter = "Pdf files (*.pdf)|*.pdf|All files (*.*)|*.*"; saveFileDialog1.FilterIndex = 2; saveFileDialog1.RestoreDirectory = true; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { string filename = saveFileDialog1.FileName; // actual code that will create Pdf files var HtmlLine = new HtmlToPdf(); HtmlLine.RenderHtmlAsPdf(PdfText.Text).SaveAs(filename); // MessageBox to display that file save MessageBox.Show("File Saved Successfully!"); } } private void Save_Click(object sender, EventArgs e) { // Code to Select the folder and save the file. SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.InitialDirectory = @"D:\"; saveFileDialog1.Title = "Save Pdf File"; saveFileDialog1.DefaultExt = "pdf"; saveFileDialog1.Filter = "Pdf files (*.pdf)|*.pdf|All files (*.*)|*.*"; saveFileDialog1.FilterIndex = 2; saveFileDialog1.RestoreDirectory = true; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { string filename = saveFileDialog1.FileName; // actual code that will create Pdf files var HtmlLine = new HtmlToPdf(); HtmlLine.RenderHtmlAsPdf(PdfText.Text).SaveAs(filename); // MessageBox to display that file save MessageBox.Show("File Saved Successfully!"); } } Private Sub Save_Click(ByVal sender As Object, ByVal e As EventArgs) ' Code to Select the folder and save the file. Dim saveFileDialog1 As New SaveFileDialog() saveFileDialog1.InitialDirectory = "D:\" saveFileDialog1.Title = "Save Pdf File" saveFileDialog1.DefaultExt = "pdf" saveFileDialog1.Filter = "Pdf files (*.pdf)|*.pdf|All files (*.*)|*.*" saveFileDialog1.FilterIndex = 2 saveFileDialog1.RestoreDirectory = True If saveFileDialog1.ShowDialog() = DialogResult.OK Then Dim filename As String = saveFileDialog1.FileName ' actual code that will create Pdf files Dim HtmlLine = New HtmlToPdf() HtmlLine.RenderHtmlAsPdf(PdfText.Text).SaveAs(filename) ' MessageBox to display that file save MessageBox.Show("File Saved Successfully!") End If End Sub $vbLabelText $csharpLabel SaveFileDialog 应打开一个文件对话框,允许您选择要在其中构建 PDF 文档的位置的文件夹和文件名。 初始目录设置为 D 盘,但可以选择设置为任何其他目录。 由于我们只处理 PDF 文件,默认扩展名已设置为 PDF 文件。 在“if”条件中,插入创建 PDF 文件的实际代码。 现在我们可以看到,我们只用了两行代码就成功生成了一个 PDF 文件。 PdfText 是一个包含将写入 PDF 文档的文本的富文本框的名称。 文件名是通过 SaveFileDialog 方法选择的文件路径和名称。 读取 PDFs 您可能会认为读取 PDF 文件的代码将很复杂且难以撰写/理解——但别担心——IronPDF 已使其变得更简单。 该过程只需两行代码即可完成! 在文件顶部为导入 IronPdf 库添加以下代码。 using IronPdf; using System; using System.Windows.Forms; using IronPdf; using System; using System.Windows.Forms; Imports IronPdf Imports System Imports System.Windows.Forms $vbLabelText $csharpLabel 在函数内写入以下代码。 private void Read_Click(object sender, EventArgs e) { PdfDocument PDF = PdfDocument.FromFile(FilePath.Text); FileContent.Text = PDF.ExtractAllText(); } private void Read_Click(object sender, EventArgs e) { PdfDocument PDF = PdfDocument.FromFile(FilePath.Text); FileContent.Text = PDF.ExtractAllText(); } Private Sub Read_Click(ByVal sender As Object, ByVal e As EventArgs) Dim PDF As PdfDocument = PdfDocument.FromFile(FilePath.Text) FileContent.Text = PDF.ExtractAllText() End Sub $vbLabelText $csharpLabel 这将从数据源提取所有信息到文档查看器。 所有报告组件将使用该数据作为数据源。 GrapeCity PDF 功能 GrapeCity Documents 是一个跨平台文档管理系统,提供一个统一的文档、编辑器和阅读器解决方案,适用于所有通用文档格式。 不需要像 Adobe Acrobat 这样的额外程序,.NET Standard 2.0 提供的丰富库可用于读取、生成、修改和保存 PDF 文件。 它具备强大的功能集,允许开发人员构建包含高级字体支持、图片、图形、条形码、评论、大纲、印章、水印等的 PDF 文件。 操作 PDFs 在 .NET Standard 应用中,您可以使用 GrapeCityPDF 生成满足基本或复杂业务需求的 PDF 文档。 此外,您还可以从任何源加载、修改和保存 PDFs。 将 PDF 保存为图像 您可以使用 GrapeCityPDF 将 PDF 保存为图像而不牺牲图像质量。 此外,您只需使用少量代码便可实现该功能。 PDF 查看器 GrapeCity Documents PDF Viewer 是一个轻量级的基于编程的客户端查看器,用于查看 PDF 文件。 许多常规的 PDF 功能都受到支持。 大量功能 GrapeCityPDF 库具有众多功能,使您能够创建包含文字、图形、图片、注释、大纲等复杂信息的 PDF 文档。 安装 安装 GrapeCity 有两种方法。 选择 下载压缩源文件 按钮以下载当前示例源。 直接从下载的 zip 中将文件解压到计算机上的目录中。 导航到该目录。 执行 run.cmd 批处理文件。这将构建示例源。 启动 SupportApi 服务,并在默认浏览器中打开 http://localhost:3003 URL。 查看下载 zip 中包含的 readme.MD 以获取更多信息。 安装 WinForms 版 下文讨论了安装 WinForms 版的程序。 以下步骤提供了安装 WinForms 版的说明: Download the C1ControlPanel from GrapeCity's ComponentOne to install the latest edition of WinForms. 使用 ComponentOneC1ControlPanel.exe 打开 ControlPanel。 任何正在运行的 Visual Studio 实例都必须关闭。 已注册用户可以使用注册的电子邮件地址和密码登录。 如果您是新用户: 使用 Component One 注册并通过填写必填字段创建一个帐户。 验证邮件将发送至您的电子邮件地址。 通过访问验证链接来激活您的邮件地址。 如果您不想登录或注册,可以以匿名用户身份继续。 在 WinForms 版区块,选择 安装。 通过选中 所有版本 旁边的复选框实现所有版本的安装。 选择 查看更多 按钮以了解有关该版本的更多信息。 class="content-img-align-center"> class="content__image-caption"> 一旦您点击安装,将显示许可协议页面,要求您在点击 接受许可协议 按钮之前进行查看。 一旦您接受许可协议,即将出现包含设置和目录路径更改按钮的后续页面。 选择 接受设置 提示以验证目录路径并开始安装过程。 class="content-img-align-center"> class="content__image-caption"> 安装程序将安装控件并在安装过程中显示其进度。 显示此屏幕时,您将无法取消安装过程。 一旦控件安装完毕,将显示“安装成功”屏幕。 当前安装的版本将在相应的版本中显示。 安装程序将安装控件并在安装过程中显示其进度。 显示此屏幕时,您将无法取消安装过程。 class="content-img-align-center"> class="content__image-caption"> 一旦控件安装完毕,将显示“安装成功”屏幕。 当前安装的版本将在相应的版本中显示。 class="content-img-align-center"> class="content__image-caption"> 创建 PDF using System; using System.IO; using System.Drawing; using System.Text; using GrapeCity.Documents.Text; using GrapeCity.Documents.Common; using GrapeCity.Documents.Drawing; using GrapeCity.Documents.Pdf; using GrapeCity.Documents.Pdf.Structure; using GrapeCity.Documents.Pdf.MarkedContent; using GrapeCity.Documents.Pdf.Graphics; using GrapeCity.Documents.Pdf.Annotations; using GCTEXT = GrapeCity.Documents.Text; using GCDRAW = GrapeCity.Documents.Drawing; namespace GcPdfWeb.Samples.Basics { // This sample shows how to create a PDF/A-3u compliant document. public class PdfA { public void CreatePDF(Stream stream) { var doc = new GcPdfDocument(); var date = new DateTime(1961, 4, 12, 6, 7, 0, DateTimeKind.Utc); // Mark the document as PDF/A-3u conformant: doc.ConformanceLevel = PdfAConformanceLevel.PdfA3u; var fnt = GCTEXT.Font.FromFile(Path.Combine("Resources", "Fonts", "arial.ttf")); var gap = 36; // PDF/A-3a requires all content to be tagged so create and populate StructElement when rendering: StructElement sePart = new StructElement("Part"); doc.StructTreeRoot.Children.Add(sePart); TextLayout tl = null; // Add 3 pages with sample content tagged according to PDF/A rules: for (int pageNo = 1; pageNo <= 3; ++pageNo) { // add page var page = doc.Pages.Add(); var g = page.Graphics; float y = 72; if (doc.Pages.Count == 1) { // Create paragraph element: var seParagraph = new StructElement("P") { DefaultPage = page }; // Add it to Part element: sePart.Children.Add(seParagraph); tl = g.CreateTextLayout(); tl.MarginAll = 72; tl.MaxWidth = page.Size.Width; tl.DefaultFormat.Font = fnt; tl.DefaultFormat.FontBold = true; tl.DefaultFormat.FontSize = 20; tl.Append("PDF/A-3A Document"); // PerformLayout is done automatically in a new TextLayout or after a Clear(): //tl.PerformLayout(true); // Draw TextLayout within tagged content: g.BeginMarkedContent(new TagMcid("P", 0)); g.DrawTextLayout(tl, PointF.Empty); g.EndMarkedContent(); y = tl.ContentRectangle.Bottom + gap; seParagraph.ContentItems.Add(new McidContentItemLink(0)); } // Add some sample paragraphs tagged according to PDF/A rules: for (int i = 1; i <= 3; ++i) { // Create paragraph element: var seParagraph = new StructElement("P") { DefaultPage = page }; // Add it to Part element: sePart.Children.Add(seParagraph); var sb = new StringBuilder(); sb.Append(string.Format("Paragraph {0} on page {1}: ", i, pageNo)); sb.Append(Common.Util.LoremIpsum(1, 2, 4, 5, 10)); var para = sb.ToString(); tl.Clear(); tl.DefaultFormat.FontSize = 14; tl.DefaultFormat.FontBold = false; tl.MarginTop = y; tl.Append(para); // Draw TextLayout within tagged content: g.BeginMarkedContent(new TagMcid("P", i)); g.DrawTextLayout(tl, PointF.Empty); g.EndMarkedContent(); y += tl.ContentHeight + gap; // Add content item to paragraph StructElement: seParagraph.ContentItems.Add(new McidContentItemLink(i)); // PDF/A-3 allows embedding files into document, but they should be associated with some document element // add embedded file associated with seParagraph: var ef1 = EmbeddedFileStream.FromBytes(doc, Encoding.UTF8.GetBytes(para)); // ModificationDate and MimeType should be specified in case of PDF/A: ef1.ModificationDate = date; ef1.MimeType = "text/plain"; var fn = string.Format("Page{0}_Paragraph{1}.txt", pageNo, i); var fs1 = FileSpecification.FromEmbeddedStream(fn, ef1); // UnicodeFile.FileName should be specified for PDF/A compliance: fs1.UnicodeFile.FileName = fs1.File.FileName; // Relationship should be specified in case of PDF/A: fs1.Relationship = AFRelationship.Unspecified; doc.EmbeddedFiles.Add(fn, fs1); seParagraph.AssociatedFiles.Add(fs1); } } // PDF/A-3 allows transparency drawing in PDF file, add some: var gpage = doc.Pages [0].Graphics; gpage.FillRectangle(new RectangleF(20, 20, 200, 200), Color.FromArgb(40, Color.Red)); // PDF/A-3 allows using FormXObjects, add one with transparency: var r = new RectangleF(0, 0, 144, 72); var fxo = new FormXObject(doc, r); var gfxo = fxo.Graphics; gfxo.FillRectangle(r, Color.FromArgb(40, Color.Violet)); TextFormat tf = new TextFormat() { Font = fnt, FontSize = 16, ForeColor = Color.FromArgb(100, Color.Black), }; gfxo.DrawString("FormXObject", tf, r, TextAlignment.Center, ParagraphAlignment.Center); gfxo.DrawRectangle(r, Color.Blue, 3); gpage.DrawForm(fxo, new RectangleF(300, 250, r.Width, r.Height), null, ImageAlign.ScaleImage); // PDF/A-3 allows using embedded files, but each embedded file must be associated with a document's element: EmbeddedFileStream ef = EmbeddedFileStream.FromFile(doc, Path.Combine("Resources", "WordDocs", "ProcurementLetter.docx")); // ModificationDate and MimeType should be specified for EmbeddedFile in PDF/A: ef.ModificationDate = date; ef.MimeType = "application/msword"; var fs = FileSpecification.FromEmbeddedFile(ef); fs.UnicodeFile.FileName = fs.File.FileName; fs.Relationship = AFRelationship.Unspecified; doc.EmbeddedFiles.Add("ProcurementLetter.docx", fs); // Associate embedded file with the document: doc.AssociatedFiles.Add(fs); // Add an attachment associated with an annotation: var sa = new StampAnnotation() { UserName = "Minerva", Font = fnt, Rect = new RectangleF(300, 36, 220, 72), }; sa.Flags |= AnnotationFlags.Print; // Use a FormXObject to represent the stamp annotation: var stampFxo = new FormXObject(doc, new RectangleF(PointF.Empty, sa.Rect.Size)); var gstampFxo = stampFxo.Graphics; gstampFxo.FillRectangle(stampFxo.Bounds, Color.FromArgb(40, Color.Green)); gstampFxo.DrawString("Stamp Annotation\nassociated with minerva.jpg", tf, stampFxo.Bounds, TextAlignment.Center, ParagraphAlignment.Center); gstampFxo.DrawRectangle(stampFxo.Bounds, Color.Green, 3); // sa.AppearanceStreams.Normal.Default = stampFxo; doc.Pages [0].Annotations.Add(sa); ef = EmbeddedFileStream.FromFile(doc, Path.Combine("Resources", "Images", "minerva.jpg")); ef.ModificationDate = date; ef.MimeType = "image/jpeg"; fs = FileSpecification.FromEmbeddedFile(ef); fs.UnicodeFile.FileName = fs.File.FileName; fs.Relationship = AFRelationship.Unspecified; doc.EmbeddedFiles.Add("minerva.jpg", fs); sa.AssociatedFiles.Add(fs); // Mark the document as conforming to Tagged PDF conventions (required for PDF/A): doc.MarkInfo.Marked = true; // Metadata.CreatorTool and DocumentInfo.Creator should be the same for a PDF/A document: doc.Metadata.CreatorTool = doc.DocumentInfo.Creator; // A title should be specified for PDF/A document: doc.Metadata.Title = "GcPdf Document"; doc.ViewerPreferences.DisplayDocTitle = true; // Done: doc.Save(stream); } } } using System; using System.IO; using System.Drawing; using System.Text; using GrapeCity.Documents.Text; using GrapeCity.Documents.Common; using GrapeCity.Documents.Drawing; using GrapeCity.Documents.Pdf; using GrapeCity.Documents.Pdf.Structure; using GrapeCity.Documents.Pdf.MarkedContent; using GrapeCity.Documents.Pdf.Graphics; using GrapeCity.Documents.Pdf.Annotations; using GCTEXT = GrapeCity.Documents.Text; using GCDRAW = GrapeCity.Documents.Drawing; namespace GcPdfWeb.Samples.Basics { // This sample shows how to create a PDF/A-3u compliant document. public class PdfA { public void CreatePDF(Stream stream) { var doc = new GcPdfDocument(); var date = new DateTime(1961, 4, 12, 6, 7, 0, DateTimeKind.Utc); // Mark the document as PDF/A-3u conformant: doc.ConformanceLevel = PdfAConformanceLevel.PdfA3u; var fnt = GCTEXT.Font.FromFile(Path.Combine("Resources", "Fonts", "arial.ttf")); var gap = 36; // PDF/A-3a requires all content to be tagged so create and populate StructElement when rendering: StructElement sePart = new StructElement("Part"); doc.StructTreeRoot.Children.Add(sePart); TextLayout tl = null; // Add 3 pages with sample content tagged according to PDF/A rules: for (int pageNo = 1; pageNo <= 3; ++pageNo) { // add page var page = doc.Pages.Add(); var g = page.Graphics; float y = 72; if (doc.Pages.Count == 1) { // Create paragraph element: var seParagraph = new StructElement("P") { DefaultPage = page }; // Add it to Part element: sePart.Children.Add(seParagraph); tl = g.CreateTextLayout(); tl.MarginAll = 72; tl.MaxWidth = page.Size.Width; tl.DefaultFormat.Font = fnt; tl.DefaultFormat.FontBold = true; tl.DefaultFormat.FontSize = 20; tl.Append("PDF/A-3A Document"); // PerformLayout is done automatically in a new TextLayout or after a Clear(): //tl.PerformLayout(true); // Draw TextLayout within tagged content: g.BeginMarkedContent(new TagMcid("P", 0)); g.DrawTextLayout(tl, PointF.Empty); g.EndMarkedContent(); y = tl.ContentRectangle.Bottom + gap; seParagraph.ContentItems.Add(new McidContentItemLink(0)); } // Add some sample paragraphs tagged according to PDF/A rules: for (int i = 1; i <= 3; ++i) { // Create paragraph element: var seParagraph = new StructElement("P") { DefaultPage = page }; // Add it to Part element: sePart.Children.Add(seParagraph); var sb = new StringBuilder(); sb.Append(string.Format("Paragraph {0} on page {1}: ", i, pageNo)); sb.Append(Common.Util.LoremIpsum(1, 2, 4, 5, 10)); var para = sb.ToString(); tl.Clear(); tl.DefaultFormat.FontSize = 14; tl.DefaultFormat.FontBold = false; tl.MarginTop = y; tl.Append(para); // Draw TextLayout within tagged content: g.BeginMarkedContent(new TagMcid("P", i)); g.DrawTextLayout(tl, PointF.Empty); g.EndMarkedContent(); y += tl.ContentHeight + gap; // Add content item to paragraph StructElement: seParagraph.ContentItems.Add(new McidContentItemLink(i)); // PDF/A-3 allows embedding files into document, but they should be associated with some document element // add embedded file associated with seParagraph: var ef1 = EmbeddedFileStream.FromBytes(doc, Encoding.UTF8.GetBytes(para)); // ModificationDate and MimeType should be specified in case of PDF/A: ef1.ModificationDate = date; ef1.MimeType = "text/plain"; var fn = string.Format("Page{0}_Paragraph{1}.txt", pageNo, i); var fs1 = FileSpecification.FromEmbeddedStream(fn, ef1); // UnicodeFile.FileName should be specified for PDF/A compliance: fs1.UnicodeFile.FileName = fs1.File.FileName; // Relationship should be specified in case of PDF/A: fs1.Relationship = AFRelationship.Unspecified; doc.EmbeddedFiles.Add(fn, fs1); seParagraph.AssociatedFiles.Add(fs1); } } // PDF/A-3 allows transparency drawing in PDF file, add some: var gpage = doc.Pages [0].Graphics; gpage.FillRectangle(new RectangleF(20, 20, 200, 200), Color.FromArgb(40, Color.Red)); // PDF/A-3 allows using FormXObjects, add one with transparency: var r = new RectangleF(0, 0, 144, 72); var fxo = new FormXObject(doc, r); var gfxo = fxo.Graphics; gfxo.FillRectangle(r, Color.FromArgb(40, Color.Violet)); TextFormat tf = new TextFormat() { Font = fnt, FontSize = 16, ForeColor = Color.FromArgb(100, Color.Black), }; gfxo.DrawString("FormXObject", tf, r, TextAlignment.Center, ParagraphAlignment.Center); gfxo.DrawRectangle(r, Color.Blue, 3); gpage.DrawForm(fxo, new RectangleF(300, 250, r.Width, r.Height), null, ImageAlign.ScaleImage); // PDF/A-3 allows using embedded files, but each embedded file must be associated with a document's element: EmbeddedFileStream ef = EmbeddedFileStream.FromFile(doc, Path.Combine("Resources", "WordDocs", "ProcurementLetter.docx")); // ModificationDate and MimeType should be specified for EmbeddedFile in PDF/A: ef.ModificationDate = date; ef.MimeType = "application/msword"; var fs = FileSpecification.FromEmbeddedFile(ef); fs.UnicodeFile.FileName = fs.File.FileName; fs.Relationship = AFRelationship.Unspecified; doc.EmbeddedFiles.Add("ProcurementLetter.docx", fs); // Associate embedded file with the document: doc.AssociatedFiles.Add(fs); // Add an attachment associated with an annotation: var sa = new StampAnnotation() { UserName = "Minerva", Font = fnt, Rect = new RectangleF(300, 36, 220, 72), }; sa.Flags |= AnnotationFlags.Print; // Use a FormXObject to represent the stamp annotation: var stampFxo = new FormXObject(doc, new RectangleF(PointF.Empty, sa.Rect.Size)); var gstampFxo = stampFxo.Graphics; gstampFxo.FillRectangle(stampFxo.Bounds, Color.FromArgb(40, Color.Green)); gstampFxo.DrawString("Stamp Annotation\nassociated with minerva.jpg", tf, stampFxo.Bounds, TextAlignment.Center, ParagraphAlignment.Center); gstampFxo.DrawRectangle(stampFxo.Bounds, Color.Green, 3); // sa.AppearanceStreams.Normal.Default = stampFxo; doc.Pages [0].Annotations.Add(sa); ef = EmbeddedFileStream.FromFile(doc, Path.Combine("Resources", "Images", "minerva.jpg")); ef.ModificationDate = date; ef.MimeType = "image/jpeg"; fs = FileSpecification.FromEmbeddedFile(ef); fs.UnicodeFile.FileName = fs.File.FileName; fs.Relationship = AFRelationship.Unspecified; doc.EmbeddedFiles.Add("minerva.jpg", fs); sa.AssociatedFiles.Add(fs); // Mark the document as conforming to Tagged PDF conventions (required for PDF/A): doc.MarkInfo.Marked = true; // Metadata.CreatorTool and DocumentInfo.Creator should be the same for a PDF/A document: doc.Metadata.CreatorTool = doc.DocumentInfo.Creator; // A title should be specified for PDF/A document: doc.Metadata.Title = "GcPdf Document"; doc.ViewerPreferences.DisplayDocTitle = true; // Done: doc.Save(stream); } } } Imports Microsoft.VisualBasic Imports System Imports System.IO Imports System.Drawing Imports System.Text Imports GrapeCity.Documents.Text Imports GrapeCity.Documents.Common Imports GrapeCity.Documents.Drawing Imports GrapeCity.Documents.Pdf Imports GrapeCity.Documents.Pdf.Structure Imports GrapeCity.Documents.Pdf.MarkedContent Imports GrapeCity.Documents.Pdf.Graphics Imports GrapeCity.Documents.Pdf.Annotations Imports GCTEXT = GrapeCity.Documents.Text Imports GCDRAW = GrapeCity.Documents.Drawing Namespace GcPdfWeb.Samples.Basics ' This sample shows how to create a PDF/A-3u compliant document. Public Class PdfA Public Sub CreatePDF(ByVal stream As Stream) Dim doc = New GcPdfDocument() Dim [date] = New DateTime(1961, 4, 12, 6, 7, 0, DateTimeKind.Utc) ' Mark the document as PDF/A-3u conformant: doc.ConformanceLevel = PdfAConformanceLevel.PdfA3u Dim fnt = GCTEXT.Font.FromFile(Path.Combine("Resources", "Fonts", "arial.ttf")) Dim gap = 36 ' PDF/A-3a requires all content to be tagged so create and populate StructElement when rendering: Dim sePart As New StructElement("Part") doc.StructTreeRoot.Children.Add(sePart) Dim tl As TextLayout = Nothing ' Add 3 pages with sample content tagged according to PDF/A rules: For pageNo As Integer = 1 To 3 ' add page Dim page = doc.Pages.Add() Dim g = page.Graphics Dim y As Single = 72 If doc.Pages.Count = 1 Then ' Create paragraph element: Dim seParagraph = New StructElement("P") With {.DefaultPage = page} ' Add it to Part element: sePart.Children.Add(seParagraph) tl = g.CreateTextLayout() tl.MarginAll = 72 tl.MaxWidth = page.Size.Width tl.DefaultFormat.Font = fnt tl.DefaultFormat.FontBold = True tl.DefaultFormat.FontSize = 20 tl.Append("PDF/A-3A Document") ' PerformLayout is done automatically in a new TextLayout or after a Clear(): 'tl.PerformLayout(true); ' Draw TextLayout within tagged content: g.BeginMarkedContent(New TagMcid("P", 0)) g.DrawTextLayout(tl, PointF.Empty) g.EndMarkedContent() y = tl.ContentRectangle.Bottom + gap seParagraph.ContentItems.Add(New McidContentItemLink(0)) End If ' Add some sample paragraphs tagged according to PDF/A rules: For i As Integer = 1 To 3 ' Create paragraph element: Dim seParagraph = New StructElement("P") With {.DefaultPage = page} ' Add it to Part element: sePart.Children.Add(seParagraph) Dim sb = New StringBuilder() sb.Append(String.Format("Paragraph {0} on page {1}: ", i, pageNo)) sb.Append(Common.Util.LoremIpsum(1, 2, 4, 5, 10)) Dim para = sb.ToString() tl.Clear() tl.DefaultFormat.FontSize = 14 tl.DefaultFormat.FontBold = False tl.MarginTop = y tl.Append(para) ' Draw TextLayout within tagged content: g.BeginMarkedContent(New TagMcid("P", i)) g.DrawTextLayout(tl, PointF.Empty) g.EndMarkedContent() y += tl.ContentHeight + gap ' Add content item to paragraph StructElement: seParagraph.ContentItems.Add(New McidContentItemLink(i)) ' PDF/A-3 allows embedding files into document, but they should be associated with some document element ' add embedded file associated with seParagraph: Dim ef1 = EmbeddedFileStream.FromBytes(doc, Encoding.UTF8.GetBytes(para)) ' ModificationDate and MimeType should be specified in case of PDF/A: ef1.ModificationDate = [date] ef1.MimeType = "text/plain" Dim fn = String.Format("Page{0}_Paragraph{1}.txt", pageNo, i) Dim fs1 = FileSpecification.FromEmbeddedStream(fn, ef1) ' UnicodeFile.FileName should be specified for PDF/A compliance: fs1.UnicodeFile.FileName = fs1.File.FileName ' Relationship should be specified in case of PDF/A: fs1.Relationship = AFRelationship.Unspecified doc.EmbeddedFiles.Add(fn, fs1) seParagraph.AssociatedFiles.Add(fs1) Next i Next pageNo ' PDF/A-3 allows transparency drawing in PDF file, add some: Dim gpage = doc.Pages (0).Graphics gpage.FillRectangle(New RectangleF(20, 20, 200, 200), Color.FromArgb(40, Color.Red)) ' PDF/A-3 allows using FormXObjects, add one with transparency: Dim r = New RectangleF(0, 0, 144, 72) Dim fxo = New FormXObject(doc, r) Dim gfxo = fxo.Graphics gfxo.FillRectangle(r, Color.FromArgb(40, Color.Violet)) Dim tf As New TextFormat() With { .Font = fnt, .FontSize = 16, .ForeColor = Color.FromArgb(100, Color.Black) } gfxo.DrawString("FormXObject", tf, r, TextAlignment.Center, ParagraphAlignment.Center) gfxo.DrawRectangle(r, Color.Blue, 3) gpage.DrawForm(fxo, New RectangleF(300, 250, r.Width, r.Height), Nothing, ImageAlign.ScaleImage) ' PDF/A-3 allows using embedded files, but each embedded file must be associated with a document's element: Dim ef As EmbeddedFileStream = EmbeddedFileStream.FromFile(doc, Path.Combine("Resources", "WordDocs", "ProcurementLetter.docx")) ' ModificationDate and MimeType should be specified for EmbeddedFile in PDF/A: ef.ModificationDate = [date] ef.MimeType = "application/msword" Dim fs = FileSpecification.FromEmbeddedFile(ef) fs.UnicodeFile.FileName = fs.File.FileName fs.Relationship = AFRelationship.Unspecified doc.EmbeddedFiles.Add("ProcurementLetter.docx", fs) ' Associate embedded file with the document: doc.AssociatedFiles.Add(fs) ' Add an attachment associated with an annotation: Dim sa = New StampAnnotation() With { .UserName = "Minerva", .Font = fnt, .Rect = New RectangleF(300, 36, 220, 72) } sa.Flags = sa.Flags Or AnnotationFlags.Print ' Use a FormXObject to represent the stamp annotation: Dim stampFxo = New FormXObject(doc, New RectangleF(PointF.Empty, sa.Rect.Size)) Dim gstampFxo = stampFxo.Graphics gstampFxo.FillRectangle(stampFxo.Bounds, Color.FromArgb(40, Color.Green)) gstampFxo.DrawString("Stamp Annotation" & vbLf & "associated with minerva.jpg", tf, stampFxo.Bounds, TextAlignment.Center, ParagraphAlignment.Center) gstampFxo.DrawRectangle(stampFxo.Bounds, Color.Green, 3) ' sa.AppearanceStreams.Normal.Default = stampFxo doc.Pages (0).Annotations.Add(sa) ef = EmbeddedFileStream.FromFile(doc, Path.Combine("Resources", "Images", "minerva.jpg")) ef.ModificationDate = [date] ef.MimeType = "image/jpeg" fs = FileSpecification.FromEmbeddedFile(ef) fs.UnicodeFile.FileName = fs.File.FileName fs.Relationship = AFRelationship.Unspecified doc.EmbeddedFiles.Add("minerva.jpg", fs) sa.AssociatedFiles.Add(fs) ' Mark the document as conforming to Tagged PDF conventions (required for PDF/A): doc.MarkInfo.Marked = True ' Metadata.CreatorTool and DocumentInfo.Creator should be the same for a PDF/A document: doc.Metadata.CreatorTool = doc.DocumentInfo.Creator ' A title should be specified for PDF/A document: doc.Metadata.Title = "GcPdf Document" doc.ViewerPreferences.DisplayDocTitle = True ' Done: doc.Save(stream) End Sub End Class End Namespace $vbLabelText $csharpLabel GrapeCityPDF 不是一个高级的 PDF 库——与 IronPDF 相比,其功能数量有限。 IronPDF。 License Models and Pricing 30 天退款保证:一旦购买许可证,您将获得 30 天退款保证。 如果许可证不符合您的需求,IronPDF 将在 30 天内保证退款。 轻松集成:IronPDF 与工作项目和您的环境的集成是一个无缝的过程,通过一行代码即可完成。 这可以在使用 NuGet 包方法集成或者直接在线下载并集成到您的环境中时实现。 永久许可:每个许可证仅购买一次,无需续签。 免费支持和产品更新:每个许可证都将附带来自产品背后团队的全面支持以及一年的免费产品更新。 可以随时购买扩展。 扩展可以在购买前查看。 即时许可:一旦收到付款,注册的许可证密钥将被发送。 所有许可证都是永久的,并适用于登台、开发和生产。 Bootstrap 工作流示范 现代 PDF 生成工作流受益于可视过程表示。 此 Bootstrap 5 示例演示了 IronPDF 在使用卡片、徽章和步骤指示器渲染工作流程时间线方面的能力。 using IronPdf; var renderer = new ChromePdfRenderer(); string workflowTimeline = @" <!DOCTYPE html> <html> <head> <meta charset='utf-8'> <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'> <style> .timeline-item { position: relative; padding-left: 40px; margin-bottom: 30px; } .timeline-item::before { content: ''; position: absolute; left: 0; top: 0; width: 20px; height: 20px; background: #0d6efd; border-radius: 50%; border: 3px solid white; box-shadow: 0 0 0 2px #0d6efd; } .timeline-item::after { content: ''; position: absolute; left: 9px; top: 20px; width: 2px; height: calc(100% + 10px); background: #dee2e6; } .timeline-item:last-child::after { display: none; } @media print { .timeline-item { page-break-inside: avoid; } } </style> </head> <body class='bg-light'> <div class='container py-4'> <div class='text-center mb-5'> <h1 class='display-6 fw-bold'>PDF Generation Workflow</h1> <p class='lead text-muted'>From HTML to Professional PDF Documents</p> </div> <div class='timeline-item'> <div class='card shadow-sm'> <div class='card-body'> <div class='d-flex justify-content-between align-items-center mb-2'> <h4 class='card-title mb-0'>Step 1: Initialize Renderer</h4> <span class='badge bg-primary'>Setup</span> </div> <p class='card-text'>Create ChromePdfRenderer instance with Chrome V8 engine for accurate HTML rendering.</p> <div class='bg-light p-2 rounded'> <code>var renderer = new ChromePdfRenderer();</code> </div> <div class='mt-2'> <small class='text-muted'>✓ Chrome V8 Engine • ✓ Full CSS3 Support • ✓ JavaScript Ready</small> </div> </div> </div> </div> <div class='timeline-item'> <div class='card shadow-sm'> <div class='card-body'> <div class='d-flex justify-content-between align-items-center mb-2'> <h4 class='card-title mb-0'>Step 2: Prepare HTML Content</h4> <span class='badge bg-info'>Content</span> </div> <p class='card-text'>Design your document using modern HTML5, CSS3 (Flexbox/Grid), and optional JavaScript.</p> <div class='row g-2'> <div class='col-4'><span class='badge bg-success w-100'>HTML5</span></div> <div class='col-4'><span class='badge bg-success w-100'>CSS3</span></div> <div class='col-4'><span class='badge bg-success w-100'>JavaScript</span></div> </div> </div> </div> </div> <div class='timeline-item'> <div class='card shadow-sm'> <div class='card-body'> <div class='d-flex justify-content-between align-items-center mb-2'> <h4 class='card-title mb-0'>Step 3: Render to PDF</h4> <span class='badge bg-warning text-dark'>Processing</span> </div> <p class='card-text'>Convert HTML to PDF with pixel-perfect accuracy and sub-second performance.</p> <div class='bg-light p-2 rounded'> <code>var pdf = renderer.RenderHtmlAsPdf(htmlContent);</code> </div> <div class='progress mt-2' style='height: 8px;'> <div class='progress-bar bg-warning' style='width: 100%'></div> </div> <small class='text-muted d-block mt-1'>Average render time: 0.9 seconds</small> </div> </div> </div> <div class='timeline-item'> <div class='card shadow-sm'> <div class='card-body'> <div class='d-flex justify-content-between align-items-center mb-2'> <h4 class='card-title mb-0'>Step 4: Save or Stream</h4> <span class='badge bg-success'>Output</span> </div> <p class='card-text'>Export to file, stream, or byte array for flexible deployment options.</p> <div class='bg-light p-2 rounded'> <code>pdf.SaveAs("document.pdf");</code> </div> <div class='mt-2'> <span class='badge bg-outline-secondary me-1'>File</span> <span class='badge bg-outline-secondary me-1'>Stream</span> <span class='badge bg-outline-secondary'>Byte Array</span> </div> </div> </div> </div> <div class='alert alert-info'> <strong>Comparison Note:</strong> GrapeCity PDF Viewer focuses on document viewing and annotation, not HTML-to-PDF generation. IronPDF specializes in creating PDFs from modern web content with full Bootstrap and framework support. </div> <div class='card shadow-sm border-primary'> <div class='card-header bg-primary text-white'> <h5 class='mb-0'>Key Advantages</h5> </div> <div class='card-body'> <div class='row'> <div class='col-md-6'> <h6 class='text-primary'>IronPDF Strengths</h6> <ul class='small'> <li>Complete HTML-to-PDF workflow</li> <li>Bootstrap 5 framework support</li> <li>Async/await for scalability</li> <li>Cross-platform deployment</li> </ul> </div> <div class='col-md-6'> <h6 class='text-muted'>GrapeCity Focus</h6> <ul class='small'> <li>PDF viewing and annotation</li> <li>UI component for display</li> <li>Limited generation features</li> <li>Viewer-centric approach</li> </ul> </div> </div> </div> </div> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(workflowTimeline); pdf.SaveAs("workflow-timeline.pdf"); using IronPdf; var renderer = new ChromePdfRenderer(); string workflowTimeline = @" <!DOCTYPE html> <html> <head> <meta charset='utf-8'> <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'> <style> .timeline-item { position: relative; padding-left: 40px; margin-bottom: 30px; } .timeline-item::before { content: ''; position: absolute; left: 0; top: 0; width: 20px; height: 20px; background: #0d6efd; border-radius: 50%; border: 3px solid white; box-shadow: 0 0 0 2px #0d6efd; } .timeline-item::after { content: ''; position: absolute; left: 9px; top: 20px; width: 2px; height: calc(100% + 10px); background: #dee2e6; } .timeline-item:last-child::after { display: none; } @media print { .timeline-item { page-break-inside: avoid; } } </style> </head> <body class='bg-light'> <div class='container py-4'> <div class='text-center mb-5'> <h1 class='display-6 fw-bold'>PDF Generation Workflow</h1> <p class='lead text-muted'>From HTML to Professional PDF Documents</p> </div> <div class='timeline-item'> <div class='card shadow-sm'> <div class='card-body'> <div class='d-flex justify-content-between align-items-center mb-2'> <h4 class='card-title mb-0'>Step 1: Initialize Renderer</h4> <span class='badge bg-primary'>Setup</span> </div> <p class='card-text'>Create ChromePdfRenderer instance with Chrome V8 engine for accurate HTML rendering.</p> <div class='bg-light p-2 rounded'> <code>var renderer = new ChromePdfRenderer();</code> </div> <div class='mt-2'> <small class='text-muted'>✓ Chrome V8 Engine • ✓ Full CSS3 Support • ✓ JavaScript Ready</small> </div> </div> </div> </div> <div class='timeline-item'> <div class='card shadow-sm'> <div class='card-body'> <div class='d-flex justify-content-between align-items-center mb-2'> <h4 class='card-title mb-0'>Step 2: Prepare HTML Content</h4> <span class='badge bg-info'>Content</span> </div> <p class='card-text'>Design your document using modern HTML5, CSS3 (Flexbox/Grid), and optional JavaScript.</p> <div class='row g-2'> <div class='col-4'><span class='badge bg-success w-100'>HTML5</span></div> <div class='col-4'><span class='badge bg-success w-100'>CSS3</span></div> <div class='col-4'><span class='badge bg-success w-100'>JavaScript</span></div> </div> </div> </div> </div> <div class='timeline-item'> <div class='card shadow-sm'> <div class='card-body'> <div class='d-flex justify-content-between align-items-center mb-2'> <h4 class='card-title mb-0'>Step 3: Render to PDF</h4> <span class='badge bg-warning text-dark'>Processing</span> </div> <p class='card-text'>Convert HTML to PDF with pixel-perfect accuracy and sub-second performance.</p> <div class='bg-light p-2 rounded'> <code>var pdf = renderer.RenderHtmlAsPdf(htmlContent);</code> </div> <div class='progress mt-2' style='height: 8px;'> <div class='progress-bar bg-warning' style='width: 100%'></div> </div> <small class='text-muted d-block mt-1'>Average render time: 0.9 seconds</small> </div> </div> </div> <div class='timeline-item'> <div class='card shadow-sm'> <div class='card-body'> <div class='d-flex justify-content-between align-items-center mb-2'> <h4 class='card-title mb-0'>Step 4: Save or Stream</h4> <span class='badge bg-success'>Output</span> </div> <p class='card-text'>Export to file, stream, or byte array for flexible deployment options.</p> <div class='bg-light p-2 rounded'> <code>pdf.SaveAs("document.pdf");</code> </div> <div class='mt-2'> <span class='badge bg-outline-secondary me-1'>File</span> <span class='badge bg-outline-secondary me-1'>Stream</span> <span class='badge bg-outline-secondary'>Byte Array</span> </div> </div> </div> </div> <div class='alert alert-info'> <strong>Comparison Note:</strong> GrapeCity PDF Viewer focuses on document viewing and annotation, not HTML-to-PDF generation. IronPDF specializes in creating PDFs from modern web content with full Bootstrap and framework support. </div> <div class='card shadow-sm border-primary'> <div class='card-header bg-primary text-white'> <h5 class='mb-0'>Key Advantages</h5> </div> <div class='card-body'> <div class='row'> <div class='col-md-6'> <h6 class='text-primary'>IronPDF Strengths</h6> <ul class='small'> <li>Complete HTML-to-PDF workflow</li> <li>Bootstrap 5 framework support</li> <li>Async/await for scalability</li> <li>Cross-platform deployment</li> </ul> </div> <div class='col-md-6'> <h6 class='text-muted'>GrapeCity Focus</h6> <ul class='small'> <li>PDF viewing and annotation</li> <li>UI component for display</li> <li>Limited generation features</li> <li>Viewer-centric approach</li> </ul> </div> </div> </div> </div> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(workflowTimeline); pdf.SaveAs("workflow-timeline.pdf"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel 输出:具有 Bootstrap 5 卡片、徽章、进度条和自定义时间线样式的专业工作流程时间线 PDF。 IronPDF 准确渲染所有定位、flexbox 布局和实用程序类,展示了对复杂视觉设计的全面 CSS3 支持。 有关详细的 Bootstrap 框架兼容性,请参见 Bootstrap & Flexbox CSS 指南。 Lite 套餐 1 开发人员 1 个位置 1 个项目 永久许可证 此套餐允许组织中的单个软件开发人员在一个地点利用 Iron Software。 Iron Software 可以在单一内部网络应用程序、Web 应用程序或桌面软件程序中使用。 禁止在组织外部或代理/客户关系中共享许可证,因为它们是不可转让的。 此许可证类型与所有其他许可证类型一样,明确排除未经协议明确授予的所有权利,未经 OEM 重新分发,不购买额外保障即将 Iron Software 用作 SaaS。 定价:从每年 $799 开始。 专业许可证 10 个开发人员 10 个位置 10 个项目 永久许可证 此许可证允许组织内的一定数量软件开发人员在多个地点(最多达到十个)使用 Iron Software。 Iron Software 可以在任意数量的网站、内部网络应用程序或桌面软件应用程序中使用。许可证是不可转让的,因此禁止在组织外部或代理/客户关系中共享。 此许可证类型与所有其他许可证类型一样,明确排除所有未经协议明确授予的权利,包括 OEM 重新分发和使用 Iron Software 作为 SaaS ,未经购买额外保障。 此许可证可以与单个项目中的最多十个项目集成。 定价:从每年 $1,199 开始。 无限许可证 无限开发人员 无限位置 无限项目 永久许可证 这使得您可以在一个组织内拥有无限数量的软件开发人员,在无限多个地点使用 Iron Software。 Iron Software 可以在任意数量的内部网络应用程序、桌面软件应用程序或网站中使用。许可证是不可转让的,不能在组织外部或代理/客户关系中共享。此许可证类型与所有其他许可证类型一样,明确排除所有未在协议下授予的权利,包括 OEM 重新分发和将 Iron Software 用作 SaaS,未经购买额外保障。 定价:从每年 $2999 开始。 免版权费再次发布:这允许您将 Iron Software 作为几个不同包装的商业产品的一部分进行分发(无需支付版权费),基于基础许可证涵盖的项目数量。 这将允许 Iron Software 在 SaaS 软件服务中部署,基于基础许可证涵盖的项目数量。 定价:从每年 $1599 开始。 class="content-img-align-center"> class="content__image-caption"> GrapeCity PDF 许可模型和定价 文档用于 PDF 包括 1 个开发人员许可证 1 个分发地点 此套餐包括一个开发人员许可证和仅一个分发地点,无支持和维护。 定价:从每年 $1,199 开始。 文档用于 PDF Unlimited 包括 1 个开发人员许可证 无限分发地点 此套餐包括一个开发人员许可证和无限分发地点。 不含支持和维护。 GrapeCity 不支持 SaaS 和 OEM。 定价:从每年 $2799 开始。 文档用于 PDF Team Unlimited 包括 5 个开发人员许可证 无限分发地点 此套餐包括五个开发人员许可证和无限分发地点,无支持和维护。 GrapeCity 不支持 SaaS 和 OEM。 定价:从每年 $5799 开始。 class="content-img-align-center"> class="content__image-caption"> IronPDF Lite 一个开发者套餐包含一年支持,费用约为 $799。 而 GrapeCity Documents for PDF,包括一个开发者套餐,费用为 $1,199,不含任何支持。 IronPDF 专业套餐,包括 10 开发者套餐并提供一年的支持,费用为 $1,199。 另一方面,GrapeCity 没有 10 开发者套餐,只有一个 5 开发者套餐,费用 $5799。 IronPDF Lite 和 专业 套餐提供 SaaS 服务或 OEM,以及 5 年支持选项。 Lite 一开发者套餐提供五年支持、SaaS 和 OEM 服务,费用为 $2897 美元。 而 GrapeCity 没有 SaaS、OEM 服务或 5 年支持选项。 Iron 专业 10 开发者套餐提供 5 年支持、SaaS 和 OEM 服务,费用为 $3397 美元。 而 GrapeCity 没有任何 10 开发者套餐。 结论 GrapeCity Documents for PDF 允许开发人员导出/导入、创建 AcroForms(PDF 表单),并在多个桌面应用程序上执行 PDF。 使用 GrapeCity Documents for PDF(GcPdf),您正在帮助客户提供完整的 PDF 解决方案。 我们强烈推荐 IronPDF,因这一产品提供了更高的准确性。 类似的竞争者,尽管执行相似的功能,但可能会遇到不准确问题,如未能转换某些图像导致的未知字符。 另一方面,IronPDF 提供准确的结果。 IronPDF 套餐提供具有竞争力的许可和支持,无需持续成本。 IronPDF 从 $799 开始,套餐包括更广泛的功能范围。 GrapeCity PDF 每年从 $1649 开始。 IronPDF 还支持单价多平台! 如果您还不是 IronPDF 客户,您可以访问免费试用版以查看所有可用功能。 如果购买完整的 Iron Suite,您可以以两款产品的价格获得全部五款产品。 For further details regarding IronPDF licensing, please visit Iron Software's Iron Suite product page to review the complete package information. [{i:(GrapeCity Documents for PDF 是其各自所有者的注册商标。 该网站未与 GrapeCity Documents for PDF 关联,也未获其认可或赞助。 所有产品名称、徽标和品牌均为其各自所有者的财产。 比较仅供参考,反映的是撰写时的公开信息。] 常见问题解答 如何在 .NET 中将 HTML 转换为 PDF? 您可以使用 IronPDF 的 RenderHtmlAsPdf 方法将 HTML 字符串转换为 PDF。此外,您还可以使用 RenderHtmlFileAsPdf 方法将 HTML 文件转换为 PDF。 使用 NuGet 安装 PDF 库的步骤是什么? 要使用 NuGet 安装 IronPDF,请打开 Visual Studio,导航到“管理 NuGet 包”,搜索“IronPdf”,然后点击“安装”将其添加到您的项目中。 GrapeCity PDF 查看器的 .NET 替代方案是什么? IronPDF 是 GrapeCity PDF 查看器的合适替代方案,提供用户友好的体验,并对 .NET Core、.NET 5、Framework 和 Standard 提供广泛支持。 如何使用 .NET 库创建和读取 PDF 文件? 使用 IronPDF,您可以通过包含 IronPdf 命名空间并使用 HtmlToPdf 类将 HTML 转换为 PDF 来创建 PDF。要读取 PDF,您可以使用 PdfDocument 类来访问和操作内容。 PDF 库提供哪些许可选项? IronPDF 提供多种许可选项,包括单个开发人员的 Lite 包,最多 10 位开发人员的专业许可证,以及为团队提供的无限许可证,所有这些都具有永久许可证和支持选项。 为何应该选择 IronPDF 而不是其他 PDF 解决方案? IronPDF 因其准确性、全面的功能、有竞争力的许可和广泛的支持选项而受到推荐。它在多个平台上提供支持,价格具有竞争力。 我可以在购买前试用 PDF 库吗? 是的,IronPDF 提供免费试用,让您在做出购买决策之前探索所有可用功能。此外,Iron Suite 套餐以折扣价提供对所有 Iron Software 产品的访问。 使用 PDF 文件有哪些缺点? 由于文件大小,PDF 通过电子邮件共享可能会比较困难,与 Word 文档相比,在移动设备上显示可能不清晰,并且需要特定软件进行编辑或更新。 Curtis Chau 立即与工程团队聊天 技术作家 Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。 相关文章 已发布十一月 13, 2025 比较 C# HTML 到 PDF 开源与 IronPDF 比较开源 HTML 到 PDF 库与 IronPDF for C#。发现哪个解决方案为您的 .NET 项目提供最佳的 PDF 生成能力。 阅读更多 已发布十月 27, 2025 哪种 ASP.NET Core PDF 库性价比最高? 发现适合ASP.NET Core应用程序的最佳PDF库。比较IronPDF的Chrome引擎与Aspose和Syncfusion的替代品。 阅读更多 已发布十月 27, 2025 如何使用 Aspose C# 与 IronPDF 创作 PDF 通过此逐步指南,学习如何使用 Aspose C# 与 IronPDF 创建 PDF,专为开发人员设计。 阅读更多 IronPDF与XFINIUM.PDF之间的比较IronPDF与Textcontrol之间的比较
已发布十一月 13, 2025 比较 C# HTML 到 PDF 开源与 IronPDF 比较开源 HTML 到 PDF 库与 IronPDF for C#。发现哪个解决方案为您的 .NET 项目提供最佳的 PDF 生成能力。 阅读更多
已发布十月 27, 2025 哪种 ASP.NET Core PDF 库性价比最高? 发现适合ASP.NET Core应用程序的最佳PDF库。比较IronPDF的Chrome引擎与Aspose和Syncfusion的替代品。 阅读更多
已发布十月 27, 2025 如何使用 Aspose C# 与 IronPDF 创作 PDF 通过此逐步指南,学习如何使用 Aspose C# 与 IronPDF 创建 PDF,专为开发人员设计。 阅读更多