Some tools produce one large PDF containing multiple documents appended to each other. In case the documents have a different ammount of pages it becomes sometimes quite a task to seperate/split the document in multiple documents. Here the function SplitPDF of the Aloaha COM Object aloahapdf.edit comes in.

SplitPDF takes a PDF, searches for the specified page seperator (for example “Kind Regards”) and then splits of the pages to save them as new document. Optional the function can be instructed to render a letterhead/watermark behind the first page of the new document.

For example:

Dim PDFObject
Dim InputPDF
Dim OutPutFolder
Dim PageSeperator
Dim Letterhead
InputPDF=”c:\Invoices.pdf”
OutPutFolder=”c:\splittedDocuments\”
PageSeperator=”Kind Regards”
Letterhead=”C:\letterhead\companyLetterhead.pdf”

set PDFObject=createobject(“aloahapdf.edit”)

call PDFObject.SplitPDF(cstr(InputPDF),cstr(OutPutFolder),cstr(PageSeperator),cstr(Letterhead))

set PDFObject=nothing

 

Please do not hesitate to contact us at info@aloaha.com in case you have further questions.

To email or print the resulting PDFs please have a look at http://blog.aloaha.com/2012/08/29/automatically-mail-and-print-pdf-documents/

Please also have a look at http://www.aloaha.com/software-development/freeware-apis.php