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

Free Support Forum - aspose.com

EM Dash rendering issue with aspose words

we use below code to convert a html to pdf. EM Dash is garbled up in the PDF please help. Please rename zip to html or txt.

 public static void ConvertUsingdoc(string inputfileName)
        {
            var fileStream = new FileStream(inputfileName, FileMode.Open);
            var _wordSettings = new GraphicsManipulation.GraphicsConverterTypes.WordSettings();
            BanNetworkAccessHandler banNetworkAccessHandler = new BanNetworkAccessHandler();
            Aspose.Words.LoadOptions loadOptions = new Aspose.Words.LoadOptions();
            Document doc;
            try
            {
                loadOptions.ResourceLoadingCallback = banNetworkAccessHandler;
                doc = new Document(fileStream, loadOptions);
            }
            catch (Aspose.Words.FileCorruptedException)
            {
                loadOptions.ResourceLoadingCallback = null;
                doc = new Document(fileStream, loadOptions);
            }

            if (!_wordSettings.IsMacroSubstitutionsEnabled)
            {
                // Don't allow dates to change.
                NodeCollection starts = doc.GetChildNodes(NodeType.FieldStart, true);
                foreach (Aspose.Words.Fields.FieldStart start in starts)
                {
                    if (start.FieldType == Aspose.Words.Fields.FieldType.FieldDate || start.FieldType == Aspose.Words.Fields.FieldType.FieldTime)
                    {
                        start.IsLocked = true;
                    }
                }
            }

            DocumentBuilder builder = new DocumentBuilder(doc);
            for (int i = 0; i < doc.Sections.Count; i++)
            {
                Aspose.Words.PageSetup pageSetup = doc.Sections[i].PageSetup;
                pageSetup.SuppressEndnotes = _wordSettings.SuppressEndnotes;
            }

            PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
            pdfSaveOptions.UseCoreFonts = true;
            pdfSaveOptions.FontEmbeddingMode = PdfFontEmbeddingMode.EmbedAll;
            pdfSaveOptions.EmbedFullFonts = true;
            pdfSaveOptions.Compliance = PdfCompliance.Pdf15;

            pdfSaveOptions.PageIndex = 0;
            builder.Document.Save(@"c:\temp\x.pdf", pdfSaveOptions);<a class="attachment" href="/uploads/discourse_instance3/57105">20012.rename.zip</a> (8.2 KB)
 
        }

@charvind Could you please attach your input and and output documents here for testing? It seems you have missed to attach them. We will check the issue and provide you more information.

files.zip (982.9 KB)
Files are attached here @alexey.noskov

@charvind Thank you for additional information. I have checked the attached document and did not manage to reproduce the problem using the latest 21.11.0 version of Aspose.Words. As I can see you are using quite old 19.4.0 version. Please use the latest version.