拆分成PDF在C#中的多个文件 [英] split PDF into multiple files in C#

查看:276
本文介绍了拆分成PDF在C#中的多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经目前使用第三方组件阅读PDF格式的二维条码处理所有的PDF文件,然后一个C#Windows服务更新数据库,并存储在文档库中的文件。

We have a C# Windows service that currently processes all the PDFs by reading the 2D barcode on the PDF using a 3rd party component and then updates the database and stores the document in the Document repository.

有没有办法读取条形码后,我可以剪切文件并将其保存为其他文件?

Is there a way I can cut the files after reading the barcode and store it as another document?

例如,如果有一个10页文件,它应该分裂成10个不同的文件。

For example if there is a 10 page document, it should split into 10 different files.

感谢。

推荐答案

您可以使用PDF库一样的 PDFSharp ,阅读文件,通过每个页面的重复,将它们添加到一个新的PDF文档,并保存在文件系统中。然后,还可以删除或保留原来的。

You can use a PDF library like PDFSharp, read the file, iterate through each of the pages, add them to a new PDF document and save them on the filesystem. You can then also delete or keep the original.

这是相当多的代码,但很简单,这些样品应该让你开始。

It's quite a bit of code, but very simple and these samples should get you started.

HTTP ?://www.pdfsharp.net/wiki/Default.aspx页= ConcatenateDocuments样本和放大器; NS =安培; AspxAutoDetectCookieSupport = 1

这篇关于拆分成PDF在C#中的多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