Hi,
During html to pdf conversion we’ve faced with an strange aspose behavior:
-
If we use such code
var pdf = new Aspose.Pdf.Document(inputFilePath);
we have
Aspose.Pdf.InvalidPdfFileFormatException: Startxref not found
exception -
if we use such code (encoding from file)
var htmlLoadOptions = new Aspose.Pdf.HtmlLoadOptions { InputEncoding = "utf-8" };
var pdf = new Aspose.Pdf.Document(inputFilePath, htmlLoadOptions);
we have
Aspose.Pdf.FontNotFoundException: Font Mangal was not found
exception -
If we use such code
var htmlLoadOptions = new Aspose.Pdf.HtmlLoadOptions { InputEncoding = "iso-8859-1" };
var pdf = new Aspose.Pdf.Document(inputFilePath, htmlLoadOptions);
constructor passed succesfully and conversion performed using
pdf.Convert() and pdf.Save() methods but result pdf file has incorrect encoding
We think that it is an issue in Aspose.Pdf as it cannot create Document class with correct encoding or without specifying it and work only for incorrect encoding.
result.pdf (1.2 MB)
Testfile_2_Sverige – Wikipedia.zip (99.7 KB)