We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Attached PDF raises error attempting to access Outlines collection

Using the following code shows that an Outlines collection is created for the attached document but attempting to walk over the collection or even get the count raises an error of:

‘pdfDoc.Outlines.Count’ threw an exception of type 'System.ArgumentNullException’


public void CleanAllActions(string filePath)
var pdfDoc = new Document(filePath);
if (pdfDoc.Outlines != null)
//Throws the exception here.
foreach (OutlineItemCollection oic in pdfDoc.Outlines)
//never gets in here

Hi Kim,

Thanks for your inquiry. I have tested your scenario with shared document using Aspose.Pdf for .NET 11.5.0 and managed to observe the reported exception. For further investigation, I have logged an issue in our issue tracking system as PDFNEWNET-40559 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Best Regards,