Hi experts,
I've got a static text as follow (xml source)
<draw minH="20mm" name="Text" w="190mm" x="0.6477mm" y="201.971mm">
<ui>
<textEdit>
<margin/>
</textEdit>
</ui>
<value>
<exData contentType="text/html">
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="2.5.6290.0"><p style="text-align:justify;font-family:Arial;text-decoration:none">Il sottoscritto<span style="xfa-spacerun:yes"> </span</body>
</exData>
</value>
</draw>
I need to change the body formatting dynamically.
I've tried with exData.saveXML() function but this returns
<?xml version="1.0" encoding="UTF-8"?>
<exData contentType="text/html"/>
how can I get the body xml?
Best regards,
Dariush
Solved! Go to Solution.
Views
Replies
Total Likes
The floating field is just like any other field on your form except it is resolved at Render time. In your case you shoudl be able to manipulate the content of the TextField programmatically to achieve what you want.
Paul
Views
Replies
Total Likes
You will want to use this expression:
FieldName.value.exData.saveXML("pretty");
The pretty parameter merely gives you a nicer format to view.
Paul
Views
Replies
Total Likes
Hi Paul,
the function saveXML (with or without 'pretty') works fine when applied to a text field, but not when applied to a static text.
This from my point of view.
Dariush.
Views
Replies
Total Likes
I used this:
Text1.value.exData.saveXML("pretty")
It returned this:
<?xml version="1.0" encoding="UTF-8"?>
<exData contentType="text/html" xmlns="http://www.xfa.org/schema/xfa-template/3.5/">
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"><p style="text-decoration:none;letter-spacing:0in">This is a<span style="xfa-spacerun:yes"> </span><span style="font-weight:bold;text-decoration:underline">test<span style="xfa-spacerun:yes"> </span></span></p></body>
</exData>
The body tag has the formatting and the value that is in teh text object.
Are you not seeing the somethig similar?
Paul
Views
Replies
Total Likes
to me it works in textfield case, not in case of static text
please have a look to the following
http://dl.dropbox.com/u/21852816/richText.pdf
Thank you very much.
Dariush.
Views
Replies
Total Likes
It worked for me ...here is what I got back
?xml version="1.0" encoding="UTF-8"?>
<exData contentType="text/html" xmlns="http://www.xfa.org/schema/xfa-template/3.5/">
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="2.5.6290.0"><p style="text-decoration:none">Rich static text<span style="xfa-spacerun:yes"> </span><span xfa:embed="#floatingField000041" xfa:embedMode="raw" xfa:embedType="uri"/></p></body>
</exData>
I highlight the text from the field in the returned value in green
Paul
Views
Replies
Total Likes
Works for me …this is what I get back:
?xml version="1.0" encoding="UTF-8"?>
I highlighted the text is green so you can see it better!
Paul
Views
Replies
Total Likes
Hi Paul,
testing that file with adobe reader X it works, with acrobat 8 no...
Unfortunately I cannot use in production the X version, only the 8.1...
Any workaround?
Best regards,
Dariush.
Views
Replies
Total Likes
Sounds like it might have been a bug in version 8 that has since been fixed .....what if you used a textfield with no borders or background that was set to be locked so that it was not a tab stop for the user ..in this way you are turning it into a text object .
Paul
Views
Replies
Total Likes
Yep this could work, but I wanted to modify the static text content due to a floating field, present in that element, which must be blue during editing and that should become black at printing time.
Walking around forum I've found other approaches to that (i.e. for each floating field use a pair of ffields, one blue, one black, and switch the rawData between the ffields in pre and post print processes), I wanted an easier way to do that.
Dariush.
Views
Replies
Total Likes
The floating field is just like any other field on your form except it is resolved at Render time. In your case you shoudl be able to manipulate the content of the TextField programmatically to achieve what you want.
Paul
Views
Replies
Total Likes
Views
Likes
Replies