Package org.apache.fop.svg

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


      /*
       * according to https: &aid=1921334&group_id=7118 Submitted By:
       * Frank Spangenberg (f_spangenberg) Summary: Large mind maps
       * produce invalid PDF
       */
      pdfTranscoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_HEIGHT, new Float(19200));
      pdfTranscoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_WIDTH, new Float(19200));
      pdfTranscoder.addTranscodingHint(ImageTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER, 25.4f/72f/UITools.FONT_SCALE_FACTOR);
      /* end patch */
      final Document doc = g2d.getDOMFactory();
      final Element rootE = doc.getDocumentElement();
View Full Code Here


       * according to https: &aid=1921334&group_id=7118 Submitted By:
       * Frank Spangenberg (f_spangenberg) Summary: Large mind maps
       * produce invalid PDF
       */
      pdfTranscoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_HEIGHT, new Float(19200));
      pdfTranscoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_WIDTH, new Float(19200));
      pdfTranscoder.addTranscodingHint(ImageTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER, 25.4f/72f/UITools.FONT_SCALE_FACTOR);
      /* end patch */
      final Document doc = g2d.getDOMFactory();
      final Element rootE = doc.getDocumentElement();
      g2d.getRoot(rootE);
View Full Code Here

       * Frank Spangenberg (f_spangenberg) Summary: Large mind maps
       * produce invalid PDF
       */
      pdfTranscoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_HEIGHT, new Float(19200));
      pdfTranscoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_WIDTH, new Float(19200));
      pdfTranscoder.addTranscodingHint(ImageTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER, 25.4f/72f/UITools.FONT_SCALE_FACTOR);
      /* end patch */
      final Document doc = g2d.getDOMFactory();
      final Element rootE = doc.getDocumentElement();
      g2d.getRoot(rootE);
      final TranscoderInput input = new TranscoderInput(doc);
View Full Code Here

        } else if (transformto != null && transformto.equals(TO_PNG)) {
            try {
                if(respaction != null && respaction.equals(RESPACTION_SHOWURL)) {
                    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");
View Full Code Here

                    } else {
                        resp.setHeader("Content-Disposition", "attachment; filename=\"" + uuid + ".png\"");
                    }

                    PNGTranscoder t = new PNGTranscoder();
                    t.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "screen");
                    TranscoderInput input = new TranscoderInput(new StringReader(
                            formattedSvg));
                    TranscoderOutput output = new TranscoderOutput(
                            resp.getOutputStream());
                    t.transcode(input, output);
View Full Code Here

                            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));
                    TranscoderOutput output = new TranscoderOutput(outputStream);
                    try {
                        t.transcode(input, output);
View Full Code Here

  private static byte[] getPDFByteArray(final Document document, final int width)
  {
    // Create a pdf transcoder
    final PDFTranscoder t = new PDFTranscoder();
    t.addTranscodingHint(PDFTranscoder.KEY_AUTO_FONTS, false);
    t.addTranscodingHint(PDFTranscoder.KEY_WIDTH, new Float(width));
    TranscoderInput input = new TranscoderInput(document);
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final TranscoderOutput output = new TranscoderOutput(baos);
    // Save the image.
View Full Code Here

  private static byte[] getPDFByteArray(final Document document, final int width)
  {
    // Create a pdf transcoder
    final PDFTranscoder t = new PDFTranscoder();
    t.addTranscodingHint(PDFTranscoder.KEY_AUTO_FONTS, false);
    t.addTranscodingHint(PDFTranscoder.KEY_WIDTH, new Float(width));
    TranscoderInput input = new TranscoderInput(document);
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final TranscoderOutput output = new TranscoderOutput(baos);
    // Save the image.
    try {
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.