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

Free Support Forum - aspose.com

Html to word & word to pdf conversion

Hello team


We are facing some issues with html to word hence word to pdf conversion using aspose words dll so by this way we overcome the problem of page alignment & width. As html content is adjusted when it is converted into word ; the actual pdf we obtain by word to pdf conversion is perfect.

But there is a problem with that we are using css for underline ,dotted underline ,strikeout in html content and this style not reflect in converted word doc.

Now we have a conclusion that aspose word is not supported dotted underline css.

Please find attached html file.

css used is html:

<link href=“css/diff.css” type=“text/css” rel=“stylesheet”>", "<style type=“text/css”> span.diff-tag-html { font-family: ‘Andale Mono’ monospace; font-size: 80%;} span.diff-tag-removed { font-size: 100%; text-decoration: line-through; color: red;} span.diff-tag-added { font-size: 100%; text-decoration:underline; color: red;} span.diff-tag-conflict { font-size: 100%; background-color: #f781be; } span.diff-html-added { font-size: 100%; cursor: pointer; border-bottom: solid 1px red; color: red;} span.diff-html-removed { font-size: 100%; text-decoration: line-through; cursor: pointer; color: red;} span.diff-html-changed { text-decoration: none; border-bottom:1px dotted; }


code is followed :

Aspose.Words.License licenseWord = new Aspose.Words.License();
licenseWord.SetLicense(@“D:\VED-WORK\CreatePDF\CreatePDF\Styles\Aspose.Total.lic”);
Aspose.Words.LoadOptions loadOptionsword = new Aspose.Words.LoadOptions();
loadOptionsword.LoadFormat = Aspose.Words.LoadFormat.Html;
Document docword = new Document(revisedPath, loadOptionsword);
// Save in the PDF format.
docword.Save(filepathword);

Aspose.Words.LoadOptions loadOptionspdf = new Aspose.Words.LoadOptions();
loadOptionspdf.LoadFormat = Aspose.Words.LoadFormat.Docx;
Document docpdf = new Document(filepathword, loadOptionspdf);
// Save in the PDF format.
docpdf.Save(FilePathPdf);

please do the needfull on early basis.
thanks & regasrds
ved yadav



Hi Ved,


Thanks for your inquiry. First off, in case you’re using an older version of Aspose.Words, I would suggest you please upgrade to the latest version from the following link:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/default.aspx

Secondly, please note that it is not guaranteed that the output Word/Pdf document will look exactly the same as the input HTML file and in your case the latest version of Aspose.Words mimics the way the Microsoft Word imports your HTML to Word format. I have attached a Word document i.e. produced by using Microsoft Word 2013 application here for your reference. You can compare this output with output produced by Aspose.Words for .NET 13.6.0. So, this is the expected behaviour. If we can help you with anything else, please feel free to ask.

Best regards,