Hello, Aspose,
I have a problem with Html conversion with some files (examples attached). When I try to convert file an exception occurs such as “Unexpected font parsing”. I use following code:
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();
using (var streamReader = File.OpenText(inputFilePath))
{
Aspose.Pdf.Generator.Text text = new Aspose.Pdf.Generator.Text(section, streamReader.ReadToEnd());
text.IsHtmlTagSupported = true;
section.Paragraphs.Add(text);
using (var outputDocument = new Aspose.Pdf.Document(pdf))
{
outputDocument.Convert(
logFileName,
Aspose.Pdf.PdfFormat.v_1_5,
Aspose.Pdf.ConvertErrorAction.Delete);
outputDocument.Save(outputFilePath);
}
}
I also have tried this code from your samples:
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();
StreamReader r = File.OpenText(inputFilePath);
Aspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());
text2.IsHtmlTagSupported = true;
section.Paragraphs.Add(text2);
pdf.Save(outputFilePath);
Could you please help me with this issue.
Thanks in advance.
Best Regards,
Mike