use of com.twinsoft.convertigo.engine.parsers.PrintScreenRequest in project convertigo by convertigo.
the class XMLPrintScreen method apply.
@Override
public boolean apply(Document xmlDom, Context context) {
try {
HtmlConnector htmlConnector = (HtmlConnector) context.getConnector();
PrintScreenResponse printScreenResponse = htmlConnector.getHtmlParser().makePrintScreen(context, new PrintScreenRequest(height, width, top, left, scale, getImageFormat(), true, minDelay));
if (printScreenResponse != null) {
Document doc = context.outputDocument;
Element root = doc.getDocumentElement();
Element elt = doc.createElement((tagName.equals("") ? getName() : tagName));
elt.setAttribute("height", Integer.toString(printScreenResponse.height));
elt.setAttribute("width", Integer.toString(printScreenResponse.width));
elt.setAttribute("scale", Float.toString(printScreenResponse.scale));
elt.setAttribute("imageFormat", printScreenResponse.imageFormat.name());
if (includeDataUrl) {
elt.setTextContent(printScreenResponse.dataUrlPrefix + printScreenResponse.dataBase64);
} else {
elt.setTextContent(printScreenResponse.dataBase64);
}
root.appendChild(elt);
}
return true;
} catch (Exception ex) {
}
return false;
}
Aggregations