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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With