You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PSTranscoder.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.render.ps;
  19. import org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D;
  20. import org.apache.xmlgraphics.java2d.ps.PSDocumentGraphics2D;
  21. /**
  22. * <p>This class enables to transcode an input to a PostScript document.</p>
  23. *
  24. * <p>Two transcoding hints (<code>KEY_WIDTH</code> and
  25. * <code>KEY_HEIGHT</code>) can be used to respectively specify the image
  26. * width and the image height. If only one of these keys is specified,
  27. * the transcoder preserves the aspect ratio of the original image.
  28. *
  29. * <p>The <code>KEY_BACKGROUND_COLOR</code> defines the background color
  30. * to use for opaque image formats, or the background color that may
  31. * be used for image formats that support alpha channel.
  32. *
  33. * <p>The <code>KEY_AOI</code> represents the area of interest to paint
  34. * in device space.
  35. *
  36. * <p>Three additional transcoding hints that act on the SVG
  37. * processor can be specified:
  38. *
  39. * <p><code>KEY_LANGUAGE</code> to set the default language to use (may be
  40. * used by a &lt;switch&gt; SVG element for example),
  41. * <code>KEY_USER_STYLESHEET_URI</code> to fix the URI of a user
  42. * stylesheet, and <code>KEY_PIXEL_TO_MM</code> to specify the pixel to
  43. * millimeter conversion factor.
  44. *
  45. * <p>This work was authored by Keiron Liddle (keiron@aftexsw.com).</p>
  46. */
  47. public class PSTranscoder extends AbstractPSTranscoder {
  48. /**
  49. * Constructs a new {@link PSTranscoder}.
  50. */
  51. public PSTranscoder() {
  52. super();
  53. }
  54. /** {@inheritDoc} */
  55. protected AbstractPSDocumentGraphics2D createDocumentGraphics2D() {
  56. return new PSDocumentGraphics2D(false);
  57. }
  58. }