Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

JBPM-3924 - Fixed image (png and svg) that are stored in guvnor to use #13

Closed
wants to merge 1 commit into from

2 participants

@cristianonicolai
Collaborator

formatted svg instead. Not generating images with large empty spaces.

@cristianonicolai cristianonicolai JBPM-3924 - Fixed image (png and svg) that are stored in guvnor to use
formatted svg instead. Not generating images with large empty spaces.
6c3c1b0
@tsurdilo
Owner

this has already been applied to master branch. don't think there is need for this pull request any more.

@tsurdilo tsurdilo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 15, 2013
  1. @cristianonicolai

    JBPM-3924 - Fixed image (png and svg) that are stored in guvnor to use

    cristianonicolai authored
    formatted svg instead. Not generating images with large empty spaces.
This page is out of date. Refresh to see the latest.
View
10 src/main/java/org/jbpm/designer/web/server/TransformerServlet.java
@@ -120,7 +120,7 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
resp.setContentType("text/plain");
resp.getWriter().write("<object data=\"data:application/pdf;base64," + Base64.encodeBase64(bout.toByteArray()) + "\" type=\"application/pdf\"></object>");
} else {
- storeInRepository(uuid, rawSvg, transformto, processid, repository);
+ storeInRepository(uuid, formattedSvg, transformto, processid, repository);
resp.setContentType("application/pdf");
if (processid != null) {
@@ -446,7 +446,7 @@ private void addBpmnDiInfo(Definitions def, String gpd) {
}
}
- private void storeInRepository(String uuid, String rawSvg, String transformto, String processid, Repository repository) {
+ private void storeInRepository(String uuid, String formattedSvg, String transformto, String processid, Repository repository) {
try {
if(processid != null) {
Asset<byte[]> processAsset = repository.loadAsset(uuid);
@@ -475,14 +475,14 @@ private void storeInRepository(String uuid, String rawSvg, String transformto, S
if (transformto.equals(TO_PDF)) {
PDFTranscoder t = new PDFTranscoder();
TranscoderInput input = new TranscoderInput(new StringReader(
- rawSvg));
+ formattedSvg));
TranscoderOutput output = new TranscoderOutput(outputStream);
t.transcode(input, output);
} else if (transformto.equals(TO_PNG)) {
PNGTranscoder t = new PNGTranscoder();
t.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "screen");
TranscoderInput input = new TranscoderInput(new StringReader(
- rawSvg));
+ formattedSvg));
TranscoderOutput output = new TranscoderOutput(outputStream);
try {
t.transcode(input, output);
@@ -492,7 +492,7 @@ private void storeInRepository(String uuid, String rawSvg, String transformto, S
}
} else if(transformto.equals(TO_SVG)) {
OutputStreamWriter outStreamWriter = new OutputStreamWriter(outputStream);
- outStreamWriter.write(rawSvg);
+ outStreamWriter.write(formattedSvg);
outStreamWriter.close();
}
AssetBuilder builder = AssetBuilderFactory.getAssetBuilder(Asset.AssetType.Byte);
Something went wrong with that request. Please try again.