在實際環境中進行測試
在生產環境中測試,無浮水印。
無論您在哪裡需要,它都能運作。
只需幾秒鐘,即可整理 PDF 文件中的頁面與書籤。
透過依需求新增、複製或刪除頁面,來管理 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.Co/pyPage(0);
將多個 PDF 合併為單一文件,或將大型 PDF 分割成較小的部分,讓您的文件更易於管理與分發。
了解如何:合併與分割 PDF 檔案using 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");
在 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");
請在 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");