tags:

views:

26

answers:

2

Hello, 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?

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

Thanks.

+1  A: 

A previous question answers your partially - how to split pdf documents, if you know where the barcodes are then you can split the documents easily:

How can I split up a PDF file into pages (preferably C#)

The recommendation is a library called PDFSharp and a sample demonstrating PDF splitting.

gyurisc
+1  A: 

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?Page=ConcatenateDocuments-sample&NS=&AspxAutoDetectCookieSupport=1

Marko