产品比较

IronPDF与GrapeCity PDF Viewer的比较

发布 2022年九月1日
分享:

PDF 是便携式文档格式的缩写。 这种文件类型允许在许多不同设备上以常规方式查看任何文件。 PDF 通常用于与潜在雇主共享简历或与客户共享发票等重要文件。

尽管 PDF 很受欢迎,但将其作为一种存储和共享数据的方式也有一些缺点。 例如,PDF 文件不能通过电子邮件共享,因为它们需要先在 PDF 阅读器中打开。即使可以,PDF 文件在手机上打开时也不会像 Word 文档那样清晰。 此外,PDF 文件不能像 Word 文档那样进行编辑或更新,除非您的计算机上安装了编辑软件,可以识别文件中的数据并将其转换为可编辑的形式。 这意味着,无论您使用何种设备(PC 或 Mac),在打开 PDF 文件时,其外观都是一样的。 这使得 PDF 文件在所有设备上都非常可靠,因为它们采用的标准是其他文件格式(如 JPEG 或 GIF)所不具备的。

在本文中,我们将回顾两个 .NET PDF 库:

  • IronPDF
  • 葡萄城 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

开发解决方案需要安装 NuGet 包装 直接从菜单栏点击 "项目"。 此时会出现一个下拉列表。 选择 "管理 NuGet包 从下拉菜单中选择 将显示类似的窗口:

选择 "浏览 "选项卡,随后会出现如下窗口:

在搜索框中输入 "IronPDF",然后按 "Enter "键。 结果窗口就会出现:

选择 IronPdf:

如何通过 Ironpdfile 在 C# 中创建 PDF 文件

如何通过 Ironpdfile 在 C# 中创建 PDF 文件

选择 "安装 "按钮。 安装成功后,会出现相应的窗口:

按下 "确定 "按钮后,就可以开始了。

创建 PDF

添加命名空间 IronPdf 在文件顶部。

using IronPdf;
using IronPdf;
Imports IronPdf
VB   C#

实际工作从这里开始。 我们需要一个文件路径来存储生成的 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!");
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
VB   C#

SaveFileDialog 应该会打开一个文件对话框,允许您在要创建 PDF 文档的位置选择文件夹和文件名。 初始目录设置为 D 盘,但也可以选择设置为任何盘符。 由于我们只处理 PDF 文件,因此默认扩展名已设置为 PDF 文件。

在 "如果 "条件中,插入了创建 PDF 文件的实际代码。 现在我们可以看到,我们只用了两行代码就成功生成了 PDF 文件。 PdfText 是富文本框的名称,其中包含将写入 PDF 文档的文本。 文件名是通过 SaveFileDialog 方法选择的文件路径和名称。

阅读 PDF

您可能会认为读取 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
VB   C#

在函数内编写以下代码

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
VB   C#

这将从数据源提取所有信息到文档查看器。 所有报告组件都将使用该数据作为数据源。

GrapeCity PDF 功能

GrapeCity Documents 是一个跨平台文档管理系统,可为所有常见文档格式提供通用文档、编辑器和阅读器解决方案。 无需 Adobe Acrobat 等附加程序,.NET Standard 2.0 提供的丰富库就可用于读取、生成、更改和保存 PDF 文件。 它具有强大的功能集,可让开发人员创建包含高级字体支持、照片、图形、条形码、注释、大纲、印章、水印等内容的 PDF 文件。

操作 PDF

在 .NET Standard 应用程序中,您可以使用 GrapeCityPDF 制作具有基本或复杂业务需求的 PDF 文档。 此外,您还可以从任何来源加载、更改和保存 PDF 文件。

将 PDF 保存为图像

使用 GrapeCityPDF,您可以将 PDF 保存为图像,而不会影响图片质量。 此外,您只需使用几行代码即可实现这一功能。

PDF查看器

GrapeCity Documents PDF Viewer 是一款基于编程的轻量级客户端浏览器,用于查看 PDF 文件。 支持许多常见的 PDF 功能。

大量功能

GrapeCityPDF 库拥有众多功能,使您能够创建包含文本、图形、照片、注释、大纲等信息的复杂 PDF 文档。

安装

