Splitting a PDF File into Multiple PDF Files in .Net

How can I split a PDF File into Multiple PDF Files in .Net by a name in the header of a Page?  

So for example if I had a document that had information of people and one of the fields that started each persons information was  Last Name.  How could I read the Last Name, name the new PDF File by Last Name, and save the pages following until the next Last Name shows up?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Andrew,

I published an article here at EE with a program that does exactly what you're asking for:
How To Split-Rename-Move a Batch of PDF Files Based on Contents of the Files

I recently took down the source code (written in AutoHotkey) because I am making major changes to the program, but you may be able to use the article as a guide for developing your own VB.NET program.

Although that program assumes the existence of the identifier (such as Last Name) in a fixed column, several EE members have hired me to create custom versions of this program that can find an identifier wherever it appears on the first line, or even the entire first page. For example, one version looks for an order number following the identifier "Order Nbr", and also looks for three different document types; another version looks for a "Date of Birth" field; and another looks for an employee ID. I'm developing a generalized version that can find any identifier, but it's a work-in-progress. For the time being, I'll continue to create customized versions of the program for specific requirements. Regards, Joe

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AndrewBanferAuthor Commented:

Any chance you can place the original code back in an article?

Joe Winograd, Fellow&MVEDeveloperCommented:
I can't do that now for several reasons. But I'd like to study one of your sample PDFs. If you can post one here that doesn't have private/sensitive data, that would be great. But if you don't want to post it here for all to see, drop me a message via the EE Messaging System and I'll give you my private email address so that you can send me a sample PDF. Regards, Joe
Joe Winograd, Fellow&MVEDeveloperCommented:
The question reads, "How can I split a PDF File into Multiple PDF Files in .Net by a name in the header of a Page?" and "How could I read the Last Name, name the new PDF File by Last Name, and save the pages following until the next Last Name shows up?"

The post https:#a40833052 explains "how" to do it and deserves to be the Accepted Solution, imo. It doesn't actually do it (because I removed the program that does it), but the post, and my two EE articles that it references, certainly explain "how" to do it. Regards, Joe
Joe Winograd, Fellow&MVEDeveloperCommented:
Thank you, eenookami — much appreciated!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.