“Object reference not set to an instance of an object” error occurs when converting this excel file
my C# source
License license = new License();
string test1 = "C://Users//Administrator//Documents//16762644760034.xlsx";
string test2 = test1 + ".pdf";
gd gd = new gd();
try
{
using (Viewer viewer = new Viewer(test1))
{
PdfViewOptions options = new PdfViewOptions(test2);
viewer.View(options); // code end at this line
gd = null;
}
@cooqwe
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): VIEWERNET-4246
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thank you for attaching the source file. I have reproduced this issue. We’ll investigate it and update you when we have any new information.
As a temporary workaround you can try rendering complete worksheet to one page.
using (var viewer = new Viewer("16762644760034.xlsx"))
{
var viewOptions = new PdfViewOptions();
viewOptions.SpreadsheetOptions = SpreadsheetOptions.ForOnePagePerSheet();
viewer.View(viewOptions);
}
The issue is set to status blocked when there is another issue that stops us from fixing the main issue. In this case, VIEWERNET-4246 is blocked by an issue in one of our submodules.
I’m sorry for the delayed response. The issue is already fixed. The fix will be included in the next public release. The release is planned to be published next week.