安装 GrapeCity 有两种方法。

  1. 选择 下载压缩源文件 按钮,下载当前的样本源文件。
  2. 直接从下载的压缩包中提取文件到计算机上的一个目录中。
  3. 导航至该目录。
  4. 执行run.cmd批处理文件。这将构建样本源。 启动 SupportApi 服务,在默认浏览器中打开 http://localhost:3003 URL。
  5. 更多信息,请参阅下载压缩包中的 readme.MD。

安装 WinForms 版本

下面的主题将讨论安装WinForms版的步骤。 以下步骤提供了安装 WinForms 版的说明:

  • 从以下网址下载 C1ControlPanel https://www.grapecity.com/componentone 安装最新版本的 WinForms。
  • 使用ComponentOneC1ControlPanel.exe打开控制面板。 必须关闭任何正在运行的 Visual Studio 实例。
  • 现有用户可使用注册的电子邮件地址和密码登录。
  • 如果您是新用户:
    • 在 Component One 注册并填写必填字段创建账户。
    • 验证信息将发送到您的电子邮件地址。
    • 访问验证链接激活您的电子邮件地址。
    • 如果您不想登录或注册,可以匿名用户身份登录。
  • 在 WinForms Edition 磁贴中,选择 安装。 选择所有版本复选框,即可安装所有版本。 选择查看更多按钮,了解有关该版本的更多信息。

    GrapeCity PDF 安装

  • 单击 "安装 "后,页面将显示 "许可协议",请您在单击 "接受许可协议 "**按钮前仔细阅读。
  • 接受许可协议后,随后会出现一个页面,上面有 "设置 "和 "目录路径更改 "按钮。 选择接受设置提示,以验证目录路径并开始安装过程。

    GrapeCity PDF 安装

  • 安装程序会安装控件,并显示安装进度。 显示此屏幕时,您将无法取消安装过程。
  • 控件安装完成后,将显示 "安装成功 "屏幕。 当前安装的版本将显示在相应的版本中。
  • 安装程序会安装控件,并显示安装进度。 显示此屏幕时,您将无法取消安装过程。

    GrapeCity PDF 安装

  • 控件安装完成后,将显示 "安装成功 "屏幕。 当前安装的版本将显示在相应的版本中。
    GrapeCity PDF 安装

创建 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);
        }
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
VB   C#

与 IronPDF 相比,GrapeCityPDF 的功能有限。

IronPDF 许可证模式和定价

30 天退款保证:一旦购买许可证,您将获得 30 天退款保证。 如果许可证不能很好地满足您的需求,IronPDF 将保证在 30 天内退款。

轻松集成:只需一行代码,即可将 IronPDF 与工作项目和您的环境无缝集成。 这可以在使用 NuGet 软件包方法集成时实现,也可以直接在线下载并集成到您的环境中。

永久许可:每个许可证只需购买一次,无需更新。

免费支持和产品更新:每个许可证都将获得产品团队直接提供的全方位支持,以及一年的免费产品更新。 在任何时候购买扩展都是可行的。 在购买之前,可以查看扩展部分。

立即许可证:收到付款后,立即发送注册许可证密钥。

所有许可证均为永久许可证,适用于暂存、开发和生产。

简易套餐

  • 1 开发人员
  • 1 个地点
  • 项目
  • 永久许可证

    该软件包允许企业中的单个软件开发人员在一个位置使用 Iron Software。 Iron Software 可用于单个内联网应用程序、网络应用程序或桌面软件程序。 禁止在组织或代理/客户关系之外共享许可证,因为许可证是不可转让的。 本许可类型与所有其他许可类型一样,明确排除本协议未明确授予的所有权利,不进行 OEM 再分发,也不在不购买额外保险的情况下将 Iron Software 作为 SaaS 使用。

    定价:起价为每年 $749。

专业许可证

  • 10 个开发人员
  • 10 个地点
  • 10 个项目
  • 永久许可证

    该许可证允许一个组织中预定数量的软件开发人员在多个地点使用 Iron Software,最多不超过 10 人。 Iron Software 可用于任意数量的网站、内联网应用程序或桌面软件应用程序。许可证不可转让,因此禁止在组织或代理/客户关系之外共享。本许可类型与所有其他许可类型一样,明确排除本协议未明确授予的所有权利,包括 OEM 再分发和在未购买额外保险的情况下将 Iron Software 作为 SaaS 使用。 该许可证可与单个项目集成,最多可集成 10 个项目。

    定价: 每年 999 美元起。

