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

Free Support Forum - aspose.com

Losing extra space characters when converting from WordML to PDF

Hi,


We have wordml documents that has the following in the documents
      <w:r wsp:rsidR=00D35FB8 wsp:rsidRPr=00405395>
<w:rPr>
<w:rFonts w:ascii=Calibri w:h-ansi=Calibri />
<wx:font wx:val=Calibri />
</w:rPr>
<w:t> </w:t>
</w:r>
When we convert the documents to PDF those spaces are not included in the generated PDF file so text that should look like <span style=“font-size:11.0pt;line-height:115%;
font-family:“Calibri”,“sans-serif”;mso-fareast-font-family:Calibri;mso-bidi-font-family:
Arial;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA;mso-no-proof:yes”>Rate Change<span style=“font-size:11.0pt;
line-height:115%;font-family:“Calibri”,“sans-serif”;mso-fareast-font-family:
Calibri;mso-bidi-font-family:“Times New Roman”;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”> from <span style=“font-size:11.0pt;line-height:115%;font-family:“Calibri”,“sans-serif”;
mso-fareast-font-family:Calibri;mso-bidi-font-family:Arial;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes”>California shows up as <span style=“font-size:11.0pt;line-height:115%;
font-family:“Calibri”,“sans-serif”;mso-fareast-font-family:Calibri;mso-bidi-font-family:
Arial;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA;mso-no-proof:yes”>Rate Change
<span style=“font-size:11.0pt;
line-height:115%;font-family:“Calibri”,“sans-serif”;mso-fareast-font-family:
Calibri;mso-bidi-font-family:“Times New Roman”;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>from
<span style=“font-size:11.0pt;line-height:115%;font-family:“Calibri”,“sans-serif”;
mso-fareast-font-family:Calibri;mso-bidi-font-family:Arial;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes”>California.
I have attached an example word document with resulting PDF file.
We are currently using .net Aspose.Words 8.2.1.0.
Regards,
Carl

Hi Carl,

Thanks for your inquiry.

I cannot reproduce this issue using the latest version of Aspose.Words. You can download it from here.

Thanks,

Hi,


I have downloaded the latest version and it appears that the problem is fixed when converting the document to PDF but the problem still exists when converting the document to HTML. Could you please try convert the document to HTML format.

Attached is the HTML file I get when I convert (Saved it as txt as the upload does not allow html files). If it works for you could you please post the code that you use to convert to HTML.

Thank you,

Hi Carl,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I cannot reproduce the problem on my side using the latest version of Aspose.Words (9.4.0). I use the following code for testing:

// Open source document

Document doc = new Document("yourDoc.xml");

// Save output document

doc.Save("out.html", SaveFormat.Html);

I sent the output HTML document to your e-mail.

Best regards,

Hi,


Thanks for the response, I found the issue, it was a coding error on our side.

Thank you,

It is perfect, that you already resolved the problem. Please let me know in case of any issues. I will be glad to help you.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Best regards,