diff --git a/wise-webapp/src/main/webapp/jsp/template.jsp b/wise-webapp/src/main/webapp/jsp/template.jsp
index 3927388c..cc4ddeb7 100644
--- a/wise-webapp/src/main/webapp/jsp/template.jsp
+++ b/wise-webapp/src/main/webapp/jsp/template.jsp
@@ -11,6 +11,17 @@
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java b/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java
index dbf2c3a4..7857fc8d 100644
--- a/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java
+++ b/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java
@@ -24,10 +24,15 @@ public class ExportTest {
private static final String DATA_DIR_PATH = "src/test/resources/data/svg/";
@Test(dataProvider = "Data-Provider-Function")
- public void exportSvgTest(@NotNull final File svgFile, @NotNull final File pngFile) throws ImporterException, IOException, ExportException, TransformerException, XMLStreamException, JAXBException, SAXException, TranscoderException, ParserConfigurationException {
+ public void exportSvgTest(@NotNull final File svgFile, @NotNull final File pngFile, @NotNull final File pdfFile) throws ImporterException, IOException, ExportException, TransformerException, XMLStreamException, JAXBException, SAXException, TranscoderException, ParserConfigurationException {
String svgXml = FileUtils.readFileToString(svgFile, "UTF-8");
+ exportPng(svgFile, pngFile, svgXml);
+ exportPdf(svgFile, pdfFile, svgXml);
+ }
+
+ private void exportPng(File svgFile, File pngFile, String svgXml) throws ParserConfigurationException, TranscoderException, IOException, SAXException, XMLStreamException, TransformerException, JAXBException, ExportException {
final ExportFormat format = ExportFormat.PNG;
final ExportProperties properties = ExportProperties.create(format);
final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties;
@@ -47,6 +52,24 @@ public class ExportTest {
}
}
+ private void exportPdf(File svgFile, File pdfFile, String svgXml) throws ParserConfigurationException, TranscoderException, IOException, SAXException, XMLStreamException, TransformerException, JAXBException, ExportException {
+ final ExportFormat format = ExportFormat.PDF;
+ final ExportProperties properties = ExportProperties.create(format);
+
+ String baseUrl = svgFile.getParentFile().getAbsolutePath() + "/../../../../../../wise-editor/src/main/webapp";
+ ExporterFactory factory = new ExporterFactory(new File(baseUrl));
+ // Write content ...
+ if (pdfFile.exists()) {
+ // Export mile content ...
+ final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ factory.export(properties, null, bos, svgXml);
+ } else {
+ OutputStream outputStream = new FileOutputStream(pdfFile, false);
+ factory.export(properties, null, outputStream, svgXml);
+ outputStream.close();
+ }
+ }
+
//This function will provide the parameter data
@DataProvider(name = "Data-Provider-Function")
public Object[][] parameterIntTestProvider() {
@@ -59,11 +82,11 @@ public class ExportTest {
}
});
- final Object[][] result = new Object[svgFile.length][2];
+ final Object[][] result = new Object[svgFile.length][3];
for (int i = 0; i < svgFile.length; i++) {
File freeMindFile = svgFile[i];
final String name = freeMindFile.getName();
- result[i] = new Object[]{freeMindFile, new File(DATA_DIR_PATH, name.substring(0, name.lastIndexOf(".")) + ".png")};
+ result[i] = new Object[]{freeMindFile, new File(DATA_DIR_PATH, name.substring(0, name.lastIndexOf(".")) + ".png"),new File(DATA_DIR_PATH, name.substring(0, name.lastIndexOf(".")) + ".pdf")};
}
return result;
diff --git a/wise-webapp/src/test/resources/data/svg/bug-nbsp.pdf b/wise-webapp/src/test/resources/data/svg/bug-nbsp.pdf
new file mode 100644
index 00000000..cb5c03b6
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/bug-nbsp.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/bug1.pdf b/wise-webapp/src/test/resources/data/svg/bug1.pdf
new file mode 100644
index 00000000..99449864
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/bug1.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/bug2.pdf b/wise-webapp/src/test/resources/data/svg/bug2.pdf
new file mode 100644
index 00000000..51f2283f
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/bug2.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/bug3.pdf b/wise-webapp/src/test/resources/data/svg/bug3.pdf
new file mode 100644
index 00000000..ebd3a1bd
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/bug3.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/bug3.png b/wise-webapp/src/test/resources/data/svg/bug3.png
new file mode 100644
index 00000000..5c37b8f8
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/bug3.png differ
diff --git a/wise-webapp/src/test/resources/data/svg/bug3.svg b/wise-webapp/src/test/resources/data/svg/bug3.svg
new file mode 100644
index 00000000..cff6fb03
--- /dev/null
+++ b/wise-webapp/src/test/resources/data/svg/bug3.svg
@@ -0,0 +1,7536 @@
+
diff --git a/wise-webapp/src/test/resources/data/svg/map-3.0.pdf b/wise-webapp/src/test/resources/data/svg/map-3.0.pdf
new file mode 100644
index 00000000..20d8416f
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/map-3.0.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/map1.pdf b/wise-webapp/src/test/resources/data/svg/map1.pdf
new file mode 100644
index 00000000..3bf6ebda
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/map1.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/map2.pdf b/wise-webapp/src/test/resources/data/svg/map2.pdf
new file mode 100644
index 00000000..3b653088
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/map2.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/map3.pdf b/wise-webapp/src/test/resources/data/svg/map3.pdf
new file mode 100644
index 00000000..8ee84c3c
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/map3.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/map4.pdf b/wise-webapp/src/test/resources/data/svg/map4.pdf
new file mode 100644
index 00000000..364a532d
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/map4.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/map5.pdf b/wise-webapp/src/test/resources/data/svg/map5.pdf
new file mode 100644
index 00000000..dff43035
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/map5.pdf differ
diff --git a/wise-webapp/src/test/resources/data/svg/map6.pdf b/wise-webapp/src/test/resources/data/svg/map6.pdf
new file mode 100644
index 00000000..3df39a0f
Binary files /dev/null and b/wise-webapp/src/test/resources/data/svg/map6.pdf differ