无限版许可

  • 无限开发者
  • 不限地点
  • 无限项目
  • 永久许可证

    这样,您就可以在一个组织中拥有不限数量的软件开发人员,在不限数量的地点使用 Iron Software。 Iron Software 可用于任意数量的内网应用程序、桌面软件应用程序或网站。许可证不得转让,也不得在组织或代理/客户关系之外共享。本许可类型与所有其他许可类型一样,明确排除本协议未授予的所有权利,包括 OEM 再分发和在未购买额外保险的情况下将 Iron Software 作为 SaaS 使用。

    定价: 每年 2999 美元起。

    免版税再分发: 允许您将 Iron Software 作为多种不同包装的商业产品的一部分进行分发。 (无需支付版税) 基于基本许可证所涵盖的项目数量。 这样,就可以在 SaaS 软件服务中部署 Iron Software,这是以基本许可证所涵盖的项目数量为基础的。

    定价: 每年 1599 美元起。

    GrapeCity PDF 安装

GrapeCity PDF 许可模式和定价

PDF 文件

  • 包括 1 个开发人员许可证
  • 1 分配地点

    该软件包包括一个开发人员许可证和一个分发位置,不提供支持和维护。

    定价: 每年 999 美元起。

PDF 无限文档

  • 包括 1 个开发人员许可证
  • 配送地点不受限制

    该软件包包含一个开发者许可,可无限版发布。 它不附带支持和维护。 GrapeCity 不支持 SaaS 和 OEM。

    定价: 每年 2799 美元起。

PDF Team Unlimited 的文件

  • 包括 5 个开发人员许可证
  • 配送地点不受限制

    该软件包包括五个开发人员许可,可无限版发布位置,无需支持和维护。 GrapeCity 不支持 SaaS 和 OEM。

    定价: 每年 5799 美元起。

    GrapeCity PDF 套装比较

    IronPDF Lite One-Developer软件包提供1年支持,价格约为 "liteLicense "美元。 而 GrapeCity Documents for PDF 包含一个开发人员包,价格为 999 美元,不含任何支持。 IronPDF 专业套餐包括10个开发人员套餐和一年的技术支持,售价为999美元。另一方面,GrapeCity 没有 10 开发人员套餐,只有 5 开发人员套餐,价格为 5799 美元。

IronPDF LiteProfessional套餐有 SaaS 服务或 OEM,还有 5 年支持选项。 一个开发人员的精简版软件包提供五年的支持、SaaS 和 OEM 服务,价格为 2897 美元。 虽然 GrapeCity 没有 SaaS、OEM 服务或 5 年支持选项。 Iron Professional 10 开发人员软件包包含 5 年支持、Saas 和 OEM 服务,价格为 3397 美元。 而 GrapeCity 没有任何 10 个开发人员软件包。

结论

GrapeCity Documents for PDF 允许开发人员导出/导入、创建 AcroForms (PDF表单)在许多桌面应用程序上运行 PDF 文件。 使用 GrapeCity 文档 PDF(GcPdf)这样,您就可以为客户提供完整的 PDF 解决方案。

我们强烈推荐 IronPDF,因为该产品具有更高的准确性。 执行类似功能的同类竞争产品也会遇到不准确的问题,例如无法转换某些图像,导致出现未知字符。 另一方面,IronPDF 可以提供准确的结果。

IronPDF 软件包提供有竞争力的许可和支持,无需持续成本。 IronPDF 的起价为 $749,套餐包含更多功能。 GrapeCity PDF 每年 1649 美元起。 IronPDF 还以单一价格支持多种平台!

如果您还不是 IronPDF 的客户,可以访问免费试用版查看所有可用功能。 如果购买全套 Iron Suite,就能以两件产品的价格获得全部五件产品。 有关以下方面的更多详情 授权请遵循以下步骤 链接 查看完整的软件包信息。

< 前一页
IronPDF和XFINIUM.PDF的比较
下一步 >
IronPDF与Textcontrol的对比

准备开始了吗? 版本: 2024.9 刚刚发布

免费NuGet下载 总下载量: 10,731,156 查看许可证 >