Package org.apache.fop.svg

Examples of org.apache.fop.svg.PDFTranscoder.transcode()


            out = new java.io.BufferedOutputStream(out);
            try {
                TranscoderOutput output = new TranscoderOutput(out);
               
                //Do the transformation
                transcoder.transcode(input, output);
            } finally {
                out.close();
            }
        } finally {
            in.close();
View Full Code Here


      g2d.getRoot(rootE);
      final TranscoderInput input = new TranscoderInput(doc);
      final FileOutputStream ostream = new FileOutputStream(chosenFile);
      final BufferedOutputStream bufStream = new BufferedOutputStream(ostream);
      final TranscoderOutput output = new TranscoderOutput(bufStream);
      pdfTranscoder.transcode(input, output);
      ostream.flush();
      ostream.close();
    }
    catch (final Exception ex) {
      org.freeplane.core.util.LogUtils.warn(ex);
View Full Code Here

                if(respaction != null && respaction.equals(RESPACTION_SHOWURL)) {
                    ByteArrayOutputStream bout = new ByteArrayOutputStream();
                    PDFTranscoder t = new PDFTranscoder();
                    TranscoderInput input = new TranscoderInput(new StringReader(formattedSvg));
                    TranscoderOutput output = new TranscoderOutput(bout);
                    t.transcode(input, output);
                    resp.setCharacterEncoding("UTF-8");
                    resp.setContentType("text/plain");

                    resp.getWriter().write("<object data=\"data:application/pdf;base64," + Base64.encodeBase64(bout.toByteArray()) "\" type=\"application/pdf\"></object>");
                } else {
View Full Code Here

                    }

                    PDFTranscoder t = new PDFTranscoder();
                    TranscoderInput input = new TranscoderInput(new StringReader(formattedSvg));
                    TranscoderOutput output = new TranscoderOutput(resp.getOutputStream());
                    t.transcode(input, output);
                }
            } catch (TranscoderException e) {
                resp.sendError(500, e.getMessage());
            }
        } else if (transformto != null && transformto.equals(TO_PNG)) {
View Full Code Here

                    ByteArrayOutputStream bout = new ByteArrayOutputStream();
                    PNGTranscoder t = new PNGTranscoder();
                    t.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "screen");
                    TranscoderInput input = new TranscoderInput(new StringReader(formattedSvg));
                    TranscoderOutput output = new TranscoderOutput(bout);
                    t.transcode(input, output);
                    resp.setCharacterEncoding("UTF-8");
                    resp.setContentType("text/plain");
                    resp.getWriter().write("<img src=\"data:image/png;base64," + Base64.encodeBase64(bout.toByteArray()) + "\">");
                } else {
                    storeInRepository(uuid, rawSvg, transformto, processid, repository);
View Full Code Here

                    t.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "screen");
                    TranscoderInput input = new TranscoderInput(new StringReader(
                            formattedSvg));
                    TranscoderOutput output = new TranscoderOutput(
                            resp.getOutputStream());
                    t.transcode(input, output);
                }
            } catch (TranscoderException e) {
                resp.sendError(500, e.getMessage());
            }
        } else if (transformto != null && transformto.equals(TO_SVG)) {
View Full Code Here

                if (transformto.equals(TO_PDF)) {
                    PDFTranscoder t = new PDFTranscoder();
                    TranscoderInput input = new TranscoderInput(new StringReader(
                            rawSvg));
                    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));
View Full Code Here

                    t.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "screen");
                    TranscoderInput input = new TranscoderInput(new StringReader(
                            rawSvg));
                    TranscoderOutput output = new TranscoderOutput(outputStream);
                    try {
                        t.transcode(input, output);
                    } catch (Exception e) {
                        // issue with batik here..do not make a big deal
                        _logger.debug(e.getMessage());
                    }
                } else if(transformto.equals(TO_SVG)) {
View Full Code Here

        out = new java.io.BufferedOutputStream(out);
        try {
        TranscoderOutput output = new TranscoderOutput(out);
   
        // Do the transformation
        transcoder.transcode(input, output);
     
        } finally {
          out.close();
        }
    } finally {
View Full Code Here

            out = new java.io.BufferedOutputStream(out);
            try {
                TranscoderOutput output = new TranscoderOutput(out);
               
                //Do the transformation
                transcoder.transcode(input, output);
            } finally {
                out.close();
            }
        } finally {
            in.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.