Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: PDF merge with bookmarks, 3 Attachments
Conf: (P-PDF) Developers, Msg: 128992
From: JORDISAIS
Date: 3/8/2005 09:13 PM

HELLO,

THE FOLLOWING CODE APPENDS THE PDF FILE CONTAINED IN sSourceFile TO sTargetFile:

Public Function PDF_Join(sTargetFile As String, sSourceFile As String) As Boolean

Dim SourcePDDoc As CAcroPDDoc
Dim ToAddPDDoc As CAcroPDDoc
Dim bOk As Boolean
Dim NumPagesToInsert As Long
Dim NumPagesTarget As Long

Set TargetPDDoc = CreateObject("AcroExch.PDDoc")
Set SourcePDDoc = CreateObject("AcroExch.PDDoc")

PDF_Join = True

bOk = TargetPDDoc.Open(sTargetFile)
If Not (bOk) Then
bOk = TargetPDDoc.Create
End If
If bOk Then
NumPagesTarget = TargetPDDoc.GetNumPages
bOk = SourcePDDoc.Open(sSourceFile)
NumPagesToInsert = SourcePDDoc.GetNumPages
If bOk Then
bOk = TargetPDDoc.InsertPages(NumPagesTarget - 1, SourcePDDoc, 0, NumPagesToInsert, 1)
If bOk Then
bOk = TargetPDDoc.Save(PDSaveFull, sTargetFile)
If Not (bOk) Then
MsgBox ("Error Saving Target PDF File " & sTargetFile)
PDF_Join = False
End If
Else
MsgBox ("Error Inserting Source PDF File " & sSourceFile)
PDF_Join = False
End If
Else
MsgBox ("Error opening Source PDF File " & sSourceFile)
PDF_Join = False
End If
Else
MsgBox ("Error creating Target PDF File " & sTargetFile)
PDF_Join = False
End If

End Function

I want to update this function so it will add a bookmark in the resulting PDF file for each source file joint, so there will be an easy access to the different original files.

Can anybody help me ?

THANKS IN ADVANCE.

Click to open!Car.pdf
(4,540 bytes)

Click to open!Nation.pdf
(5,675 bytes)

Click to open!Nation-car.pdf
(9,347 bytes)


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.