Package org.jpedal.manipulator
Class ScalePageContent
java.lang.Object
org.jpedal.manipulator.ScalePageContent
- All Implemented Interfaces:
Manipulation
Scales and translates page content in a document
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The scaled content will be anchored to the bottom of the pagestatic final int
The scaled content will be anchored to the bottom left of the pagestatic final int
The scaled content will be anchored to the bottom right of the pagestatic final int
The scaled content will be anchored to the center of the pagestatic final int
If custom translation values are usedstatic final int
The scaled content will be anchored to the left of the pagestatic final int
The scaled content will be anchored to the right of the pagestatic final int
The scaled content will be anchored to the top of the pagestatic final int
The scaled content will be anchored to the top left of the pagestatic final int
The scaled content will be anchored to the top right of the page -
Constructor Summary
ConstructorsConstructorDescriptionScalePageContent
(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 TypeMethodDescriptionvoid
apply
(org.jpedal.io.annotation.utils.AnnotInfo info) Applies the manipulation to the current document
-
Field Details
-
CUSTOM
public static final int CUSTOMIf custom translation values are used- See Also:
-
CENTER
public static final int CENTERThe scaled content will be anchored to the center of the page- See Also:
-
BOTTOM_LEFT
public static final int BOTTOM_LEFTThe scaled content will be anchored to the bottom left of the page- See Also:
-
TOP_LEFT
public static final int TOP_LEFTThe scaled content will be anchored to the top left of the page- See Also:
-
TOP_RIGHT
public static final int TOP_RIGHTThe scaled content will be anchored to the top right of the page- See Also:
-
BOTTOM_RIGHT
public static final int BOTTOM_RIGHTThe scaled content will be anchored to the bottom right of the page- See Also:
-
TOP
public static final int TOPThe scaled content will be anchored to the top of the page- See Also:
-
BOTTOM
public static final int BOTTOMThe scaled content will be anchored to the bottom of the page- See Also:
-
LEFT
public static final int LEFTThe scaled content will be anchored to the left of the page- See Also:
-
RIGHT
public static final int RIGHTThe scaled content will be anchored to the right 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 scalescaleX
- 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 usingPdfManipulator.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 usingPdfManipulator.getPageMediaBox(int)
.
-
ScalePageContent
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 scalescaleX
- 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
Description copied from interface:Manipulation
Applies the manipulation to the current document- Specified by:
apply
in interfaceManipulation
- Parameters:
info
- theAnnotInfo
object for the currently loaded document- Throws:
IOException
- if the manipulation cannot be applied to the document
-