congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TranscodingHints
Code IndexAdd Tabnine to your IDE (free)

How to use
TranscodingHints
in
org.apache.batik.transcoder

Best Java code snippets using org.apache.batik.transcoder.TranscodingHints (Showing top 20 results out of 315)

origin: stackoverflow.com

MyTranscoder transcoder = new MyTransCoder();
 TranscodingHints hints = new TranscodingHints();
 hints.put(ImageTranscoder.KEY_WIDTH, width);
 hints.put(ImageTranscoder.KEY_HEIGHT, height);
 transcoder.setTranscodingHints(hints);
 transcoder.transcode(new TranscoderInput(url), null);
 BufferedImage image = transcoder.getImage();
origin: haraldk/TwelveMonkeys

DOMImplementation impl = (DOMImplementation) hints.get(KEY_DOM_IMPLEMENTATION);
document = DOMUtilities.deepCloneDocument(document, impl);
(hints.containsKey(KEY_EXECUTE_ONLOAD) &&
    (Boolean) hints.get(KEY_EXECUTE_ONLOAD) &&
    BaseScriptingEnvironment.isDynamicDocument(ctx, svgDoc));
origin: omero/server

/**
 * Sets the uri of the user stylesheet. The user stylesheet can be used to
 * override styles.
 *
 * @param uri the uri of the user stylesheet
 */
