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
{
//
......
}