Free Support Forum - aspose.com

Exception" Object reference not set to an instance of an object" when converting HTML to PDF using Aspose.PDF for .NET

Converting an HTML page to pdf with the simple code

            HtmlLoadOptions options = new HtmlLoadOptions();
            Document pdfDocument = new Document(midHtmlStream, options);
            pdfDocument.Save(finalPdfStream);

There is a html with an embedded gif and button links that is not able to convert and is giving the error
“Object reference not set to an instance of an object” on the new Document line " Document pdfDocument = new Document(midHtmlStream, options);"

Can you please help? I tried uploading the Html file but it does not allow to upload it.

Also I also have license for Aspose.pdf, If I need priortize help how can I get it ?

Thanks.

@azamatali

Thanks for contacting support.

Can you please share source HTML file along with version details to further investigate this issue.

Hello,
I am not able to attach the HTML file with this post. It only allows me to attach (jpg, jpeg, png, gif, zip, pdf). Please let me know how can I share the file with you?

We are using the 19.9.0 version of the Aspose.pdf.

@azamatali,

You have to zip the file and attach to this thread. Please share feedback with us if there is still an issue.

Please find the attached file HTML File Conversion Error.zip (74.1 KB)

@azamatali,

Thanks for contacting support.

I have tested the scenario and and I have logged investigation ticket with ID as PDFNET-47878 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Any update? We are receiving the issue in Production and require a quick resolution. Can you please prioritize it?

@azamatali,

I like to inform this issue has been added recently in our issue tracking system and as per our company policy, the first priority for investigation is given to the Paid Support i.e. Enterprise and Priority Support on first come first serve basis. After that the issues from normal support forum are scheduled for investigation on first come first serve basis. I request for your patience and we will keep you update regarding issue status and will resolve this as soon as possible.

We have a enterprise license for Aspose, what kind of support do you provide for license holders ? I was not able to find out the proper channel, therefore I proceeded ahead with this free support. Let me know if you need any information about our license to prioritize it.

@azamatali,

Please note that every reported/logged issue possesses equal significance and receives equal attention from us. We provide fix to each logged issue - however, issues have been resolved on first come first serve basis, which we believe is the fairest policy for everyone. In addition to that, the issues logged under paid/priority support model, have precedence over the issues logged under normal/free support mode. Which is why we suggest our customers to subscribe for paid support, in case their issue is a blocker and needs to be resolved on urgent basis.

Please also note that, paid support does not guarantee any immediate resolution, but it only expedites the investigation process - which will eventually leads to quicker resolution than in free/normal support model. For further information regarding Paid Support, you may please visit Paid Support FAQ page. We will share good news with you soon. Please spare us little time.

PDFNET-47878 ---- Status : Resolved. Please let me know the resolution.

Also I have another html that is giving me the error “max (300000) < opt (403000)” using the same source code

             HtmlLoadOptions options = new HtmlLoadOptions();
            Document pdfDocument = new Document(midHtmlStream, options);
            pdfDocument.Save(finalPdfStream);

Attaching the html file along with this.

57499247-4a3e-4836-b87c-0df36e294a07_1.zip (3.2 KB)

@azamatali,

I like to inform that issue has been marked resolved and will be available in Aspose.PDF 20.4 which will be released soon.

Hello Adnan,

I have reported another issue. Where another html is giving me the error “max (300000) < opt (403000)” using the same source code

Please see the previous post for the attached zip/html file. [57499247-4a3e-4836-b87c-0df36e294a07_1.zip]

@azamatali,

Thanks for contacting support.

I have tested the scenario and and I have logged investigation ticket with ID as PDFNET-47941 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

NullReferenceException indicates that you are trying to access member fields, or function types, on an object reference that points to null. That means the reference to an Object which is not initialized DGCustomerFirst.com

The issues you have found earlier (filed as PDFNET-47878) have been fixed in Aspose.PDF for .NET 20.4.