PdfSharpCore icon indicating copy to clipboard operation
PdfSharpCore copied to clipboard

Exception on retrieving specific page: "GetInteger: Object is not an integer"

Open dampee opened this issue 3 years ago • 0 comments

System.InvalidCastException: GetInteger: Object is not an integer.
   at PdfSharpCore.Pdf.PdfDictionary.DictionaryElements.GetInteger(String key, Boolean create)
   at PdfSharpCore.Pdf.PdfDictionary.DictionaryElements.GetInteger(String key)
   at PdfSharpCore.Pdf.PdfPage..ctor(PdfDictionary dict)
   at PdfSharpCore.Pdf.PdfPages.get_Item(Int32 index)
   at MyCustomCode

the line where it is throwing is this line:

var inputDocumentPage = inputDocument.Pages[idx];

Upon investigation, the value in /Rotate is "null". This in turn is converted into a object of type PdfNull, which is not convertable in the GetInteger.

dampee avatar Aug 11 '22 12:08 dampee