首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将PDF拆分为多个文档

如何将PDF拆分为多个文档
EN

Stack Overflow用户
提问于 2015-01-08 01:28:37
回答 1查看 6.8K关注 0票数 2

我有一个由多个文档组合而成的大PDF。

如何使用关键字分隔符将PDF拆分回多个文档?

EN

回答 1

Stack Overflow用户

发布于 2015-08-17 01:12:24

请看一下关于如何将PDF分成多个文件的指南

代码语言:javascript
复制
// Used to register all DLL assemblies.
WorkRegistry.Reset();

String inputFilePath = Program.RootPath + "\\" + "1.pdf";
String outputFileName = "Output";
int[] splitIndex = new int[3] { 1, 3, 5 }; // Valid value for each index: 1 to (Page Count - 1).

// Create output PDF file path list
List<String> outputFilePaths = new List<String>();
for (int i = 0; i <= splitIndex.Length; i++)
{
        outputFilePaths.Add(Program.RootPath + "\\" + outputFileName + "_" + i.ToString() + ".pdf");
}

// Split input PDF file to 4 files:
// File 0: page 0.
// File 1: page 1 ~ 2.
// File 2: page 3 ~ 4.
// File 3: page 5 ~ the last page.
PDFDocument.SplitDocument(inputFilePath, splitIndex, outputFilePaths.ToArray());
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27831572

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档