Hi,
We are using Aspose 22.5 version, and 1252 encoding type but the bullets are still off. I have attached the screenshot with the Html file. Would you please check.screenshot-1 (1).png (89.7 KB)
bulletIssue.zip (235.8 KB)
@kainat123 This is not a bug. This is an expected behavior. In your HTML bullet and content are represented by separate DIV
elements:
<div style=" float:left; margin-left:20pt; line-height:12pt; margin-top:6.1pt; margin-bottom:0pt; text-align:left; width:10pt;white-space:nowrap;">
<font style="font-style:normal;letter-spacing:0.2pt;">•</font>
<br>
</div>
<div style=" margin-top:6.1pt; margin-bottom:0pt; line-height:12pt; text-align:left; margin-left:30pt;">
<font style="letter-spacing:0.2pt;">“DGCL” are to the Delaware General Corporation Law as the same may be amended from time to time;</font><font style="font-style:normal;letter-spacing:0.2pt;"> </font>
</div>
While importing to Aspose.Words DOM, each DIV in imported as a paragraph, so as a result you get one paragraph with bullet and another with content:
By the way MS Word behaves the same.
To get the desired output you should either use <span>
for bullet within the same <div>
:
<div style=" margin-top:6.1pt; margin-bottom:0pt; line-height:12pt; text-align:left; margin-left:30pt;">
<font style="font-style:normal;letter-spacing:0.2pt;">•</font>
<font style="letter-spacing:0.2pt;">“DGCL” are to the Delaware General Corporation Law as the same may be amended from time to time;</font><font style="font-style:normal;letter-spacing:0.2pt;"> </font>
</div>
or better to use standard unordered list (<ul>
).
Thanks for the update on Bullets issue. But there is another issue in the converted doc, it looks like the left and right margins are off, which appears to be causing the text on the right to get cut off on some pages. please use the above mentioned html for testing and Screenshot of issue has been attached. Would you please look into it?margin-issue.png (45.1 KB)
@kainat123 The problem is that HTML documents does not have page setup. While importing HTML document to Aspose.Words.Document
object (which is designed to work with MS Word documents) standard page size is sued and in your case some content does not fit this size. For example, if you change page orientation to landscape in the document, the output look much better:
HtmlLoadOptions opt = new HtmlLoadOptions();
opt.BlockImportMode = BlockImportMode.Preserve;
Document doc = new Document(@"C:\Temp\bulletIssue.html", opt);
foreach (Section sect in doc.Sections)
sect.PageSetup.Orientation = Orientation.Landscape;
doc.Save(@"C:\Temp\out.docx");
cutoff-Issue.zip (683.5 KB)
Hi,
I am currently using Aspose 22.11 and have tried to convert the sections in Landscape mode which do not fit in the page, but I am still getting margins and text cut off from the right side. screenshot and respective Html and Docx documents have been attached. landscape-cuttoff.PNG (44.3 KB)
table-cutoff.PNG (32.7 KB)
@kainat123 I have checked the conversion of your document on my side and cannot reproduce the problem. Here is the output produced on my side: out.docx (476.8 KB)