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.
HTMLArea Word Wrap Issue
Re: HTMLArea Word Wrap Issue
Support · Nov 4, 2019Hello,
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
Re: HTMLArea Word Wrap Issue
Forum member · Nov 5, 2019There 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.
Re: HTMLArea Word Wrap Issue
Forum member · Nov 6, 2019Here 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
Re: HTMLArea Word Wrap Issue
Forum member · Nov 6, 2019Forgot to include ceTe dll version #: 10.17.0.39634
There is no way to attach a PDF.
Re: HTMLArea Word Wrap Issue
Support · Nov 6, 2019Hi,
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
Re: HTMLArea Word Wrap Issue
Support · Nov 6, 2019Hi,
Thanks for the example output PDF. We are looking into it and will get you more details shortly.
Thanks,
ceTe Software Support Team
Re: HTMLArea Word Wrap Issue
Support · Nov 8, 2019Hi,
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 [^a|mailto:support@dynamicpdf.com|opennewwindow|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
Re: HTMLArea Word Wrap Issue
Forum member · Nov 8, 2019I have sent an email containing complete C# code as well as a copy of the PDF output.
Re: HTMLArea Word Wrap Issue
Support · Nov 21, 2019
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