Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

If the Bookmarks is not exist, Export Bookmarks To XML ( The error occurred)

$
0
0
 How to decide whether there really are bookmark involved?

 Document pdfDocument = new Document(ABC.pdf);//ABC.pdf does not contain bookmarks .

 if (pdfDocument.Outlines.Count>0 || pdfDocument.Outlines.First.Count > 0)//Outlines.Count | 1
   {
       try        
       {
              Aspose.Pdf.Facades.PdfBookmarkEditor bookmarkEditor = new Aspose.Pdf.Facades.PdfBookmarkEditor();
                           
             bookmarkEditor.BindPdf(pdfDocument);
              //Export bookmarks
                  
              bookmarkEditor.ExportBookmarksToXML(sOutpathFile);//The error occurred
                               
              }

              catch (Exception ex)
               {
                     MessageBox.Show(ex.Message); 
               }
}
else
{
//
......
}

Viewing all articles
Browse latest Browse all 3131

Trending Articles