Word Wrap not working while converting from html to pdf using Aspose.Html converter

Hi,

I am using aspose.html to convert html to pdf. I am creating the html using the RazorEngine and have some CSS styling in it to wrap the text. I am using overflow-wrap: break-word; which works fine in the html but looks like the styling is not applied when the html is converted to pdf. I’ve uploaded the .7z file that has both the pdf and the html for your reference. Can you please help me resolve this issue? Thanks,
Word_Wrap_Issue.7z (138.1 KB)

@vcmehta

Can you please share the sample code snippet that you are using to convert the document? We checked the attached PDF and it looked like it was generated using Aspose.PDF for .NET. Please try to test the scenario using latest available version and if issue still persists, please share the sample code. We will further proceed to assist you accordingly.

Yes, you are right. The pdf was generated using Aspose.PDF. Below is the code that I am using:

            // Create an instance of MemoryStreamProvider
            using var streamProvider = new MemoryStreamProvider();

            // Initialize an HTML document
            using var document = new HTMLDocument(reportConfiguration.ReportText, ".");

            //set the margins
            var options = new PdfSaveOptions();
            options.PageSetup.FirstPage = new Aspose.Html.Drawing.Page(new Margin(10, 20, 10, 115));
            options.PageSetup.AnyPage = new Aspose.Html.Drawing.Page(new Margin(10, 50, 10, 115));

            // Convert HTML to PDF using the MemoryStreamProvider
            Converter.ConvertHTML(document, options, streamProvider);

            // Get access to the memory stream that contains the result data
            var memory = streamProvider.Streams.First();
            memory.Seek(0, SeekOrigin.Begin);

            // Open document
            var pdfDocument = new Document(memory);              

            using var documentStream = new MemoryStream();
            pdfDocument.Save(documentStream);

            var documentBytes = documentStream.ToArray();
            var reportBase64 = Convert.ToBase64String(documentBytes);

I updated the aspose package to the below mentioned versions that our license supports but that didn’t fix the word wrapping. let me know. Thanks

Aspose.HTML: Version=“23.5.0” />
Aspose.PDF: Version=“23.4.0” />

@vcmehta

We tested with 23.7 version of the API and were able to replicate the issue using Aspose.HTML.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): HTMLNET-4786

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks. Looking forward for this to be resolved.