Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.PDF Splitter 是一个在线免费网络应用程序,允许您调查演示拆分功能的工作原理。
本主题展示了如何在您的 .NET 应用程序中将 PDF 页面拆分为单独的 PDF 文件。要使用 C# 将 PDF 页面拆分为单页 PDF 文件,可以按照以下步骤进行:
以下代码片段也适用于 Aspose.PDF.Drawing 库。
以下 C# 代码片段展示了如何将 PDF 页面拆分为单独的 PDF 文件。
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void SplitDocument()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Pages();
// Open PDF document
using (var document1 = new Aspose.Pdf.Document(dataDir + "SplitToPages.pdf"))
{
int pageCount = 1;
// Loop through all the pages
foreach (var page in document1.Pages)
{
// Create PDF document
using (var document2 = new Aspose.Pdf.Document())
{
document2.Pages.Add(page);
// Save PDF document
document2.Save(dataDir + "Page_" + pageCount + "_out.pdf");
pageCount++;
}
}
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.