Improve img quality export.
This commit is contained in:
@@ -45,6 +45,7 @@ import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import java.io.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class ExporterFactory {
|
||||
private static final String GROUP_NODE_NAME = "g";
|
||||
@@ -147,6 +148,9 @@ public class ExporterFactory {
|
||||
svgXml = svgXml.replaceAll("NaN,", "0");
|
||||
svgXml = svgXml.replaceAll(",NaN", "0");
|
||||
|
||||
// Bratik do not manage nbsp properly.
|
||||
svgXml = svgXml.replaceAll(Pattern.quote(" ")," ");
|
||||
|
||||
Document document;
|
||||
try {
|
||||
final Reader in = new CharArrayReader(svgXml.toCharArray());
|
||||
|
@@ -59,14 +59,8 @@ public class TransformView extends AbstractView {
|
||||
// Build format properties ...
|
||||
final ExportProperties properties = ExportProperties.create(exportFormat);
|
||||
if (properties instanceof ExportProperties.ImageProperties) {
|
||||
final String sizeStr = request.getParameter(IMG_SIZE_PARAMETER);
|
||||
final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties;
|
||||
if (sizeStr != null) {
|
||||
final ExportProperties.ImageProperties.Size size = ExportProperties.ImageProperties.Size.valueOf(sizeStr);
|
||||
imageProperties.setSize(size);
|
||||
} else {
|
||||
imageProperties.setSize(ExportProperties.ImageProperties.Size.MEDIUM);
|
||||
}
|
||||
imageProperties.setSize(ExportProperties.ImageProperties.Size.LARGE);
|
||||
}
|
||||
|
||||
// Set format content type...
|
||||
@@ -103,6 +97,4 @@ public class TransformView extends AbstractView {
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
private static final String IMG_SIZE_PARAMETER = "imgSize";
|
||||
}
|
||||
|
Reference in New Issue
Block a user