NullReferenceException on MergeDocument constructor

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v12)  /  NullReferenceException on MergeDocument constructor

DynamicPDF CoreSuite for .NET (v12) Forum

Hello.

The following is throwing a NullReferenceException on the "var doc = ..." line.

Assume dbAccessKey is a valid license key, srcfile is the full path to the source file, and outfile is a valid full path to the output file.

------
var dbAccessKey = "[key]";
var srcfile = "[sourceFileFullPath]";
var outfile = "[outFileFullPath]";

if (ceTe.DynamicPDF.Document.AddLicense(dbAccessKey))
{
        var doc = new ceTe.DynamicPDF.Merger.MergeDocument(srcfile) { CompressionLevel = 9 };        // THROWS ON THIS LINE
        doc.Draw(outfile);
}
------
DynamicPDF.CoreSuite 12.6.0.49301
System.NullReferenceException (Object reference not set to an instance of an object.)
   at #Lae.#aee.#6de(#Zje #dh, Int32 #7de, #Wde #NBb, Int32 #3de)
   at #Lae.#aee.#1de(#Wde #NBb, #4me #2de, Int32 #3de)
   at #Lae.#aee.#4de()
   at #6lc.#owc.#ewc(#Zje #dh, Int32 #fwc, Int32 #gwc)
   at #Lae.#Kde.#p0c(Int32 #fwc, Int32 #gwc)
   at ceTe.DynamicPDF.Merger.MergeDocument.#ng(PdfDocument #qde, #Kde #rde)
   at [USER_CODE]
-----

Any advice would be helpful. I can provide the source PDF upon request.

Thank you.

-Brad
Posted by a ceTe Software moderator
Hi,

Please send over following information to support@dynamicpdf.com  so we can look into it further.

1. Code sample which uses static data to recreate the error.
2. Full error message along with stack trace.
3. Source files used for merging(to recreate error).
4. Exact version and build number of the DynamicPDF DLL file used in your application. You can find this information by right clicking on the DLL file>>Properties>>Details tab>>Product version. Take a screenshot of the Details tab and send it over to us.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 8:39 PM.