return printImage;
}
public JRPrintImage createImageFromComponentElement(JRComponentElement componentElement) throws JRException {
HtmlComponent html = (HtmlComponent) componentElement.getComponent();
JEditorPane editorPane = new JEditorPane();
editorPane.setContentType("text/html");
String htmlContent = "";
if (html.getHtmlContentExpression() != null) {
htmlContent = JRExpressionUtil.getExpressionText(html.getHtmlContentExpression());
}
editorPane.setText(htmlContent);
editorPane.setBorder(null);
editorPane.setSize(editorPane.getPreferredSize());
JRBasePrintImage printImage = new JRBasePrintImage(componentElement.getDefaultStyleProvider());
printImage.setX(componentElement.getX());
printImage.setY(componentElement.getY());
printImage.setWidth(componentElement.getWidth());
printImage.setHeight(componentElement.getHeight());
printImage.setScaleImage(html.getScaleType());
printImage.setHorizontalAlignment(html.getHorizontalAlign());
printImage.setVerticalAlignment(html.getVerticalAlign());
printImage.setStyle(componentElement.getStyle());
printImage.setMode(componentElement.getModeValue());
printImage.setBackcolor(componentElement.getBackcolor());
printImage.setForecolor(componentElement.getForecolor());