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

Free Support Forum - aspose.com

Newline in PDF

Hi

I am trying to generate a PDF from some XML/XSL.

I have some XML like the following:


I am 6 ft 7 in tall<br>and have no brain<p>If you are interested then please phone me

I need some XSL which replaces the

and
tags in the string in the XML with a newline in the PDF.
How do I do that?

Thanks,
Peter

Hello Peter,

Thanks for considering Aspose.

We are working over this issue and will reply to you soon.

Dear Peter,

New line is supported by #$NL symbol. Please refer to Symbols List and Purpose. But currently we don't know how to formulate the XSL for it. We will investigate this issue and reply to you soon.

You can also refer to HTML Tags in Text.

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

Thanks for considering Aspose.Pdf. I am very sorry to inform you that there is no easy way to replace the

and
tags in the string in the XML with a newline in the PDF. Because the transformation from source code to target is against XML DOM node, such as elements, attributes and text nodes. The Strings in text node can also be processed by XSL functions which handles strings as the way in programming languages. So if you want to replace these tags with “#$NL” you will have to parse the string and substitute the substrings “<br>” and “<p>” in it with “#$NL”.

But there is another way to walk around which may need little processing. You can put the string like “I am 6 ft 7 in tall<br>and have no brain<p>If you are interested then please phone me” in a Text of Aspose.Pdf and set the attribute isHtmlTagSupported of the corresponding Text to be true. The Aspose.Pdf will transform the string into texts in Pdf as below:

I am 6 ft 7 in tall

and have no brain

If you are interested then please phone me