DoRAdobeSignBlockElement.java
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.forms.foundation.util.ContentConverterUtils
* com.adobe.xfa.Element
* org.apache.commons.lang3.StringUtils
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.aemds.guide.addon.dor.elements;
import com.adobe.aemds.guide.addon.dor.elements.DoRTextDrawElement;
import com.adobe.forms.foundation.util.ContentConverterUtils;
import com.adobe.xfa.Element;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DoRAdobeSignBlockElement
extends DoRTextDrawElement {
private static Logger logger = LoggerFactory.getLogger(DoRAdobeSignBlockElement.class);
public DoRAdobeSignBlockElement(Element xfaElement) throws Exception {
super(xfaElement);
}
@Override
protected String massageText(String text) {
String result = "";
try {
if (StringUtils.isNotBlank((CharSequence)text)) {
result = text.replaceAll("<br>", "<br> </br>");
result = result.replace("\t", "<span style=\"xfa-tab-count:1\"></span>");
result = ContentConverterUtils.convertToXFAHTML((String)result);
}
}
catch (Exception e) {
logger.error("Unable to convert HTML rich text to XFA compliant rich text.\n" + e.getMessage(), (Throwable)e);
}
return result;
}
}