Class ScalePageContent

java.lang.Object
org.jpedal.manipulator.ScalePageContent
All Implemented Interfaces:
Manipulation

public class ScalePageContent extends Object implements Manipulation
Scales and translates page content in a document
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The scaled content will be anchored to the bottom of the page
    static final int
    The scaled content will be anchored to the bottom left of the page
    static final int
    The scaled content will be anchored to the bottom right of the page
    static final int
    The scaled content will be anchored to the center of the page
    static final int
    If custom translation values are used
    static final int
    The scaled content will be anchored to the left of the page
    static final int
    The scaled content will be anchored to the right of the page
    static final int
    The scaled content will be anchored to the top of the page
    static final int
    The scaled content will be anchored to the top left of the page
    static final int
    The scaled content will be anchored to the top right of the page
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScalePageContent(PageRanges pages, float scaleX, float scaleY, float translateX, float translateY)
    Scales the specified pages' contents and translates the scaled content, leaving the page dimensions intact.
    ScalePageContent(PageRanges pages, float scaleX, float scaleY, int translatePreset)
    Scales the specified page's contents and translates the scaled content to an anchor location, leaving the page dimensions intact.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(org.jpedal.io.annotation.utils.AnnotInfo info)
    Applies the manipulation to the current document

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CUSTOM

      public static final int CUSTOM
      If custom translation values are used
      See Also:
    • CENTER

      public static final int CENTER
      The scaled content will be anchored to the center of the page
      See Also:
    • BOTTOM_LEFT

      public static final int BOTTOM_LEFT
      The scaled content will be anchored to the bottom left of the page
      See Also:
    • TOP_LEFT

      public static final int TOP_LEFT
      The scaled content will be anchored to the top left of the page
      See Also:
    • TOP_RIGHT

      public static final int TOP_RIGHT
      The scaled content will be anchored to the top right of the page
      See Also:
    • BOTTOM_RIGHT

      public static final int BOTTOM_RIGHT
      The scaled content will be anchored to the bottom right of the page
      See Also:
    • TOP

      public static final int TOP
      The scaled content will be anchored to the top of the page
      See Also:
    • BOTTOM

      public static final int BOTTOM
      The scaled content will be anchored to the bottom of the page
      See Also:
    • LEFT

      public static final int LEFT
      The scaled content will be anchored to the left of the page
      See Also:
  • Constructor Details

    • ScalePageContent

      public ScalePageContent(PageRanges pages, float scaleX, float scaleY, float translateX, float translateY)
      Scales the specified pages' contents and translates the scaled content, leaving the page dimensions intact.
      Scaling values must be expressed as a fraction.
      Parameters:
      pages - the pages whose content to scale
      scaleX - the horizontal scaling factor, where 100% == 1.0f. Values greater than 1.0f may result in content appearing outside the media box.
      scaleY - the vertical scaling factor, where 100% == 1.0f Values greater than 1.0f may result in content appearing outside the media box.
      translateX - the horizontal translation value. Values outside the range [0.0, mediaBoxWidth - (mediaBoxWidth * shrinkX)] may result in content appearing outside the media box. You may query a page's media box using PdfManipulator.getPageMediaBox(int) getPageMediaBox(int)}.
      translateY - the vertical translation value. Values outside the range [0.0, mediaBoxHeight - (mediaBoxHeight * shrinkY)] may result in content appearing outside the media box. You may query a page's media box using PdfManipulator.getPageMediaBox(int).
    • ScalePageContent

      public ScalePageContent(PageRanges pages, float scaleX, float scaleY, int translatePreset)
      Scales the specified page's contents and translates the scaled content to an anchor location, leaving the page dimensions intact.
      Scaling values must be expressed as a fraction.
      Parameters:
      pages - the pages whose content to scale
      scaleX - the horizontal scaling factor, where 100% == 1.0f. Values greater than 1.0f may result in content appearing outside the media box.
      scaleY - the vertical scaling factor, where 100% == 1.0f Values greater than 1.0f may result in content appearing outside the media box.
      translatePreset - anchors the content to a side or corner of the page.
  • Method Details

    • apply

      public void apply(org.jpedal.io.annotation.utils.AnnotInfo info) throws IOException
      Description copied from interface: Manipulation
      Applies the manipulation to the current document
      Specified by:
      apply in interface Manipulation
      Parameters:
      info - the AnnotInfo object for the currently loaded document
      Throws:
      IOException - if the manipulation cannot be applied to the document