在实际环境中测试
在生产中测试无水印。
随时随地为您服务。
using IronPdf;
using IronPdf.Engines.Chrome;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Many rendering options to use to customize!
renderer.RenderingOptions.SetCustomPaperSizeInInches(12.5, 20);
renderer.RenderingOptions.PrintHtmlBackgrounds = true;
renderer.RenderingOptions.PaperOrientation = IronPdf.Rendering.PdfPaperOrientation.Landscape;
renderer.RenderingOptions.Title = "My PDF Document Name";
renderer.RenderingOptions.EnableJavaScript = true;
renderer.RenderingOptions.WaitFor.RenderDelay(50); // in milliseconds
renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
renderer.RenderingOptions.FitToPaperMode = FitToPaperModes.Zoom;
renderer.RenderingOptions.Zoom = 100;
renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
// Supports margin customization!
renderer.RenderingOptions.MarginTop = 40; //millimeters
renderer.RenderingOptions.MarginLeft = 20; //millimeters
renderer.RenderingOptions.MarginRight = 20; //millimeters
renderer.RenderingOptions.MarginBottom = 40; //millimeters
// Can set FirstPageNumber if you have a cover page
renderer.RenderingOptions.FirstPageNumber = 1; // use 2 if a cover page will be appended
// Settings have been set, we can render:
renderer.RenderHtmlFileAsPdf("assets/wikipedia.html").SaveAs("output/my-content.pdf");
IRON VB CONVERTER ERROR developers@ironsoftware.com
<p>IronPDF 旨在为开发者提供尽可能的灵活性。</p> <p>In this<a href="/blog/using-ironpdf/csharp-generate-pdf-tutorial/" target="_blank" rel="nofollow noopener noreferrer">C# PDF 生成教程示例</a>我们展示了在提供自动化内部功能的API和提供可控制的API之间的平衡。</p> <p>IronPDF支持生成PDF文件的多种自定义选项,包括:页面大小、页面边距、页眉/页脚内容、内容缩放、CSS规则集和JavaScript执行。</p> <hr class="separator"> <p>我们希望开发者能够控制 Chrome 如何将网页转换为 PDF。 "(《世界人权宣言》)<a href="/object-reference/api/IronPdf.ChromePdfRenderOptions.html" target="_blank" rel="nofollow noopener noreferrer">ChromePdfRenderer`类概述</a>这一切都有赖于我们的翻译团队。</p> <p><code>ChromePDFRenderOptions</code> 类中可用的设置示例包括边距、页眉、页脚、纸张大小和表单创建的设置。</p>
using IronPdf;
// Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from a HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Export to a file or Stream
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: Images, CSS and JavaScript.
// An optional BasePath 'C:\site\assets\' is set as the file location to load assets from
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 a HTML string using C#
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")
' Export to a file or Stream
pdf.SaveAs("output.pdf")
' Advanced Example with HTML Assets
' Load external html assets: Images, CSS and JavaScript.
' An optional BasePath 'C:\site\assets\' is set as the file location to load assets from
Dim myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
myAdvancedPdf.SaveAs("html-with-assets.pdf")
<p>使用 IronPDF,您可以在 .NET 项目中通过简单的 HTML 字符串创建新的 PDF 文档,而且 IronPDF 能够在 C#、F# 和 VB.NET 中使用。 由于使用了 "ChromePdfRenderer "类,您可以确保从 HTML 字符串渲染的任何 PDF 文档都将呈现出<a href="/how-to/pixel-perfect-html-to-pdf/" target="__blank">像素完美</a>. 借助 IronPDF 强大的<a href="/tutorials/html-to-pdf/" target="__blank">HTML 转换为 PDF</a>您可以根据自己的需要创建高质量的 PDF 文件。</p> <div class="examples__featured-snippet"> <h2>将 HTML 字符串转换为 PDF 的四个步骤</h2> <ol> <li>导入IronPDF库。</li> <li>初始化一个新的 <code>ChromePdfRenderer</code> 对象。</li> <li>使用 <code>ChromePdfRenderer.RenderHtmlAsPdf</code> 方法。</li> <li>使用保存 PDF <code>PdfDocument.SaveAs</code>.</li> </ol> </div> <p>请参见以下代码示例了解更多详情:</p> <pre class='naked-code'><code class="language-cs">using IronPdf; var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>"); var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\"); pdf.SaveAs("output.pdf");</code></pre> <div class="code-content code-content-inner"> <div class="code_window" > <div class="language-selection__content-page-wrapper"> </div> <div class="code_window_content"> <div class="code-window__action-buttons-wrapper code-window__action-buttons-wrapper--content-page"> <button title="点击复制" class=" code-window__action-button code-window__action-button--copy copy-clipboard " data-copy-text="点击复制" data-copied-text="已复制到剪贴板" data-clipboard-id="code-explorer" data-placement="bottom" > <i class="fa-kit fa-copy-example"></i> </button> <button title="全屏模式" class=" code-window__action-button code-window__action-button--full-screen js-full-screen-code-example-modal " > <i class="fas fa-expand"></i> </button> <button title="退出全屏" class=" code-window__action-button code-window__action-button--exit-full-screen js-exit-full-screen-code-example-modal " > <i class="fas fa-compress"></i> </button> </div> <pre class="prettyprint linenums lang-cs"><code>using IronPdf; var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>"); var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\"); pdf.SaveAs("output.pdf");</code></pre> <pre class="prettyprint linenums lang-vb"><code>Imports IronPdf Private renderer = New ChromePdfRenderer() Private pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>") Private myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\") pdf.SaveAs("output.pdf")</code></pre> </div> <div class="code_window_bottom"> <span class="language_selection"> <span class="ls-span">VB </span> <span> <label class="switch"> <input type="checkbox" checked="checked"> <span class="slider round"></span> </label> </span> <span class="ls-span">C#</span> </span> </div> </div> </div> <p>用 C# 将 HTML 字符串转换为 PDF 的第一步是确保在项目中正确设置并运行 IronPDF 库。 通过包括使用 IronPdf,我们要确保能从 IronPDF 库中访问所需的类,以进行 HTML 到 PDF 的转换。 翻译完成后,下一行 <code>Installation.EnableWebSecurity = true</code> 将用于禁止本地磁盘访问或跨源请求,确保安全操作。</p> <p>下一行将创建一个新的 ChromePdfRenderer 实例,处理 HTML 到 PDF 的转换。 在基本示例中,RenderHtmlAsPdf 方法用于转换一个简单的 HTML 字符串 `.("<h1>你好,世界</h1>")翻译成 PDF 文档,并使用 "SaveAs "方法保存到磁盘。</p> <p>在高级方法中,我们演示了 IronPdf 如何处理包含图片、CSS 和 JavaScript 等外部资产的 HTML 内容。 要加载这些资产,需要使用可选的 BasePath 参数,该参数指定了包含所需文件的目录。 生成的 PDF(包括外部资产)使用与基本示例中相同的 "SaveAs "方法保存。 该代码示例突出了 IronPDF 处理基本和复杂 HTML 内容的能力,使其成为以编程方式生成 PDF 的高效工具。 <a href="/how-to/html-string-to-pdf/" class="code_content__related-link__doc-cta-link">如需了解更多示例,请查看《IronPdf 与 C# 的使用指南》。</a></p>
using IronPdf;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from a URL or local file path
var pdf = renderer.RenderUrlAsPdf("https://ironpdf.com/");
// Export to a file or Stream
pdf.SaveAs("url.pdf");
Imports IronPdf
' Instantiate Renderer
Private renderer = New ChromePdfRenderer()
' Create a PDF from a URL or local file path
Private pdf = renderer.RenderUrlAsPdf("https://ironpdf.com/")
' Export to a file or Stream
pdf.SaveAs("url.pdf")
<p>IronPDF 可以将现有 URL 中的 HTML 直接呈现为 PDF 文档。 对 JavaScript、图像、表单和 CSS 的支持程度非常高。</p> <p>从接受查询字符串变量的 ASP.NET URL 渲染 PDF 可以促进 PDF 开发的顺利进行,是设计人员和编码人员之间的一项协作努力。</p> <hr /> <div class="examples__featured-snippet"> <h2>将URL转换为PDF的步骤在C#中</h2> <ol> <li>下载 <a href="/" target="_blank" rel="nofollow noopener noreferrer">IronPDF URL 到 PDF 转换库</a></li> <li>使用 NuGet 安装库以测试其功能</li> <li>使用 IronPDF for .NET 从接受查询字符串变量的 ASP.NET URL 渲染 PDF 文件</li> <li>使用 IronPDF 直接从 URL 创建 PDF 文档</li> <li>轻松查看和验证您的PDF输出文档。</li> </ol> </div>
using IronPdf;
private void Form1_Load(object sender, EventArgs e)
{
//Changes the ASPX output into a pdf instead of HTML
IronPdf.AspxToPdf.RenderThisPageAsPdf();
}
Imports IronPdf
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
'Changes the ASPX output into a pdf instead of HTML
IronPdf.AspxToPdf.RenderThisPageAsPdf()
End Sub
<p>使用IronPDF库,通过在<strong><code>Form_Load</code></strong>事件中添加一行代码,ASP.NET网页可以被渲染成PDF而不是HTML。</p> <p>此示例展示了IronPDF如何能够生成复杂的、数据驱动的PDF文件,这些文件首先以HTML的形式进行设计和测试,以简化流程。</p> <p>IronPDF 的<a href="/how-to/aspx-to-pdf/" target="_blank" rel="nofollow noopener noreferrer">ASPX 到 PDF 的转换</a>此功能允许您在ASPX页面中调用一个方法,它会返回一个PDF而不是HTML。</p> <p>您可以对 PDF 进行编码,使其既可以在浏览器中显示,也可以作为文件下载。</p>
using IronPdf;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from an existing HTML file using C#
var pdf = renderer.RenderHtmlFileAsPdf("example.html");
// Export to a file or Stream
pdf.SaveAs("output.pdf");
Imports IronPdf
' Instantiate Renderer
Private renderer = New ChromePdfRenderer()
' Create a PDF from an existing HTML file using C#
Private pdf = renderer.RenderHtmlFileAsPdf("example.html")
' Export to a file or Stream
pdf.SaveAs("output.pdf")
<p>IronPDF 是一个功能强大的 .NET 库,能够将 HTML 文件转换为高质量的 PDF 文件。 有了 IronPDF,您只需几行字就能将 HTML 文件渲染为 PDF,而且由于它支持现代网络标准,生成的 PDF 文件将达到完美的像素效果。 由于 IronPDF 使用了 <code>ChromePdfRenderer</code> 类,可以轻松处理 HTML 到 PDF 的转换,因此利用 IronPDF 强大的 HTML 文件到 PDF 的功能非常简单。</p> <div class="examples__featured-snippet"> <h2>使用 IronPDF 将 HTML 文件转换为 PDF 的步骤</h2> <ol> <li>安装 C# IronPDF 库,将 HTML 转换为 PDF</li> <li><code>使用 IronPdf;</code></li> <li><code>var renderer = new ChromePdfRenderer();</code></li> <li><code>var pdf = renderer.RenderHtmlFileAsPdf("example.html");</code></li> <li><code>pdf.SaveAs("output.pdf");</code></li> </ol> </div> <p>这段代码将创建一个从 HTML 文件渲染而来的新 PDF 文件。为此,我们必须首先确保 IronPDF 库已安装并通过 <code>using IronPdf</code> 行包含在项目中。接下来,初始化 ChromePdfRenderer 类,该类提供了将 HTML 内容渲染为 PDF 的功能,可确保在转换过程中不丢失 HTML 文件的原始质量。</p> <p>实例化呈现器后,您可以使用 <code>RenderHtmlAsPdf</code> 方法将现有 HTML 文件转换为 PDF。 在本例中,HTML 文件 "example.html "被传递给该方法,从而创建了一个 PDF 对象。 最后,要保存生成的 PDF,请使用 <code>SaveAs</code> 方法,指定所需的文件名和位置。 这个简单的过程可以让您在 C# 应用程序中轻松地从 HTML 文件生成 PDF。 <a href="/how-to/html-file-to-pdf/" class="code_content__related-link__doc-cta-link">点击此处查看操作指南,其中包括示例、示例代码和文件。</a></p>
using IronPdf;
var PdfOptions = new IronPdf.ChromePdfRenderOptions()
{
CreatePdfFormsFromHtml = true,
EnableJavaScript = false,
Title = "My ASPX Page Rendered as a PDF"
//.. many more options available
};
AspxToPdf.RenderThisPageAsPdf(AspxToPdf.FileBehavior.Attachment, "MyPdfFile.pdf", PdfOptions);
Imports IronPdf
Private PdfOptions = New IronPdf.ChromePdfRenderOptions() With {
.CreatePdfFormsFromHtml = True,
.EnableJavaScript = False,
.Title = "My ASPX Page Rendered as a PDF"
}
AspxToPdf.RenderThisPageAsPdf(AspxToPdf.FileBehavior.Attachment, "MyPdfFile.pdf", PdfOptions)
<p>此示例演示用户如何更改 PDF 打印选项以将表单转换为 HTML。</p> <p>IronPDF 的<a href="/how-to/aspx-to-pdf/" target="_blank" rel="nofollow noopener noreferrer">ASPX 到 PDF 转换指南</a>功能提供了多种选项,可从字符串或文件渲染HTML到PDF。</p> <p>两个特别重要的选项是:</p> <ul> <li>允许开发者在转换过程中指定HTML表单是否应渲染为交互式PDF表单。</li> <li>允许开发者指定PDF是应该“在浏览器中”显示,还是作为文件下载。</li> </ul>
using IronPdf;
using System.IO;
using System.Linq;
// One or more images as IEnumerable. This example selects all JPEG images in a specific 'assets' folder.
var imageFiles = Directory.EnumerateFiles("assets").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg"));
// Converts the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(imageFiles).SaveAs("composite.pdf");
// Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
Imports IronPdf
Imports System.IO
Imports System.Linq
' One or more images as IEnumerable. This example selects all JPEG images in a specific 'assets' folder.
Private imageFiles = Directory.EnumerateFiles("assets").Where(Function(f) f.EndsWith(".jpg") OrElse f.EndsWith(".jpeg"))
' Converts the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(imageFiles).SaveAs("composite.pdf")
' Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
<p>使用 "IronPdf.ImageToPdfConverter "类从一个或多个图像文件生成 PDF。</p> <h2 id="anchor-36-49c-36-49pdf">如何在C#中将图像转换为PDF</h2> <p>给定位于计算机上的<code>C:\images\example.png</code>的单个图像,我们可以通过使用其文件路径调用<code>IronPdf.ImageToPdfConverter.ImageToPdf</code>方法快速将其转换为PDF文档:</p> <pre class='naked-code'><code class="language-cs">IronPdf.ImageToPdfConverter.ImageToPdf(@"C:\images\example.png").SaveAs("example.pdf");</code></pre> <div class="code-content code-content-inner"> <div class="code_window" > <div class="language-selection__content-page-wrapper"> </div> <div class="code_window_content"> <div class="code-window__action-buttons-wrapper code-window__action-buttons-wrapper--content-page"> <button title="点击复制" class=" code-window__action-button code-window__action-button--copy copy-clipboard " data-copy-text="点击复制" data-copied-text="已复制到剪贴板" data-clipboard-id="code-explorer" data-placement="bottom" > <i class="fa-kit fa-copy-example"></i> </button> <button title="全屏模式" class=" code-window__action-button code-window__action-button--full-screen js-full-screen-code-example-modal " > <i class="fas fa-expand"></i> </button> <button title="退出全屏" class=" code-window__action-button code-window__action-button--exit-full-screen js-exit-full-screen-code-example-modal " > <i class="fas fa-compress"></i> </button> </div> <pre class="prettyprint linenums lang-cs"><code>IronPdf.ImageToPdfConverter.ImageToPdf(@"C:\images\example.png").SaveAs("example.pdf");</code></pre> <pre class="prettyprint linenums lang-vb"><code>IronPdf.ImageToPdfConverter.ImageToPdf("C:\images\example.png").SaveAs("example.pdf")</code></pre> </div> <div class="code_window_bottom"> <span class="language_selection"> <span class="ls-span">VB </span> <span> <label class="switch"> <input type="checkbox" checked="checked"> <span class="slider round"></span> </label> </span> <span class="ls-span">C#</span> </span> </div> </div> </div> <h2 id="anchor-36-49pdf36-49">将多个图片合并成一个PDF文件</h2> <p>我们还可以使用 <code>System.IO.Directory.EnumerateFiles</code> 和 <code>ImageToPdfConverter.ImageToPdf</code> 将多个图片批量转换为单一的PDF文档。</p> <pre class='naked-code'><code class="language-cs">string sourceDirectory = "D:\web\assets"; string destinationFile = "JpgToPDF.pdf"; var imageFiles = Directory.EnumerateFiles(sourceDirectory, "*.jpg"); ImageToPdfConverter.ImageToPdf(imageFiles).SaveAs(destinationFile);</code></pre> <div class="code-content code-content-inner"> <div class="code_window" > <div class="language-selection__content-page-wrapper"> </div> <div class="code_window_content"> <div class="code-window__action-buttons-wrapper code-window__action-buttons-wrapper--content-page"> <button title="点击复制" class=" code-window__action-button code-window__action-button--copy copy-clipboard " data-copy-text="点击复制" data-copied-text="已复制到剪贴板" data-clipboard-id="code-explorer" data-placement="bottom" > <i class="fa-kit fa-copy-example"></i> </button> <button title="全屏模式" class=" code-window__action-button code-window__action-button--full-screen js-full-screen-code-example-modal " > <i class="fas fa-expand"></i> </button> <button title="退出全屏" class=" code-window__action-button code-window__action-button--exit-full-screen js-exit-full-screen-code-example-modal " > <i class="fas fa-compress"></i> </button> </div> <pre class="prettyprint linenums lang-cs"><code>string sourceDirectory = "D:\web\assets"; string destinationFile = "JpgToPDF.pdf"; var imageFiles = Directory.EnumerateFiles(sourceDirectory, "*.jpg"); ImageToPdfConverter.ImageToPdf(imageFiles).SaveAs(destinationFile);</code></pre> <pre class="prettyprint linenums lang-vb"><code>Dim sourceDirectory As String = "D:\web" & ChrW(7) & "ssets" Dim destinationFile As String = "JpgToPDF.pdf" Dim imageFiles = Directory.EnumerateFiles(sourceDirectory, "*.jpg") ImageToPdfConverter.ImageToPdf(imageFiles).SaveAs(destinationFile)</code></pre> </div> <div class="code_window_bottom"> <span class="language_selection"> <span class="ls-span">VB </span> <span> <label class="switch"> <input type="checkbox" checked="checked"> <span class="slider round"></span> </label> </span> <span class="ls-span">C#</span> </span> </div> </div> </div> <p>了解更多<a href="/how-to/image-to-pdf/" target="_blank" rel="nofollow noopener noreferrer">使用 IronPDF 将图像转换为 PDF</a>以增强您的应用程序,或访问<a href="https://ironsoftware.com" target="__blank">Iron 软件网站</a>了解 Iron Software 提供的整个开发者工具套件,包括 IronBarcode、IronOCR 等。</p>
using IronPdf;
using System;
// Step 1. Creating a PDF with editable forms from HTML using form and input tags
// Radio Button and Checkbox can also be implemented with input type 'radio' and 'checkbox'
const string formHtml = @"
<html>
<body>
<h2>Editable PDF Form</h2>
<form>
First name: <br> <input type='text' name='firstname' value=''> <br>
Last name: <br> <input type='text' name='lastname' value=''> <br>
<br>
<p>Please specify your gender:</p>
<input type='radio' id='female' name='gender' value= 'Female'>
<label for='female'>Female</label> <br>
<br>
<input type='radio' id='male' name='gender' value='Male'>
<label for='male'>Male</label> <br>
<br>
<input type='radio' id='non-binary/other' name='gender' value='Non-Binary / Other'>
<label for='non-binary/other'>Non-Binary / Other</label>
<br>
<p>Please select all medical conditions that apply:</p>
<input type='checkbox' id='condition1' name='Hypertension' value='Hypertension'>
<label for='condition1'> Hypertension</label><br>
<input type='checkbox' id='condition2' name='Heart Disease' value='Heart Disease'>
<label for='condition2'> Heart Disease</label><br>
<input type='checkbox' id='condition3' name='Stoke' value='Stoke'>
<label for='condition3'> Stoke</label><br>
<input type='checkbox' id='condition4' name='Diabetes' value='Diabetes'>
<label for='condition4'> Diabetes</label><br>
<input type='checkbox' id='condition5' name='Kidney Disease' value='Kidney Disease'>
<label for='condition5'> Kidney Disease</label><br>
</form>
</body>
</html>";
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
renderer.RenderHtmlAsPdf(formHtml).SaveAs("BasicForm.pdf");
// Step 2. Reading and Writing PDF form values.
var FormDocument = PdfDocument.FromFile("BasicForm.pdf");
// Set and Read the value of the "firstname" field
var FirstNameField = FormDocument.Form.FindFormField("firstname");
FirstNameField.Value = "Minnie";
Console.WriteLine("FirstNameField value: {0}", FirstNameField.Value);
// Set and Read the value of the "lastname" field
var LastNameField = FormDocument.Form.FindFormField("lastname");
LastNameField.Value = "Mouse";
Console.WriteLine("LastNameField value: {0}", LastNameField.Value);
FormDocument.SaveAs("FilledForm.pdf");
Imports IronPdf
Imports System
' Step 1. Creating a PDF with editable forms from HTML using form and input tags
' Radio Button and Checkbox can also be implemented with input type 'radio' and 'checkbox'
Private Const formHtml As String = "
<html>
<body>
<h2>Editable PDF Form</h2>
<form>
First name: <br> <input type='text' name='firstname' value=''> <br>
Last name: <br> <input type='text' name='lastname' value=''> <br>
<br>
<p>Please specify your gender:</p>
<input type='radio' id='female' name='gender' value= 'Female'>
<label for='female'>Female</label> <br>
<br>
<input type='radio' id='male' name='gender' value='Male'>
<label for='male'>Male</label> <br>
<br>
<input type='radio' id='non-binary/other' name='gender' value='Non-Binary / Other'>
<label for='non-binary/other'>Non-Binary / Other</label>
<br>
<p>Please select all medical conditions that apply:</p>
<input type='checkbox' id='condition1' name='Hypertension' value='Hypertension'>
<label for='condition1'> Hypertension</label><br>
<input type='checkbox' id='condition2' name='Heart Disease' value='Heart Disease'>
<label for='condition2'> Heart Disease</label><br>
<input type='checkbox' id='condition3' name='Stoke' value='Stoke'>
<label for='condition3'> Stoke</label><br>
<input type='checkbox' id='condition4' name='Diabetes' value='Diabetes'>
<label for='condition4'> Diabetes</label><br>
<input type='checkbox' id='condition5' name='Kidney Disease' value='Kidney Disease'>
<label for='condition5'> Kidney Disease</label><br>
</form>
</body>
</html>"
' Instantiate Renderer
Private renderer = New ChromePdfRenderer()
renderer.RenderingOptions.CreatePdfFormsFromHtml = True
renderer.RenderHtmlAsPdf(formHtml).SaveAs("BasicForm.pdf")
' Step 2. Reading and Writing PDF form values.
Dim FormDocument = PdfDocument.FromFile("BasicForm.pdf")
' Set and Read the value of the "firstname" field
Dim FirstNameField = FormDocument.Form.FindFormField("firstname")
FirstNameField.Value = "Minnie"
Console.WriteLine("FirstNameField value: {0}", FirstNameField.Value)
' Set and Read the value of the "lastname" field
Dim LastNameField = FormDocument.Form.FindFormField("lastname")
LastNameField.Value = "Mouse"
Console.WriteLine("LastNameField value: {0}", LastNameField.Value)
FormDocument.SaveAs("FilledForm.pdf")
<div class="alert alert-info iron-variant-1" role="alert"> 您的企业在PDF安全性和合规性的年度订阅上花费过多。 考虑 <a href="https://ironsoftware.com/enterprise/securedoc/">PDF 安全综合解决方案 IronSecureDoc</a>,提供了管理SaaS服务的解决方案,如数字签名、编辑、加密和保护,且仅需一次性付款。 <a href="https://ironsoftware.com/enterprise/securedoc/docs/">探索 IronSecureDoc 文档</a> </div> <p>您可以像编辑普通文档一样轻松地使用IronPDF创建可编辑的PDF文档。 <code>PdfForm</code> 类是 PDF 文档中可由用户编辑的表单字段的集合。 它可以被实现到您的PDF渲染中,使其成为一个表格或可编辑的文档。</p> <p>此示例向您展示如何在IronPDF中创建可编辑的PDF表单。</p> <p>PDF带可编辑表单的文件可以通过添加<code><form></code>, <code><input>和</code><textarea>将`标签添加到文档部分。</p> <p><code>PdfDocument.Form.FindFormField</code> 可以用于读取和写入任何表单字段的值。 字段名称将与HTML中该字段的'name'属性相同。</p> <p><code>PdfDocument.Form</code> 对象可以有两种使用方式。</p> <ul> <li>首先是填充表单字段的默认值,必须在Adobe Reader中聚焦以显示此值。</li> <li>第二个功能是读取用户用任何语言填写的PDF表单中的数据。</li> </ul>
using IronPdf;
using IronSoftware.Drawing;
var pdf = PdfDocument.FromFile("Example.pdf");
// Extract all pages to a folder as image files
pdf.RasterizeToImageFiles(@"C:\image\folder\*.png");
// Dimensions and page ranges may be specified
pdf.RasterizeToImageFiles(@"C:\image\folder\example_pdf_image_*.jpg", 100, 80);
// Extract all pages as AnyBitmap objects
AnyBitmap[] pdfBitmaps = pdf.ToBitmap();
Imports IronPdf
Imports IronSoftware.Drawing
Private pdf = PdfDocument.FromFile("Example.pdf")
' Extract all pages to a folder as image files
pdf.RasterizeToImageFiles("C:\image\folder\*.png")
' Dimensions and page ranges may be specified
pdf.RasterizeToImageFiles("C:\image\folder\example_pdf_image_*.jpg", 100, 80)
' Extract all pages as AnyBitmap objects
Dim pdfBitmaps() As AnyBitmap = pdf.ToBitmap()
<p>使用IronPDF将PDF转换为您喜欢的文件类型、图像尺寸和DPI质量的图像。</p> <p>要将 PDF 文档转换为图像,请在 <code>PdfDocument</code> 对象上调用 IronPDF 的 <code>RasterizeToImageFiles</code> 方法。 可以使用 <code>PdfDocument.FromFile</code> 方法或其他可用方法加载 PDF 文档。<a href="/tutorials/dotnet-core-pdf-generating/" target="_blank" rel="nofollow noopener noreferrer">.NET Core 的 PDF 生成方法</a>.</p> <hr /> <p><div class="main-article__video-wrapper js-article-video-modal-wrapper"><iframe class="" loading="lazy" src="https://www.youtube.com/embed/1MdE_nGu0UM?start=0" title="YouTube Video Player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></div></p> <hr /> <p>RasterizeToImageFiles "可将 PDF 的每一页渲染为光栅化图像。 第一个参数指定了每个图像使用的命名模式。 可选参数可用于自定义每个图像的质量和尺寸。 另一种方法是将 PDF 中选定的页面转换为图像。</p> <p>示例代码的第24行演示了 <code>ToBitMap</code> 方法。 调用此方法可以在任何 <code>PdfDocument</code> 对象上快速将 PDF 转换为可以保存到文件或根据需要进行操作的 <code>AnyBitmap</code> 对象。</p> <hr /> <div class="hsg-featured-snippet"> <h2>如何用 C# 将 PDF 转换为图像</h2> <ol> <li><a class="js-modal-open" data-modal-id="trial-license-after-download" href="https://nuget.org/packages/IronPdf/" target="_blank" rel="nofollow noopener noreferrer">安装 PDF 转图像 C# 库</a></li> <li>导入现有 PDF 文件 <code>发件人文件</code> 方法</li> <li>使用以下工具将 PDF 转换为图像 <code>光栅化为图像文件</code> 方法</li> <li>指定保存目录和图像大小</li> <li>检查输出图像</li> </ol> </div>
using IronPdf;
using IronPdf.Signing;
// Step 1. Create a PDF
var renderer = new ChromePdfRenderer();
var doc = renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital security</h1>");
// Step 2. Create a Signature.
// You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader.
// Read: https://helpx.adobe.com/acrobat/using/digital-ids.html
var signature = new IronPdf.Signing.PdfSignature("Iron.pfx", "123456")
{
// Step 3. Optional signing options and a handwritten signature graphic
SigningContact = "support@ironsoftware.com",
SigningLocation = "Chicago, USA",
SigningReason = "To show how to sign a PDF"
};
//Step 3. Sign the PDF with the PdfSignature. Multiple signing certificates may be used
doc.Sign(signature);
//Step 4. The PDF is not signed until saved to file, steam or byte array.
doc.SaveAs("signed.pdf");
Imports IronPdf
Imports IronPdf.Signing
' Step 1. Create a PDF
Private renderer = New ChromePdfRenderer()
Private doc = renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital security</h1>")
' Step 2. Create a Signature.
' You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader.
' Read: https://helpx.adobe.com/acrobat/using/digital-ids.html
Private signature = New IronPdf.Signing.PdfSignature("Iron.pfx", "123456") With {
.SigningContact = "support@ironsoftware.com",
.SigningLocation = "Chicago, USA",
.SigningReason = "To show how to sign a PDF"
}
'Step 3. Sign the PDF with the PdfSignature. Multiple signing certificates may be used
doc.Sign(signature)
'Step 4. The PDF is not signed until saved to file, steam or byte array.
doc.SaveAs("signed.pdf")
<div class="alert alert-info iron-variant-1" role="alert"> 您的企业在PDF安全性和合规性的年度订阅上花费过多。 考虑 <a href="https://ironsoftware.com/enterprise/securedoc/">IronSecureDoc</a>,提供了管理SaaS服务的解决方案,如数字签名、编辑、加密和保护,且仅需一次性付款。 <a href="https://ironsoftware.com/enterprise/securedoc/docs/">探索 IronSecureDoc 文档</a>. </div> <p>IronPDF 支持使用 .pfx 和 .p12 X509Certificate2 数字证书对新的或现有的 PDF 文件进行数字签名。</p> <p>PDF 一经签署,在证书失效的情况下不得修改。 这确保了保真度。</p> <p>要使用 Adobe Reader 免费生成签名证书,请阅读<a href="https://helpx.adobe.com/acrobat/using/digital-ids.html" target="_blank" rel="nofollow noopener noreferrer">Adobe 数字 ID 指南</a>.</p> <p>除加密签名外,还可使用 IronPDF 手写签名图像或公司印章图像进行签名。</p> <p>您可以从以下链接下载演示使用 IronPDF 进行 PDF 数字签名的示例项目<a href="https://ironpdf.com/downloads/digitally-sign-pdf.zip" target="_blank" rel="nofollow noopener noreferrer">IronPDF 数字签名 PDF 示例项目</a>.</p>
using IronPdf;
using System.Collections.Generic;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Join Multiple Existing PDFs into a single document
var pdfs = new List<PdfDocument>();
pdfs.Add(PdfDocument.FromFile("A.pdf"));
pdfs.Add(PdfDocument.FromFile("B.pdf"));
pdfs.Add(PdfDocument.FromFile("C.pdf"));
var pdf = PdfDocument.Merge(pdfs);
pdf.SaveAs("merged.pdf");
// Add a cover page
pdf.PrependPdf(renderer.RenderHtmlAsPdf("<h1>Cover Page</h1><hr>"));
// Remove the last page from the PDF and save again
pdf.RemovePage(pdf.PageCount - 1);
pdf.SaveAs("merged.pdf");
// Copy pages 5-7 and save them as a new document.
pdf.CopyPages(4, 6).SaveAs("excerpt.pdf");
foreach (var eachPdf in pdfs)
{
eachPdf.Dispose();
}
Imports IronPdf
Imports System.Collections.Generic
' Instantiate Renderer
Private renderer = New ChromePdfRenderer()
' Join Multiple Existing PDFs into a single document
Private pdfs = New List(Of PdfDocument)()
pdfs.Add(PdfDocument.FromFile("A.pdf"))
pdfs.Add(PdfDocument.FromFile("B.pdf"))
pdfs.Add(PdfDocument.FromFile("C.pdf"))
Dim pdf = PdfDocument.Merge(pdfs)
pdf.SaveAs("merged.pdf")
' Add a cover page
pdf.PrependPdf(renderer.RenderHtmlAsPdf("<h1>Cover Page</h1><hr>"))
' Remove the last page from the PDF and save again
pdf.RemovePage(pdf.PageCount - 1)
pdf.SaveAs("merged.pdf")
' Copy pages 5-7 and save them as a new document.
pdf.CopyPages(4, 6).SaveAs("excerpt.pdf")
For Each eachPdf In pdfs
eachPdf.Dispose()
Next eachPdf
<p>IronPDF 提供<a href="/features/" target="_blank" rel="nofollow noopener noreferrer">50 多项功能</a>用于阅读和编辑PDFs。 最受欢迎的是<a href="/how-to/merge-or-split-pdfs/" target="_blank" rel="nofollow noopener noreferrer">合并 PDF</a>, <a href="/examples/copy-pdf-page-to-another-pdf-file/" target="_blank" rel="nofollow noopener noreferrer">克隆页面</a>和<a href="/how-to/rotating-text/" target="_blank" rel="nofollow noopener noreferrer">从旋转内容中提取文本</a>.</p> <p>IronPDF 还允许用户在生成和格式化 PDF 文件时添加水印、旋转页面、添加注释、对 PDF 页面进行数字签名、创建新的 PDF 文档、附加封面页、自定义 PDF 大小等。 此外,它支持将PDF转换为所有常规图像文件类型,包括JPG、BMP、JPEG、GIF、PNG、TIFF等。</p> <p>读取<a href="/tutorials/csharp-edit-pdf-complete-tutorial/" target="_blank" rel="nofollow noopener noreferrer">C# PDF 编辑教程</a>了解如何充分利用IronPDF来修改PDF文档,以最适合项目要求。</p> <hr /> <div class="hsg-featured-snippet"> <h2>如何用 C# 编辑 PDF 文件</h2> <ol> <li><a class="js-modal-open" data-modal-id="trial-license-after-download" href="https://nuget.org/packages/IronPdf/" target="_blank" rel="nofollow noopener noreferrer">安装可编辑 PDF 文件的 C# 库</a></li> <li>利用 "FromFile "方法导入多个 PDF 文件</li> <li>使用 C# 中的直观 API 访问和修改 PDF 文件</li> <li>使用 C# 将更新版本保存为新的 PDF 文件</li> <li>查看新编辑的 PDF 文档</li> </ol> </div>
using IronPdf;
// Open an Encrypted File, alternatively create a new PDF from Html
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
// Get file metadata
System.Collections.Generic.List<string> metadatakeys = pdf.MetaData.Keys(); // returns {"Title", "Creator", ...}
// Remove file metadata
pdf.MetaData.RemoveMetaDataKey("Title");
metadatakeys = pdf.MetaData.Keys(); // return {"Creator", ...} // title was deleted
// Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = System.DateTime.Now;
// 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.SecuritySettings.OwnerPassword = "top-secret"; // password to edit the pdf
pdf.SecuritySettings.UserPassword = "sharable"; // password to open the pdf
pdf.SaveAs("secured.pdf");
Imports System
Imports IronPdf
' Open an Encrypted File, alternatively create a new PDF from Html
Private pdf = PdfDocument.FromFile("encrypted.pdf", "password")
' Get file metadata
Private metadatakeys As System.Collections.Generic.List(Of String) = pdf.MetaData.Keys() ' returns {"Title", "Creator", ...}
' Remove file metadata
pdf.MetaData.RemoveMetaDataKey("Title")
metadatakeys = pdf.MetaData.Keys() ' return {"Creator", ...} // title was deleted
' Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto"
pdf.MetaData.Keywords = "SEO, Friendly"
pdf.MetaData.ModifiedDate = DateTime.Now
' 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.SecuritySettings.OwnerPassword = "top-secret" ' password to edit the pdf
pdf.SecuritySettings.UserPassword = "sharable" ' password to open the pdf
pdf.SaveAs("secured.pdf")
<p>IronPDF 为开发人员提供了强大的 PDF 安全选项,支持自定义和设置 PDF 元数据、密码、权限等。 利用 IronPDF 的密码、安全性和元数据选项,您可以创建自定义权限和安全级别,以适应 PDF 文档的需要。 要做到这一点,就必须使用 "SecuritySettings "和 "MetaData "等类。 一些选项包括将 PDF 文档限制为不可打印、设置为只读、128 位加密以及 PDF 文档的密码保护。</p> <p>设置自定义元数据的方法是实现 MetaData 类以访问各种 PDF 元数据选项,并使用自定义值对其进行设置。 这包括更改作者、关键词、修改数据等。 设置自定义安全设置包括设置自定义用户和所有者密码、打印权限、只读模式等功能。</p> <div class="examples__featured-snippet"> <h2>设置 PDF 密码、元数据和安全性的 5 个步骤</h2> <ol> <li><code>var pdf = PdfDocument.FromFile("encrypted.pdf", "password");</code></li> <li><code>System.Collections.Generic.List<string> metadatakeys = pdf.MetaData.Keys();</code></li> <li><code>var metadatakeys = pdf.MetaData.Keys();</code></li> <li><code>pdf.MetaData.Author = "Satoshi Nakamoto";</code></li> <li><code>pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key");</code></li> </ol> </div> <p>要开始定制 PDF 文档的安全性,您必须首先加载一个现有的 PDF 或创建一个新的 PDF。 在这里,我们加载了一个现有的受密码保护的 PDF 文档,并输入了打开 PDF 文档所需的密码。 加载 PDF 后,我们使用 <code>pdf.MetaData.Keys();</code>获取 PDF 的当前元数据。 要移除现有的 PDF 元数据值,请使用 <code>RemoveMetaDataKey</code> 方法。 要开始设置新的元数据值,请使用 pdf.MetaData.metadatafield(例如:"pdf.MetaData.Keywords)在翻译过程中,您可以使用".NET"、"Java"、"Python "或 "Node.js",然后将新值赋给它。 标题和关键词等元数据字段使用字符串值,而修改数据字段使用日期值。</p> <p>接下来,我们使用 SecuritySettings 类设置新的安全设置。 如您所见,您可以在这里进行多种设置。 这样,您就可以完全控制每个 PDF 文档的权限和安全级别。 要访问这些设置,您只需确保使用了 <code>pdf.SecuritySettings</code>,然后再使用您要调整的设置。例如,"MakePdfDocumentReadOnly "属性将 PDF 文档设置为只读,并对内容进行 128 位加密。 SecuritySettings 的其他选项包括</p> <ul> <li><strong>AllowUserAnnotations:</strong> 控制用户是否可以对 PDF 进行注释。</li> <li><strong>允许用户打印:</strong> 控制文档的打印权限。</li> <li><strong>AllowUserFormData:</strong> 设置用户是否可以填写表格的权限。</li> <li><strong>OwnerPassword:</strong> 设置 PDF 的所有者密码,用于禁用或启用其他安全设置</li> <li> <p><strong>用户密码:</strong> 设置 PDF 的用户密码,必须输入该密码才能打开或打印文档。</p> <p>为 PDF 文档设置自定义元数据、密码和安全设置后,使用 <code>pdf.SaveAs</code> 方法将 PDF 保存到指定位置。 <a href="/how-to/metadata/" class="code_content__related-link__doc-cta-link">点击此处查看操作指南,包括示例、示例代码和文件。</a></p> </li> </ul>
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")
<p>IronPDF 提供用 HTML 给 PDF 文档 "加水印 "的方法。</p> <p>使用 <code>ApplyStamp</code> 方法,开发人员可以向 PDF 文件添加基于 HTML 的水印。如上例所示,水印的 HTML 代码作为方法的第一个参数。 <code>ApplyStamp</code> 的额外参数用于控制水印的旋转、透明度和位置。</p> <p>使用 <code>ApplyStamp</code> 方法代替 <code>ApplyWatermark</code> 方法以获得更精细的水印放置控制。 例如,使用 <code>ApplyStamp</code> 来:</p> <ul> <li>将文本、图片或HTML水印添加到PDFs</li> <li>将相同的水印应用到PDF的每一页上。</li> <li>将不同的水印应用于特定的PDF页面</li> <li>调整水印在页面副本前后的位置</li> <li> <p>更精确地调整水印的不透明度、旋转和对齐方式</p> <hr /> <div class="hsg-featured-snippet"> <h2>如何用 C# 在 PDF 文件中添加水印</h2> <ol> <li><a class="js-modal-open" data-modal-id="trial-license-after-download" href="https://nuget.org/packages/IronPdf/" target="_blank" rel="nofollow noopener noreferrer">从 NuGet 下载并安装 IronPDF 库。</a></li> <li>创建一个新的 <code>PdfDocument</code> 或使用现有的 <code>PdfDocument</code> 锉刀</li> <li>致电 <code>应用水印</code> 方法为 PDF 添加水印。</li> <li>通过调用 <code>保存为</code>.</li> </ol> </div> </li> </ul>
using IronPdf;
// With IronPDF, we can easily merge 2 PDF files using one as a background or foreground
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
pdf.AddBackgroundPdf(@"MyBackground.pdf");
pdf.AddForegroundOverlayPdfToPage(0, @"MyForeground.pdf", 0);
pdf.SaveAs(@"C:\Path\To\Complete.pdf");
Imports IronPdf
' With IronPDF, we can easily merge 2 PDF files using one as a background or foreground
Private renderer = New ChromePdfRenderer()
Private pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
pdf.AddBackgroundPdf("MyBackground.pdf")
pdf.AddForegroundOverlayPdfToPage(0, "MyForeground.pdf", 0)
pdf.SaveAs("C:\Path\To\Complete.pdf")
<p>在使用IronPDF创建和渲染PDF文档时,您可能想要使用特定的背景和前景。 在这种情况下,您可以使用现有的或已渲染的PDF作为另一个PDF文档的背景或前景。 这对于设计一致性和模板化特别有用。</p> <p>此示例向您展示如何将一个PDF文档用作另一个PDF文档的背景或前景。</p> <p>您可以通过将多页 PDF 加载或创建为 <code>IronPdf.PdfDocument</code> 对象,在 C# 中实现这一操作。</p> <p>您可以使用 <code>PdfDocument.AddBackgroundPdf</code> 添加背景。 有关背景插入方法的详细信息,请参阅<a href="/object-reference/api/IronPdf.PdfDocument.html#IronPdf_PdfDocument_AddBackgroundPdf_IronPdf_PdfDocument_System_Int32_" target="_blank" rel="nofollow noopener noreferrer">IronPDF.PdfDocument 背景文档</a>; 译文介绍了几种背景插入方法及其重载。 这会为您工作中的PDF的每一页添加背景。 该背景是从另一个PDF文档的页面复制的。</p> <p>您可以使用 <code>PdfDocument.AddForegroundOverlayPdfToPage</code> 添加前景,也称为“覆盖”。 有关前台插入方法的详细信息,请查阅<a href="/object-reference/api/IronPdf.PdfDocument.html" target="_blank" rel="nofollow noopener noreferrer">IronPDF.PdfDocument 覆盖文档</a>.</p>
IronPDF使用.NET Chromium引擎将HTML页面渲染成PDF文件。无需使用复杂的API来定位或设计PDF: IronPDF支持标准的网页文档HTML、ASPX、JS、CSS和图像。
阅读操作指南教程IronPDF允许您自动读取PDF中的内容,以便注入到您的C#和.NET应用程序和数据存储解决方案中。将遗留PDF文档存储中的内容导入、迁移和索引到您的文档管理和业务流程应用程序中。
阅读API参考文档从合并、拆分到编辑PDF,运用您的开发技能在合适的时间输出完全正确的PDF。IronPDF将不断增长的功能集合直接交到您手中,集成在您的C# / VB.NET项目中。
清晰的文档将IronPDF指向您现有的HTML、ASPX表单、MVC视图和图像文件,以直接转换为PDF。这利用了您现有的资产和网页,以PDF格式呈现您的数据。
对于ASP.NET, C#, VB, 模型-视图-控制器 (MVC), ASPX, .NET, .NET Core
在5分钟内实现Hello-WorldIronPDF 使您能够快速掌握 PDF 生成和操作工具,并且提供完全的智能感知支持和 Visual Studio 安装程序。无论是通过 Visual Studio 从 NuGet 直接安装,还是下载 DLL,您都可以立即设置。只需一个 DLL,无需任何依赖。
PM > Install-Package IronPdf 下载DLLC# PDF ASP.NET ASPX
C# PDF HTML
对于许多人来说,这是从 .NET 生成 PDF 文件的最有效方法,因为没有额外的 API 需要学习,也没有复杂的设计系统需要导航…
查看Jean的HTML转换为PDF示例VB PDF ASP.NET
学习如何在 VB.NET 应用程序和网站中创建和编辑 PDF 文档。免费教程及代码示例……
查看Veronica的VB.NET PDF教程Iron的团队在.NET软件组件市场拥有超过10年的经验。