Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Remove some of the Text Formatting from the Rich text coming from an DataXML

Avatar

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
dhruvinm
Level 1

03-09-2019

Dear Experts,

I am currently working on the PDF creation for Quotation. Now we have an option to add a "Note" where a Sales Employee can add some text.

And we make that text visible on PDF which is working perfectly fine.

However we want to get rid of the formatting the Sales user has done on the Text Level , Below is the Exact content text.

<ContentText>

<div<div><p>

<span style="font-family: arial ; font-size: 10pt">

<strong>In der Dichtungstechnik ist es gängige Praxis, als Unterstützung einer technischen Absicherung Werkstoffdatenblätter anzufordern.</strong>

</span><br><br>

<span style="font-size: 18pt">In aller Regel handelt es sich hierbei um Werkstoffdaten, die an genormten Prüfplatten ermittelt wurden.

Diese Werkstoffdatenblätter geben anhand der ermittelten Ist-Werte Aufschluss über die Qualität bzw.

das Potential einer Werkstoffrezeptur.</span>

<span style="font-size: 18pt ; color: #e20808">

</span><br><br>

<span style="color: #e20808">Um zusätzliche Aussagen über die Verarbeitungsqualität von Fertigteilen treffen zu können, haben wir bei

TSS darüber hinaus für unsere wichtigsten Compounds sogenannte O-Ring-Datenblätter erstellt, die Ihnen helfen sollen, die Qualität der

Fertigprodukte übergreifend (Qualität der Werkstoffrezeptur und Qualität der Verarbeitung des Werkstoffes) beurteilen zu können.

</span></p></div></div></ContentText>

Now as you can see I want to get rid of font-family , font size and colour.

Can some 1 please help me in this? Thanks a lot for this community. So far it have been great

BR

Dhruvin

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
dhruvinm
Level 1

05-11-2019

Hi BR001

I was able to do it with use of Regex in JS.

so field has Rich text below code I use.

FormQuoteNotification.bdyMain.frmAddInfoBlock.frmInfoBlockCustomerInformation.txtContentValue::initialize - (JavaScript, client)

var tmp = txtContentValue.value.exData.saveXML("pretty");

tmp = tmp.replace(/ style="[^"]*"/g,"");

txtContentValue.value.exData.loadXML(tmp,1,1);

And i used website regexr to find my regular expression.

I hope it will help for users who has similar issue like me.

BR

Dhruvin

Answers (4)

Answers (4)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

10-09-2019

E4X is a obsolete thing, so there's not a lot of info left about it.  It has been retained in Adobe Reader so I suspect it might be for awhile, but I'm not to know.

I gave you a link to sample and there's still some info on MDN, Processing XML with E4X - Archive of obsolete content | MDN

I think you should look at this sort of processing being done on the server, as opposed to to the presentation layer.

But failing that, E4X is probably better than a lot of string manipulations or regex processing.

Avatar

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
dhruvinm
Level 1

10-09-2019

Hi BR001

Thanks for your feedback , Is this markup being passed into the form?  Yes.

We are working on a SAP project where SAP system passes theis info in a field and show the same in a Rich text field on form.

Which works perfect however I want to remove some tags.

To be honest i have no clue what is E4X can u please shade some light in it and how can i use it?

BR

Dhruvin

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

09-09-2019

Is this markup being passed into the form?  It doesn't look like the sort of markup you get from a rich text field within a form.

Maybe look at using E4X, a JavaScript extension to handle XML, to remove the bits you don't want. There is a sample here  Adobe LiveCycle Designer Cookbooks by BR001: Adding values in a form to an email

E4X has been removed from most JavaScript engines but is still part of Reader, so I guess at some point in the future it will be removed as well.

Avatar

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
dhruvinm
Level 1

09-09-2019

Dear All,

Is above issue not possible to solve?

BR

Dhruvin