Hello to everyone at the support team,
im trying to merge some PDF files with nested bookmarks. The goal is to preserve the existing bookmark structure after the merge.
1. Merge two pdf files s1.pdf and s2.pdf to result.pdf
2. Create new bookmark for document s1.pdf and read existing bookmarks from s1.pdf and assign them as child bookmarks
3. Create new bookmark for document s2.pdf and read existing bookmarks from s2.pdf and assign them as child bookmarks
4. Save bookmarks
For more details see the attached test project.
Aspose.Pddf.dll Version 9.0.0.0
internal bugid#4414
In the result.pdf all nested bookmarks are duplicated. Very strange.
Best regards, Martin Pfeifer
The method Aspose.Pdf.Facades.BookmarkEditor.ExportBookmarksToXML() seems wrong.
Aspose.Pdf.Facades.BookmarkEditor be= new Aspose.Pdf.Facades.BookmarkEditor();
be.BindPdf( “c:\temp\s1.pdf”);
be.Aspose.Pdf.Facades.BookmarkEditor(“c:\temp\s1.xml”);
This produces the following xml
<?xml version="1.0" encoding="ISO8859-1"?>
cTagesordnung
Öffentlicher Teil:
Eröffnung der Sitzung
Genehmigung des Protokolls vom 27.02.2013
Mitteilungen der Verwaltung
Mitteilungen der Kämmerei
Anträge der Fraktionen
Anfragen an die Verwaltung
Eröffnung der Sitzung
Genehmigung des Protokolls vom 27.02.2013
Mitteilungen der Verwaltung
Mitteilungen der Kämmerei
Anträge der Fraktionen
Anfragen an die Verwaltung
Nichtöffentlicher Teil:
Eröffnung der Sitzung
Auftragsvergaben
Mitteilungen und Berichte
Eröffnung der Sitzung
Auftragsvergaben
Mitteilungen und Berichte
Öffentlicher Teil:
Teilnahme am Modellprojekt “Moderne Kommune”
Vereinbarung einer Städtepartnerschaft mit Strasburg, Frankreich
TLF 16
Neubau von Radwegen an den innerstädtischen Hauptverkehrsstraßen
Vorbereitung der 1000-Jahr-Feier in Norderlanden
Teilnahme am Modellprojekt “Moderne Kommune”
Vereinbarung einer Städtepartnerschaft mit Strasburg, Frankreich
TLF 16
Neubau von Radwegen an den innerstädtischen Hauptverkehrsstraßen
Vorbereitung der 1000-Jahr-Feier in Norderlanden
==> every bookmark with bookmark.parent != null is duplicated
Hi Martin,
m.pfeifer:
Aspose.Pdf.Facades.BookmarkEditor.ExportBookmarksToXML() seems wrong.
Aspose.Pdf.Facades.BookmarkEditor be= new Aspose.Pdf.Facades.BookmarkEditor();
be.BindPdf( “c:\temp\s1.pdf”);
be.Aspose.Pdf.Facades.BookmarkEditor(“c:\temp\s1.xml”);
Aspose.Pdf.Facades.PdfBookmarkEditor
be = new Aspose.Pdf.Facades.PdfBookmarkEditor();<o:p></o:p>
be.BindPdf("c:/pdftest/s1.pdf");
be.ExportBookmarksToXML(“c:\pdftest\Exported_bookmarks.xml”);
Hi Caroline,
//open document<o:p></o:p>
Document document = new Document("c:/pdftest/s1.pdf");
Document document2 = new Document("c:/pdftest/s2.pdf");
document.Pages.Add(document2.Pages);
document.Save(“c:/pdftest/MergedFile.pdf”);
Hi Nayyer,
the solution with
document.Pages.Add(document2.Pages);
works in very simple examples. But we use the dll to concatenate about 60-100 pdf documents. To simplify navigation in the merged document a hierarchical bookmark structure ist very important.
Every document can be reached by a pdf bookmark. If a pdf document contains bookmarks the existing bookmarks must be childs of the pdf document bookmark.
- bookmark document 1
- existing bookmark 1 from document 1
- existing bookmark 2 from document 1
- existing bookmark 3 from document 1
- existing bookmark 4 from document 1
- bookmark document 2
- existing bookmark 1 from document 2
- existing bookmark 2 from document 2
- existing bookmark 3 from document 2
- existing bookmark 4 from document 2
I think this can’t be done with document.Pages.Add(document2.Pages);
Hi Nayyer,
i’m sorry - the Aspose.Pdf.Facades.PdfBookmarkEditor.ExportBookmarksToXML() works perfect.
Hi Martin,
Hi,
our problem is not solved.
The proposal from Nayyer to use
document.Pages.Add(document2.Pages)
is not possible for our project. I tried to explain the reason in my yesterday posting. In short - we need a hierarchical bookmark structure.
We need a solutuion to
- Concatenate many pdf files (up to 100)
- Create a hierarchical bookmark structure for better navigation like in
- bookmark document 1
- existing bookmark 1 from document 1
- existing bookmark 2 from document 1
- existing bookmark 3 from document 1
- existing bookmark 4 from document 1
- bookmark document 2
- existing bookmark 1 from document 2
- existing bookmark 2 from document 2
- existing bookmark 3 from document 2
- existing bookmark 4 from document 2
Thanks in advance, Martin Pfeifer
Hi Martin,
I
have tested the scenario and I am able to notice the same problem. For the sake
of correction, I have logged this problem as PDFNEWNET-36599 in
our issue tracking system. We will further look into the details of this
problem and will keep you updated on the status of correction. Please be
patient and spare us little time. We are sorry for this inconvenience.<o:p></o:p>
Hello,
i was completly wrong - the problem is caused from our code.
Now everything works fine.
Sorry for your inconvenience.
Martin Pfeifer
Hi Martin,
The issues you have found earlier (filed as PDFNEWNET-36599) have been fixed in Aspose.Pdf for .NET 9.2.0.
The blog post for this release is created over this link
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.