Hi Mike,
I am not using any other style for rendering this xml. But the issue is there only when I am using "prince-svg_1.xml" (xml attached). The chart is rendering correctly when I use "revised-prince-svg.xml".
Code using to render
private byte[] writeToPrincePDF(String xml, String url, coreBarCode barCode) throws Exception
{
xml = readFileAsString("D:/Projects/UMPDev/workspace/ump/openwrap/secure/prince-svg_1.xml");
// Resolve the base URL
String baseURL = (isHttps) ? "https://" : "http://";
if (coreCommon.isDevelopment()) {
baseURL = baseURL + "localhost";
} else {
baseURL = baseURL + serverName;
}
Prince prince = new Prince("prince.exe", new PrinceEventHandler());
prince.setHTML(true);
prince.setBaseURL(baseURL);
StringBuffer exceptionMessage = new StringBuffer();
int dumpDebugLevel = (exceptionMessage.length() > 0 ? coreCommon.DEBUG_LEVEL_ERROR : coreCommon.DEBUG_LEVEL_INFO);
coreCommon.debugDumpContent(xml, "pdf", ".xml", exceptionMessage, dumpDebugLevel);
// Render the PDF to a byte array
ByteArrayInputStream xmlin = new ByteArrayInputStream(xml.getBytes());
ByteArrayOutputStream out = new ByteArrayOutputStream();
prince.convert(xmlin, out);
return out.toByteArray();
}
From my observation of comparing the 2 xml what I understood is as follows:
NB: Please correct me if I am wrong here
The original SVG/XML ("prince-svg_1.xml") includes instructions to draw several lines along the Y axis from point 244 to 476. Since the chart area only extends along the Y axis to point 280, the lines to point 476 extend far beyond the area we want to draw
Thanks,
Sujith
- prince-svg_1.xml 19.5 kB
- revised-prince-svg.xml 19.5 kB