IRONSOFTWAREHOME
在 PDF 文件之间复制页面
using IronPdf;

var html_a = @"<p> [PDF_A] </p>
        <p> [PDF_A] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_A] 2nd Page</p>";

var html_b = @"<p> [PDF_B] </p>
        <p> [PDF_B] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_B] 2nd Page</p>";

var renderer = new ChromePdfRenderer();

// Create our main document
var pdfdoc_a = renderer.RenderHtmlAsPdf(html_a);


// Create and select a page to copy
var pdfdoc_b = renderer.RenderHtmlAsPdf(html_b);
var page_to_insert = pdfdoc_b.CopyPage(1);

// 3 ways to insert:

pdfdoc_a.AppendPdf(page_to_insert); // at the end
                                    // or
pdfdoc_a.PrependPdf(page_to_insert); // at the start
                                     // or
pdfdoc_a.InsertPdf(page_to_insert, 1); // in the middle

pdfdoc_a.SaveAs("CopiedPages.pdf");
Imports IronPdf

Dim html_a = "<p> [PDF_A] </p>
        <p> [PDF_A] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_A] 2nd Page</p>"

Dim html_b = "<p> [PDF_B] </p>
        <p> [PDF_B] 1st Page </p>
        <div style = 'page-break-after: always;' ></div>
        <p> [PDF_B] 2nd Page</p>"

Dim renderer = New ChromePdfRenderer()

' Create our main document
Dim pdfdoc_a = renderer.RenderHtmlAsPdf(html_a)

' Create and select a page to copy
Dim pdfdoc_b = renderer.RenderHtmlAsPdf(html_b)
Dim page_to_insert = pdfdoc_b.CopyPage(1)

' 3 ways to insert:

pdfdoc_a.AppendPdf(page_to_insert) ' at the end
                                   ' or
pdfdoc_a.PrependPdf(page_to_insert) ' at the start
                                    ' or
pdfdoc_a.InsertPdf(page_to_insert, 1) ' in the middle

pdfdoc_a.SaveAs("CopiedPages.pdf")
NuGet Download
PM > Install-Package IronPdf
在 PDF 文件之间复制页面

在 PDF 文件之间复制页面

通过利用IronPDF在PDF文件之间复制页面,轻松调整您的PDF文档结构以最佳适应您的需求。 现在,您可以轻松地复制特定的PDF页面,并将其插入、前置或附加到另一个PDF文档。 这使您可以完全控制页面的位置及PDF文档的外观。

了解如何使用 IronPDF 添加、复制或删除 PDF 页面
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 21,105,021版本:2026.9刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥。

Your trial license will be sent to your email address

无任何限制。100% 解锁。无需信用卡。

OR
bullet_checked无需信用卡或创建账户无任何限制。100% 解锁。无需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
预约您的免费现场演示
Booking Badge

深受全球数百万工程师信赖

Iron Software 的客户徽标
获取您的无义务咨询
填写下面的表格或通过sales@ironsoftware.com
您的资料将始终保密。
深受全球数百万工程师信赖
Iron Software 的客户徽标
立即获取您的免费30 天试用密钥。
无需信用卡或创建账户
C# 用于 PDF 的 NuGet 库
通过 NuGet 安装

版本: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. 在解决方案资源管理器中,右键点击引用,管理 NuGet 包
  2. 选择浏览并搜索 “IronPDF”
  3. 选择包并安装
C# PDF DLL
下载 DLL

版本: 2026.9

或在此处下载 Windows 安装程序。

  1. 下载并解压 IronPDF 到您的解决方案目录中的 ~/Libs 之类的位置
  2. 在 Visual Studio 解决方案资源管理器中,右键点击引用。选择浏览,“IronPDF.dll”

$999 起