I searched the internet for good examples to do this. I did not find any. Most were overly complex and or incorporated other features and functions that clouded the basics of extracting and saving a page from a PDF file. So here is my version.
Sometimes vendors, clients, or others will provide you with a PDF file that contains many pages. You may want to extract each page and make this single page a new PDF file, one file for each page in the original PDF. The following code will create a new PDF file for the second page in the original source file. This code requires interaction with an Adobe dll and uses early binding. You must make a reference to the Adobe library and in order for the code to be granted access to the DLL, you need to have Adobe Acrobat installed on the computer that runs the code.
This code will not work if you only have Adobe Reader installed. The reference will be available if reader is installed but the code will only work if Acrobat is installed.
Code:
'Extract the second page from
'a source PDF and create a new
'PDF file with the single page
'Must have Adobe Acrobat installed
'not just Adobe Reader. Reference
'Adobe Acrobat XX.X Type Library
'for this Early Binding example
Dim strPath As String
Dim pdfDocNew As New Acrobat.AcroPDDoc
Dim pdfSource As New Acrobat.AcroPDDoc
strPath = "C:\Test\"
pdfDocNew.Create
pdfSource.Open strPath & "Source.pdf"
pdfDocNew.InsertPages -1, pdfSource, 1, 1, 0
pdfDocNew.Save Acrobat.PDSaveFull, strPath & "MyNewFile.pdf"
pdfSource.Close
pdfDocNew.Close
Set pdfSource = Nothing
Set pdfDocNew = Nothing
MsgBox "Complete"
Like I mentioned, this is just the basics. Extract a page and save it. You will probably want to include additional functionality in your app. Here is some reference material I found to be helpful.
http://www.adobe.com/content/dam/Ado..._reference.pdf