DoRAdobeSignBlockElement.java 1.42 KB
/*
 * 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;
    }
}