public void setUserStyleSheetURI(String uri) {
  hints.put(ImageTranscoder.KEY_USER_STYLESHEET_URI, uri);
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns the pixel to millimeter conversion factor specified in the
 * <code>TranscodingHints</code> or 0.26458333 if not specified.
 */
public float getPixelUnitToMillimeter() {
  Object obj = SVGAbstractTranscoder.this.hints.get
    (KEY_PIXEL_UNIT_TO_MILLIMETER);
  if (obj != null) {
    return ((Float)obj).floatValue();
  }
  return super.getPixelUnitToMillimeter();
}
origin: apache/batik

/**
 * Copies all of the mappings from the specified <code>Map</code>
 * to this <code>TranscodingHints</code>.
 *
 * @param m mappings to be stored in this <code>TranscodingHints</code>.
 * @exception ClassCastException key is not of type
 * <code>TranscodingHints.Key</code>
 */
public void putAll(Map m) {
  if (m instanceof TranscodingHints) {
    putAll(((TranscodingHints) m));
  } else {
    for (Object o : m.entrySet()) {
      Map.Entry entry = (Map.Entry) o;
      put(entry.getKey(), entry.getValue());
    }
  }
}
origin: apache/batik

/**
 * Returns a copy of the transcoding hints of this transcoder.
 */
public TranscodingHints getTranscodingHints() {
  return new TranscodingHints(hints);
}
origin: hs-web/hsweb-printer

public PDFPrinter(List<String> svg) throws TranscoderException {
  this.svg = svg;
  graphics = new PDFDocumentGraphics2D(isTextStroked());
  graphics.getPDFDocument().getInfo().setProducer("Apache FOP Version "
      + Version.getVersion()
      + ": PDF Transcoder for Batik");
  if (hints.containsKey(KEY_DEVICE_RESOLUTION)) {
    graphics.setDeviceDPI(getDeviceResolution());
  }
  try {
    Configuration effCfg = getEffectiveConfiguration();
    if (effCfg != null) {
      PDFDocumentGraphics2DConfigurator configurator
          = new PDFDocumentGraphics2DConfigurator();
      boolean useComplexScriptFeatures = false; //TODO - FIX ME
      configurator.configure(graphics, effCfg, useComplexScriptFeatures);
    } else {
      graphics.setupDefaultFontInfo();
    }
    ((FOPTranscoderUserAgent) userAgent).setFontFamilyResolver(
        new FOPFontFamilyResolverImpl(graphics.getFontInfo()));
  } catch (Exception e) {
    throw new TranscoderException(
        "Error while setting up PDFDocumentGraphics2D", e);
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Replaces the values of all preferences for the transcoding algorithms
 * with the specified hints.
 * @param hints the rendering hints to be set
 */
public void setTranscodingHints(Map hints) {
  this.hints.putAll(hints);
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Removes the value of a single preference for the transcoding process.
 * @param key the key of the hint to remove
 */
public void removeTranscodingHint(TranscodingHints.Key key) {
  hints.remove(key);
}
origin: haraldk/TwelveMonkeys

if (hints.containsKey(KEY_AOI)) {
  Rectangle2D aoi = (Rectangle2D) hints.get(KEY_AOI);
    if (hints.containsKey(ImageTranscoder.KEY_BACKGROUND_COLOR)) {
      Paint bgcolor = (Paint) hints.get(ImageTranscoder.KEY_BACKGROUND_COLOR);
      g2d.setComposite(AlphaComposite.SrcOver);
      g2d.setPaint(bgcolor);
origin: omero/server

/**
 * Sets the alternate stylesheet to use. For further details, you can have
 * a look at the <a href="http://www.w3.org/TR/xml-stylesheet/">Associating
 * Style Sheets with XML documents</a>.
 *
 * @param alternateStylesheet the alternate stylesheet to use if possible
 */
public void setAlternateStylesheet(String alternateStylesheet) {
  hints.put(ImageTranscoder.KEY_ALTERNATE_STYLESHEET,
       alternateStylesheet);
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns this user agent's CSS media.
 */
public String getMedia() {
  String s = (String)hints.get(KEY_MEDIA);
  if (s != null) return s;
  return super.getMedia();
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Copies all of the mappings from the specified <code>Map</code>
 * to this <code>TranscodingHints</code>.
 *
 * @param m mappings to be stored in this <code>TranscodingHints</code>.
 * @exception ClassCastException key is not of type
 * <code>TranscodingHints.Key</code>
 */
public void putAll(Map m) {
  if (m instanceof TranscodingHints) {
    putAll(((TranscodingHints) m));
  } else {
    Iterator iter = m.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry entry = (Map.Entry) iter.next();
      put(entry.getKey(), entry.getValue());
    }
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns a copy of the transcoding hints of this transcoder.
 */
public TranscodingHints getTranscodingHints() {
  return new TranscodingHints(hints);
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Constructs a new <code>TranscodingHints</code> with keys and values
 * initialized from the specified Map object (which may be null).
 *
 * @param init a map of key/value pairs to initialize the hints
 *          or null if the object should be empty
 */
public TranscodingHints(Map init) {
  super(7);
  if (init != null) {
    putAll(init);
  }
}
origin: apache/batik

/**
 * Removes the value of a single preference for the transcoding process.
 * @param key the key of the hint to remove
 */
public void removeTranscodingHint(TranscodingHints.Key key) {
  hints.remove(key);
}
origin: apache/fop

/**
 * Returns the device resolution that has been set up.
 * @return the device resolution (in dpi)
 */
protected float getDeviceResolution() {
  if (hints.containsKey(KEY_DEVICE_RESOLUTION)) {
    return (Float) hints.get(KEY_DEVICE_RESOLUTION);
  } else {
    return GraphicsConstants.DEFAULT_DPI;
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Constructs a new transcoder that produces tiff images.
 */
public TIFFTranscoder() { 
  hints.put(KEY_FORCE_TRANSPARENT_WHITE, Boolean.FALSE);
}
origin: stackoverflow.com

FileUtils.writeStringToFile(cssFile, css);
TranscodingHints transcoderHints = new TranscodingHints();
transcoderHints.put(ImageTranscoder.KEY_XML_PARSER_VALIDATING, Boolean.FALSE);
transcoderHints.put(ImageTranscoder.KEY_DOM_IMPLEMENTATION,
    SVGDOMImplementation.getDOMImplementation());
transcoderHints.put(ImageTranscoder.KEY_DOCUMENT_ELEMENT_NAMESPACE_URI,
    SVGConstants.SVG_NAMESPACE_URI);
transcoderHints.put(ImageTranscoder.KEY_DOCUMENT_ELEMENT, "svg");
transcoderHints.put(ImageTranscoder.KEY_USER_STYLESHEET_URI, cssFile.toURI().toString());
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns the user stylesheet specified in the
 * <code>TranscodingHints</code> or null if any.
 */
public String getUserStyleSheetURI() {
  String s = (String)SVGAbstractTranscoder.this.hints.get
    (KEY_USER_STYLESHEET_URI);
  if (s != null)
    return s;
  return super.getUserStyleSheetURI();
}
org.apache.batik.transcoderTranscodingHints

Javadoc

The TranscodingHints class defines a way to pass transcoding parameters or options to any transcoders.

Most used methods

  • put
    Maps the specified key to the specified value in this TranscodingHints object.
  • <init>
    Constructs a new TranscodingHints with keys and values initialized from the specified Map object (wh
  • containsKey
    Returns true if this TranscodingHints contains a mapping for the specified key, false otherwise.
  • get
    Returns the value to which the specified key is mapped.
  • putAll
    Copies all of the keys and corresponding values from the specified TranscodingHints object to thisT
  • remove
    Removes the key and its corresponding value from thisTranscodingHints object.

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now