Skip to content

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

Closed
@dampee

Description

@dampee
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions