how do i use append function ?

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
melloni
Posts: 1
Joined: Fri Mar 26 2004

how do i use append function ?

Post by melloni »

Append function is used to create one pdf file from different pdf files ?
how do i use append function ?
thanks ?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Yes, the Append function of CDIntf enables you to Concatenate two pdf files. This function will work for all files generated by our driver and for all supported files generated by other drivers.

To use it you need to have a licensed version of the PDF Converter on your system and you need to have CDIntf registered in your system directory.

Please find here a sample VB code on using the Append function:

'Create the document object
Dim pdfdoc As New CDIntfEx.Document
'Open File1.pdf
pdfdoc.Open "c:\Temp\File1.pdf"
'Use Append to append File2 to it
pdfdoc.Append "c:\Temp\File2.pdf"
'Save the result
pdfdoc.Save "c:\Temp\Append.pdf"


Have a nice weekend.
John_h_bergman
Posts: 13
Joined: Tue Apr 13 2004

Can you add how to put bookmarks in while appending?

Post by John_h_bergman »

Can you update your example to show how to put bookmarks in the pDF file while appending? Also, how do you put a bookmark in for the first file in the group of files being concatenated together using this method.

Thanks,
John
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

You can add bookmarks to pdf file when generting them or after the file is generated, but not when appending pdf documents.

After appending all your pdf documents together you can open the resulting pdf file and add bookmarks to it as specified in our example.

Hope this helps, if you need more information please let us know.
John_h_bergman
Posts: 13
Joined: Tue Apr 13 2004

How would I know

Post by John_h_bergman »

In appending arbitrary documents, how would I know where to place the bookmarks?

Are bookmarks preserved in the PDF Document being appended? Ie I have Doc1, and want to add Doc2... Doc2 has bookmarks... are they included in the combined document?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Yes, if you are Appending documents that have bookmarks, these bookmarks are kept in the final pdf file.

Hope this helps.
John_h_bergman
Posts: 13
Joined: Tue Apr 13 2004

Sample Code?

Post by John_h_bergman »

Is there any sample code that would show how to put the book marks in between documents being appended together?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hi,

You can add bookmarks while generating a pdf file not while appending pdf files.

For a sample application on adding bookmarks while generating the pdf file please contact our Technical Support Department support@amyuni.com

If your pdf files are already generated and have bookmarks, these bookmarks are kept when appending the files using CDIntf.

So if you already have the pdf files, you can do one of two things:

1 - Open the pdf files before appending them, add bookmarks to them and then append them.

2 - Append the pdf files, open the resulting file and add bookmarks to it.

In both cases you can use a code similar to the following:
Private Sub AddBookmarks_Click()

Dim pdfDoc As New CDIntfEx.Document

Dim bool As Boolean

pdfDoc.Open ("C:\Temp\Test.pdf")
bool = pdfDoc.SetBookmark(1, "Introduction", 0)
bool = pdfDoc.SetBookmark(2, "Chapter 1", 0)
bool = pdfDoc.SetBookmark(4, "Chapter 2", 1)
pdfDoc.SetBookmarkXY 5, 5000, 14000, "bookmarkXY", 0 'adds a bookmark at a specific location

pdfDoc.Save ("C:\Temp\Bookmarks.pdf")

Set pdfDoc = Nothing

End Sub

Hope this helps.
John_h_bergman
Posts: 13
Joined: Tue Apr 13 2004

So, am I understanding what you recommend?

Post by John_h_bergman »

I should open each document before appending and insert a bookmark at the beginning of the PDF. That way when they are concatenated/appended together, the book marks would be present marking the start of each PDF?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Yes, this is what i recommend.

Hope this helps ?
asuwandarathne
Posts: 4
Joined: Mon Feb 22 2010

Re: how do i use append function ?

Post by asuwandarathne »

HEy Joan,

have a comment on you.
First thanks a lot for make me on the track by ur piece of code to add bookmark.
But this is really usefull when we need such a page level bookmarking.
What i want know is the way of adding content level bookmarks. Please help me on this with some piece of sample code.

As an example if there is a word called Heading 1 in my pdf. I wanna add Heading 1 bookmark, once we click on that book mark directly show the pdf word and 'Heading 1' content.

I am in a deep trouble Joan please help me on this :(
Post Reply