Free Support Forum - aspose.com

Whitespace cr asc(13)

I am using pdf1.bindxml with an xslfile to format an xml document but the resulting .pdf document does not preserve the CRs.


I believe that the XML has the CRs in it.

Is there some “preservewhitespace” property required?

Dear njr,

Thank you for considering Aspose.

You should set the IsSpaced to true in order to keep the CRs. If it still can’t work, please attach your xml and xsl file and let me test it.

Thanks for the suggestion but I still can’t get it to work.

I attach a text file containing stripped down versions of the XSL and XML files.

The code used is essentially as follows:

dim pdf1 as pdf = new pdf
pdf1.IsSpaced = True
pdf1.BindXML(“xmlfilepath”,“xslfilepath”)
pdf1.Save(“printfile.pdf”,SaveType.OpenInAcrobat,Response)
Response.End

Dear njr,

Thank you for considering Aspose.

When I add IsSpaced="true" to the Text element in your xsl file, the generated pdf is correct.

Thanks - that works.

It’s a pity that it cannot be set globally - it makes you wonder what is the purpose of the pdf object having this property?

Dear njr,

Thank you for considering Aspose.

I will fix this bug in the next hotfix.