在實際環境中進行測試
在生產環境中進行無水印測試。
無論在何處需要,它都能正常運作。
幾秒鐘內即可整理 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.CopyPage(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");