Unable to cast object of type' ' to type ' '


#1

Hi,

We are getting Unable to cast object of type’ ’ to type ’ ’ exception for few of the .pdf and .html files.

for .pdf files while saving into PDF_A_2B format the mentioned exception is getting

//code snippet//
doc.Convert(new MemoryStream(),Pdfformat.PDF_A_2B,ConvertErrorAction.Delete);
doc.Save(destinationfilePath); // throwing Unable to cast object of type’ ’ to type ’ ’ exception

for .html files while converting the html file into pdf document getting the mentioned exception is getting.

// code snippet //

var options=new HtmlLoadOptions();
var document=new Document(sourceFilePath,options);// throwing Unable to cast object of type’ ’ to type ’ ’ exception

We won’t be able to share the sample files due to organisation policies.

Regards,
Kiran


#2

@ITCUser,

I have observed the issues shared by you and request you to please share the sample files reproducing issues on your end. Please also share the product versions used on your end along with sample project. We will be able to help you further on provision of requested information.