组织 PDF
在几秒钟内组织 PDF 文档中的页面和书签。
完全掌控 PDF 的结构
1
添加、复制和删除页面
通过根据需要添加、复制或删除页面来管理您的 PDF 的结构。此功能允许轻松地组织和重新排列内容。
了解如何:管理 PDF 页面using IronPdf;
// Import cover page
PdfDocument coverPage = PdfDocument.FromFile("coverPage.pdf");
// Import content document
PdfDocument contentPage = PdfDocument.FromFile("contentPage.pdf");
// Insert PDF
contentPage.InsertPdf(coverPage, 0);
contentPage.SaveAs("report_final.pdf");
// Copy a single page into a new PDF object
PdfDocument myReport = PdfDocument.FromFile("report_final.pdf");
PdfDocument copyOfPageOne = myReport.CopyPage(0);Imports IronPdf
' Import cover page
Dim coverPage As PdfDocument = PdfDocument.FromFile("coverPage.pdf")
' Import content document
Dim contentPage As PdfDocument = PdfDocument.FromFile("contentPage.pdf")
' Insert PDF
contentPage.InsertPdf(coverPage, 0)
contentPage.SaveAs("report_final.pdf")
' Copy a single page into a new PDF object
Dim myReport As PdfDocument = PdfDocument.FromFile("report_final.pdf")
Dim copyOfPageOne As PdfDocument = myReport.CopyPage(0)2
合并和拆分 PDF
将多个 PDF 组合成一个文档或将大型 PDF 拆分成较小的部分,使您的文档更易于管理和分发。
了解如何:合并和拆分 PDFusing IronPdf;
// Import two pdfs
PdfDocument pdf_A = PdfDocument.FromFile("merge_docA.pdf");
PdfDocument pdf_B = PdfDocument.FromFile("merge_docB.pdf");
// Merge the two pdfs A and B
var merged = PdfDocument.Merge(pdf_A, pdf_B);
merged.SaveAs("Merged.pdf");Imports IronPdf
' Import two pdfs
Dim pdf_A As PdfDocument = PdfDocument.FromFile("merge_docA.pdf")
Dim pdf_B As PdfDocument = PdfDocument.FromFile("merge_docB.pdf")
' Merge the two pdfs A and B
Dim merged = PdfDocument.Merge(pdf_A, pdf_B)
merged.SaveAs("Merged.pdf")
补充组织工具
1
书签和大纲
在您的 PDF 中创建书签和大纲,以增强导航性,并为读者提供一种直观的方式来定位关键部分。
了解如何:创建书签和大纲using IronPdf;
// Create a new PDF or edit an existing document.
PdfDocument pdf = PdfDocument.FromFile("existing.pdf");
// Add a bookmark
var mainBookmarks = pdf.Bookmarks.AddBookMarkAtEnd("NameOfBookmark", 0);
//Add a sub-bookmark
var subBookmarks = mainBookmarks.Children.AddBookMarkAtEnd("Conclusion", 1);
pdf.SaveAs("singleLayerBookmarks.pdf");Imports IronPdf
' Create a new PDF or edit an existing document.
Dim pdf As PdfDocument = PdfDocument.FromFile("existing.pdf")
' Add a bookmark
Dim mainBookmarks = pdf.Bookmarks.AddBookMarkAtEnd("NameOfBookmark", 0)
'Add a sub-bookmark
Dim subBookmarks = mainBookmarks.Children.AddBookMarkAtEnd("Conclusion", 1)
pdf.SaveAs("singleLayerBookmarks.pdf")2
附件
向您的 PDF 文档中添加附件,例如附加文件、图片或相关内容,以提供补充信息或内容。
了解如何:管理 PDF 中的附件using IronPdf;
using System.IO;
// Import attachment file
byte[] fileData = File.ReadAllBytes(@"path/to/file");
// Open existing PDF
PdfDocument pdf = PdfDocument.FromFile("sample.pdf");
// Add attachment to the PDF
pdf.Attachments.AddAttachment("Example", fileData);
pdf.SaveAs("addAttachment.pdf");Imports IronPdf
Imports System.IO
' Import attachment file
Dim fileData As Byte() = File.ReadAllBytes("path/to/file")
' Open existing PDF
Dim pdf As PdfDocument = PdfDocument.FromFile("sample.pdf")
' Add attachment to the PDF
pdf.Attachments.AddAttachment("Example", fileData)
pdf.SaveAs("addAttachment.pdf")准备开始了吗?
Nuget Downloads 21,228,841|版本:2026.9刚刚发布