Using C# to convert MHTML file to pdf gives error : Value cannot be null.Parameter name: value.
Error is thrown in third line of code where it tries to instatiate the Document. Input fileData is byte array of mhtml file.
public byte[] Convert(byte[] fileData)
{
using (var ms = new MemoryStream(fileData))
{
var document = new Document(ms, new MhtLoadOptions());
using (MemoryStream outputStream = new MemoryStream())
{
document.Save(outputStream);
return outputStream.ToArray();
}
}
Would you please share zipped MHTML file so that we may try to reproduce and investigate it on your side. Before sharing requested data, please ensure using Aspose.PDF for .NET 18.11 in your environment.
Thank you for the response.
I upgraded aspose.pdf to 18.11 from 17.8 and I still see the issue.
Please find a sample mhtml file in the attachment where the error is reproducible.whateverTest.zip (246.8 KB)
We have been able to reproduce the issue in our environment. A ticket with ID PDFNET-45698 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.
We are sorry for the inconvenience.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.