We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

UTF8 files conversion to PDF does not work correctly

Hello,

if we try to convert the attached text file (UTF8) to PDF, the text will be changed.
Occurs in your online demo too.

Test.zip (127 Bytes)

Is there a way to check the encoding of the text file and use the correct Aspose method?

Kind Regards,
Andy

@AStelzner

You can get the desired output using the LoadOptions.Encoding property as shown below.

LoadOptions option = new LoadOptions();
option.Encoding = Encoding.UTF8;
Document doc = new Document(MyDir + "Test.txt", option);
doc.Save(MyDir + "21.10.pdf");
1 Like

Thanks, it works :slight_smile: