System.NullReferenceException: Object reference not set to an instance of an object

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v10)  /  Re: System.NullReferenceException: Object reference not set to an instance of an object

DynamicPDF CoreSuite for .NET (v10) Forum

I've submitted this to support@, curious if anyone else has run into this issue?


The exception being thrown:
System.NullReferenceException: Object reference not set to an instance of an object.
   at ceTe.DynamicPDF.Merger.PdfPage.a()
   at ceTe.DynamicPDF.Merger.PdfPage.i()
   at ceTe.DynamicPDF.Merger.AppendedPage..ctor(PdfPage A_0, aa7 A_1)
   at zz93.aa7.a(Int32 A_0, Int32 A_1)
   at ceTe.DynamicPDF.Merger.MergeDocument..ctor(PdfDocument pdfDocument, Int32 startPage, Int32 pageCount, MergeOptions options)


Code Snippet:
Dim pdfDoc As New ceTe.DynamicPDF.Merger.PdfDocument(item.FileName)  'open existing file
Dim newDoc As ceTe.DynamicPDF.Merger.MergeDocument
Dim mergeOptions As New ceTe.DynamicPDF.Merger.MergeOptions()

The exception is thrown on this line:
newDoc = New ceTe.DynamicPDF.Merger.MergeDocument(pdfDoc, startPage, totalPages, mergeOptions)

startPage = 1
totalPages = 30

PDF Information:
Here is information about the PDF file:
* 44 pages.
* Bookmarks
* Producer: iText 5.5.12
* Version 1.4 (Acrobat 5.x)
* Size 1.40 MB
* Tagged: No

? pdfDoc
{ceTe.DynamicPDF.Merger.PdfDocument}
    Author: Nothing
    CollectionType: None {0}
    Creator: Nothing
    Form: Nothing
    Keywords: Nothing
    NeedsRendering: False
    Outlines: {ceTe.DynamicPDF.Merger.PdfOutlineList}
    Pages: {ceTe.DynamicPDF.Merger.PdfPageList}
    Producer: "iText® 5.5.12 ©2000-2017 iText Group NV (AGPL-version)"
    SecurityInfo: None {4}
    Subject: Nothing
    Tagged: False
    Title: Nothing
    XmpMetadata: Nothing

? pdfDoc.Outlines
{ceTe.DynamicPDF.Merger.PdfOutlineList}
    Count: 8

? pdfDoc.Pages
{ceTe.DynamicPDF.Merger.PdfPageList}
    Count: 44

? pdfDOc.Pages.Item(0).GetContents
'pdfDOc.Pages.Item(0).GetContents' threw an exception of type 'System.NullReferenceException'
    Data: {System.Collections.ListDictionaryInternal}
    HResult: -2147467261
    HelpLink: Nothing
    InnerException: Nothing
    Message: "Object reference not set to an instance of an object."
    Source: "DynamicPDF.NETFramework35"
    StackTrace: "   at ceTe.DynamicPDF.Merger.PdfPage.a()" & vbCrLf & "   at ceTe.DynamicPDF.Merger.PdfPage.d()" & vbCrLf & "   at ceTe.DynamicPDF.Merger.PdfPage.GetContents()"
    TargetSite: {Void a()}

? pdfDoc.Pages.Item(0).GetType
{Name = "PdfPage" FullName = "ceTe.DynamicPDF.Merger.PdfPage"}
    [Assembly]: {DynamicPDF.NETFramework35, Version=10.9.0.35, Culture=neutral, PublicKeyToken=09b5ce0d5c0a9d8b}
    AssemblyQualifiedName: "ceTe.DynamicPDF.Merger.PdfPage, DynamicPDF.NETFramework35, Version=10.9.0.35, Culture=neutral, PublicKeyToken=09b5ce0d5c0a9d8b"
    Attributes: Public Or BeforeFieldInit {1048577}
    BaseType: {Name = "Object" FullName = "System.Object"}
    ContainsGenericParameters: False
    DeclaringMethod: 'DirectCast(pdfDoc.Pages.Item(0).GetType, System.RuntimeType).DeclaringMethod' threw an exception of type 'System.InvalidOperationException'
    DeclaringType: Nothing
    FullName: "ceTe.DynamicPDF.Merger.PdfPage"
    GUID: {20f81dec-3c8a-3b56-9acd-f0c3cf38c259}
    GenericParameterAttributes: 'DirectCast(pdfDoc.Pages.Item(0).GetType, System.RuntimeType).GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException'
    GenericParameterPosition: 'DirectCast(pdfDoc.Pages.Item(0).GetType, System.RuntimeType).GenericParameterPosition' threw an exception of type 'System.InvalidOperationException'
    HasElementType: False
    IsAbstract: False
    IsAnsiClass: True
    IsArray: False
    IsAutoClass: False
    IsAutoLayout: True
    IsByRef: False
    IsCOMObject: False
    IsClass: True
    IsContextful: False
    IsEnum: False
    IsExplicitLayout: False
    IsGenericParameter: False
    IsGenericType: False
    IsGenericTypeDefinition: False
    IsImport: False
    IsInterface: False
    IsLayoutSequential: False
    IsMarshalByRef: False
    IsNested: False
    IsNestedAssembly: False
    IsNestedFamANDAssem: False
    IsNestedFamORAssem: False
    IsNestedFamily: False
    IsNestedPrivate: False
    IsNestedPublic: False
    IsNotPublic: False
    IsPointer: False
    IsPrimitive: False
    IsPublic: True
    IsSealed: False
    IsSerializable: False
    IsSpecialName: False
    IsUnicodeClass: False
    IsValueType: False
    IsVisible: True
    MemberType: TypeInfo {32}
    MetadataToken: 33556179
    [Module] (System.Reflection.MemberInfo): {DynamicPDF.NETFramework35.dll}
    [Module]: {DynamicPDF.NETFramework35.dll}
    Name: "PdfPage"
    [Namespace]: "ceTe.DynamicPDF.Merger"
    ReflectedType: Nothing
    StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}
    TypeHandle: {System.RuntimeTypeHandle}
    TypeInitializer: Nothing
    UnderlyingSystemType: {Name = "PdfPage" FullName = "ceTe.DynamicPDF.Merger.PdfPage"}
Posted by a ceTe Software moderator
Hello,

 This issue has been fixed in latest v10 DynamicPDF for .NET product and released on our website for download. You can download latest product installer file from our website here. Also once you  install the product remove reference for the older DLL file and reference the latest DLL file in your application.

Also you can get latest “ceTe.DynamicPDF.CoreSuite.NET” package from Nuget here.

Thanks,
ceTe Software Support Team
We got the latest release and confirm that this issue has been fixed.

All times are US Eastern Standard time. The time now is 1:13 PM.