mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
Fix PDF export.
This commit is contained in:
parent
f52a75ac79
commit
b914bbb8a8
@ -22,7 +22,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public enum ExportFormat {
|
||||
SVG("image/svg+xml", "svg"),
|
||||
JPEG("image/jpeg", "jpg"),
|
||||
JPG("image/jpeg", "jpg"),
|
||||
PNG("image/png", "png"),
|
||||
PDF("application/pdf", "pdf"),
|
||||
FREEMIND("application/freemind", "mm"),
|
||||
|
@ -32,7 +32,7 @@ public class ExportProperties {
|
||||
|
||||
public static ExportProperties create(final ExportFormat format) {
|
||||
ExportProperties result;
|
||||
if (format == ExportFormat.JPEG || format == ExportFormat.PNG) {
|
||||
if (format == ExportFormat.JPG || format == ExportFormat.PNG) {
|
||||
result = new ImageProperties(format);
|
||||
} else {
|
||||
result = new GenericProperties(format);
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
package com.wisemapping.exporter;
|
||||
|
||||
import com.wisemapping.model.MindMap;
|
||||
import org.apache.batik.transcoder.Transcoder;
|
||||
import org.apache.batik.transcoder.TranscoderException;
|
||||
import org.apache.batik.transcoder.TranscoderInput;
|
||||
@ -79,7 +78,7 @@ public class ExporterFactory {
|
||||
transcoder.transcode(input, trascoderOutput);
|
||||
break;
|
||||
}
|
||||
case JPEG: {
|
||||
case JPG: {
|
||||
// Create a JPEG transcoder
|
||||
final Transcoder transcoder = new JPEGTranscoder();
|
||||
transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(.99));
|
||||
|
@ -28,7 +28,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -116,7 +115,7 @@ public class TransformerController extends BaseController {
|
||||
case PNG:
|
||||
result = this.transformPng(svg);
|
||||
break;
|
||||
case JPEG:
|
||||
case JPG:
|
||||
result = this.transformJpeg(svg);
|
||||
break;
|
||||
case PDF:
|
||||
|
@ -83,7 +83,7 @@ public class TransformView extends AbstractView {
|
||||
ExporterFactory.export(properties, content, outputStream, null);
|
||||
} else if (exportFormat == ExportFormat.WISEMAPPING) {
|
||||
final Object mindmap = viewMap.get("mindmap");
|
||||
StreamResult result = new StreamResult(outputStream);
|
||||
final StreamResult result = new StreamResult(outputStream);
|
||||
jaxbMarshaller.marshal(mindmap, result);
|
||||
} else {
|
||||
ExporterFactory.export(properties, null, outputStream, content);
|
||||
|
@ -37,9 +37,8 @@
|
||||
<entry key="freemind" value="application/freemind"/>
|
||||
<entry key="pdf" value="application/pdf"/>
|
||||
<entry key="png" value="image/png"/>
|
||||
<entry key="jpeg" value="image/jpg"/>
|
||||
<entry key="jpg" value="image/jpeg"/>
|
||||
<entry key="svg" value="image/svg+xml"/>
|
||||
<entry key="svg" value="application/svg+xml"/>
|
||||
<entry key="wxml" value="application/wisemapping+xml"/>
|
||||
</map>
|
||||
</property>
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
<select name="imgFormat" id="imgFormat" style="display:none">
|
||||
<option value='png'>PNG</option>
|
||||
<option value='jpeg'>JPEG</option>
|
||||
<option value='jpg'>JPEG</option>
|
||||
</select>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
Loading…
Reference in New Issue
Block a user