Improve img quality export.
@ -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";
|
||||
}
|
||||
|
@ -21,8 +21,7 @@
|
||||
<i><b>This is bold </b></i>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<node CREATED="1354384204994" ID="ID_1523964881" MODIFIED="1354384740867" POSITION="right" TEXT="Child Node">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
@ -33,8 +32,7 @@
|
||||
This is a simple note
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
</map>
|
||||
|
BIN
wise-webapp/src/test/resources/data/svg/bug-nbsp.png
Normal file
After Width: | Height: | Size: 357 KiB |
2251
wise-webapp/src/test/resources/data/svg/bug-nbsp.svg
Normal file
After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 155 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 118 KiB |