Converted text become bold

Sample code as followings:

PdfSaveOptions saveOptions = new PdfSaveOptions();

File converted = new File(“C:\output.pdf”);
Document doc = new Document(“C:\nput.docx”);
doc.getChildNodes(NodeType.COMMENT, true).clear();
doc.save(converted.getAbsolutePath(), saveOptions);

The output pdf shows “converted text” in bold. The attached zip file contains input.doc and output.pdf.

Thanks for help!

Ruhongconvertedtext_bold.zip (124.1 KB)

@ruhongcai,

In this case, Aspose.Words mimics the way the Microsoft Word works. We converted your ‘input.docx’ file to PDF format by using Microsoft Word 2016 and attached the resultant file (msw-2016.pdf) here for your reference. You can see that Aspose.Words 18.1 produces an output (see attached 18.1.pdf) similar to Microsoft Word. So, this seems to be an expected behavior. If we can help you with anything else, please feel free to ask.

output-pdfs.zip (43.3 KB)

Hi,

Thanks for the email, your zip file seems that you could not reproduce the problem. I might not describe the problem clearly, I attach the zip again including the screenshot which shows the issue. Thanks!

Ruhongconvertedtext_bold.zip (298.6 KB)

@ruhongcai,

MS Word shows different soft color because header content resides on a different Story. Please Double-click anywhere on the top margin of your document. You will then enter the header footer Story in editing mode. This will also show you the actual color of content in header. When you enter the header Story in editing mode, MS Word will then show different color of Main Story (“Simple text” color will toggle).