HTMLArea Word Wrap Issue

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v10)  /  HTMLArea Word Wrap Issue

DynamicPDF CoreSuite for .NET (v10) Forum

 Nov 04 2019 10:10 AM
We have many .docx files that we are converting to HTML via Spire.Doc and then pumping that .html file into a new HtmlArea() with custom margins of (t:36pt, r:72pt, b:72pt, l:72pt).

HtmlArea ha = new HtmlArea(sr.BaseStream, 72f, 36f, 468f, 684f - remainingHeight);

The dimensions upon output are correct, but random words get word-wrapped is there a way to prevent this?

Also,  in some lines, the last character of the line is invisible in the pdf (but can be copied and pasted so they are definitely present). In other words, it has width overflow.

Could you provide any information of the above issues?

P.S. I am unable to provide sample docs/output due to security measures.
 Nov 04 2019 1:24 PM
Posted by a ceTe Software moderator
Hello,

What do you mean when you say random words get word-wrapped? Do you mean that the word is split? If so, do you know if the HTML contains a <wbr> tag at the location of the break?

For the invisible character, that will be very hard to troubleshoot without an example as this is not a known issue. Can you send a non sensitive example over to us showing this behavior with the following:
1.        Code sample which uses static data to recreate the behavior.
2.        Sample HTML files (may not be original files but some html file using which we can recreate the  behavior).
3.        Output PDF.
4.        Exact version and build number of the DynamicPDF DLL file used in the application. You can get this information in DLL references properties (Version and Description fields) in Visual Studio.
 
Thanks,
ceTe Software Support Team
 Nov 05 2019 11:40 AM
There are no <wbr> tags, the html is a clean <span>Some text here (ABC)</span>

The random word-break seems to only be breaking incorrectly on text within parenthesis. The parenthesis should move to the next line whenever the first word also is being moved. Parenthesis also seem like they could be related to the invisible characters (width overflow), but I am not certain.

Example:
                         This sentence exceeds ("width")

comes out as

                         This sentence exceeds ("
                         width")
                      
If I can find some time to create files that will recreate the issue, I will get those to you.

Thanks.
 Nov 06 2019 11:30 AM
Here is an example of HTML that will output incorrectly. It seems letter-spacing at a fraction has to do with the issue. Also see the sample line breaking at parenthesis when the parenthesis should carry to the next line instead.

HTML:
<html>
        <body style="pagewidth:612pt;pageheight:792pt;">
                <div class="Section0">
                        <p class="Normal" style="text-align:center;">
                                <span style="letter-spacing:0.25pt;font-size:14pt;font-family:'Times New Roman';mso-bidi-font-family:'Times New Roman';font-weight:bold;">REPRESENTATION LREMIPS SET-ASIDE ALLENGMERENT (BOLOS)</span>
                        </p>
                </div>
                <div class="Section1">
                        <p class="Normal" style="text-align:left;">
                                <span style="font-size:12pt;font-family:'Times New Roman';mso-bidi-font-family:'Times New Roman';">This is a test sentence to show how text inside parenthesis will break incorrectly. The ("parenthesis" should wrap with the first word/char)</span>
                        </p>
                </div>
        </body>
</html>

C#:
            ceTe.DynamicPDF.Document ceteDocument;
            string filePath = @"tf.html";
            hap = new HtmlAreaPadding(36f, 72f, 72f, 72f);            
            ceteDocument = ceTe.DynamicPDF.Document.FromHtml(new Uri(filePath), new PageDimensions(ceTe.DynamicPDF.PageSize.Letter, ceTe.DynamicPDF.PageOrientation.Portrait), hap);
            ceteDocument.Draw(Guid.NewGuid().ToString() + ".pdf");

Thanks
 Nov 06 2019 11:34 AM
Forgot to include ceTe dll version #: 10.17.0.39634

There is no way to attach a PDF.
 Nov 06 2019 12:34 PM
Posted by a ceTe Software moderator
Hi,

We are able to recreate the parenthesis issue and are looking into it.

We are not able to recreate the invisible character issue. Can you provide a code snippet to recreate that?

Thanks,
ceTe Software Support Team
 Nov 06 2019 3:12 PM
Posted by a ceTe Software moderator
Hi,

Thanks for the example output PDF. We are looking into it and will get you more details shortly.

Thanks,
ceTe Software Support Team
 Nov 08 2019 12:40 PM
Posted by a ceTe Software moderator
Hi,
 
We are able to recreate the word break issue and working on a fix for this. We will let you know once the issue is resolved.
 
Regarding the invisible text issue, we are unable to recreate the behavior using the code sample you posted above. Please send over the following information to support@dynamicpdf.com so we can look into it further.
 
1. Code sample which uses static data to recreate the behavior.
2. HTML file or text which we can use to recreate the behavior.
3. Output PDF showing this behavior.
 
Please include the link for the forum in your email.
 
Thanks,
 ceTe Software Support Team
 Nov 08 2019 1:46 PM
I have sent an email containing complete C# code as well as a copy of the PDF output.
 Nov 21 2019 11:42 AM
Posted by a ceTe Software moderator

Hello,

We have an update from our development team and the issues you reported have been fixed. You can download the latest version (v10.19) which includes the fixes from NuGet (Product ID: ceTe.DynamicPDF.CoreSuite.NET) or from our website here.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 2:15 AM.