|
Greetings, I am a first time user of PDFSharp and it works great. But I am having problems getting Bookmarks (the PDF Outline) to appear in my document. I have a folder that contains multiple PDF files in which I am merging. When each file is merged, I want to create an outline entry for it. Here is the code.
Dim fiBaseFiles As FileInfo Dim pdfMerge As New PdfDocument Dim pdfBookmark As PdfOutline
' Loop through the files and merge Try For Each fiBaseFiles In disSubPDFDirectory.GetFiles() Dim pdfBase As PdfDocument = PdfReader.Open(strPDFPath & "\" & fiBaseFiles.Name, PdfDocumentOpenMode.Import)
For intX = 0 To pdfBase.PageCount - 1 Dim pdfPage As PdfPage = pdfBase.Pages(intX)
pdfMerge.AddPage(pdfPage)
If intX = 0 Then pdfBookmark = pdfBase.Outlines.Add(fiBaseFiles.Name, pdfPage, True) End If Next Next
The merged PDF is being created but there is not an outline that is being produced. Am I doing this correctly?
Greg
|