Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.fdf

public Class FDFIconFit

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Imports
org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSName, org.apache.pdfbox.pdmodel.common.COSObjectable, .PDRange

This represents an Icon fit dictionary for an FDF field.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private final COSDictionary
public static final String
SCALE_OPTION_ALWAYS

A scale option.

public static final String
SCALE_OPTION_NEVER

A scale option.

public static final String
public static final String
public static final String
SCALE_TYPE_ANAMORPHIC

Scale to fill with of annotation, disregarding aspect ratio.

public static final String
SCALE_TYPE_PROPORTIONAL

Scale to fit width or height, smaller of two, while retaining aspect ration.

Constructor Summary

AccessConstructor and Description
public
FDFIconFit()

Default constructor.

public
FDFIconFit(COSDictionary
The icon fit dictionary.
f
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public COSDictionary

Returns:

The cos object that matches this Java object.
getCOSObject
()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

public PDRange

Returns:

The fractional space to allocate.
getFractionalSpaceToAllocate
()

This is guaranteed to never return null.

public String

Returns:

The scale option.
getScaleOption
()

This will get the scale option.

public String

Returns:

The scale type.
getScaleType
()

This will get the scale type.

public void
setFractionalSpaceToAllocate(PDRange
The space to allocate.
space
)

This will set frational space to allocate.

public void
setScaleOption(String
The scale option.
option
)

This will set the scale option for the icon.

public void
setScaleToFitAnnotation(boolean
The flag value.
value
)

This will tell the icon to scale.

public void
setScaleType(String
The scale type.
scale
)

This will set the scale type.

public boolean

Returns:

A flag telling if the icon should scale.
shouldScaleToFitAnnotation
()

This will tell if the icon should scale to fit the annotation bounds.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fitback to summary
private final COSDictionary fit
SCALE_OPTION_ALWAYSback to summary
public static final String SCALE_OPTION_ALWAYS

A scale option.

SCALE_OPTION_NEVERback to summary
public static final String SCALE_OPTION_NEVER

A scale option.

SCALE_OPTION_ONLY_WHEN_ICON_IS_BIGGERback to summary
public static final String SCALE_OPTION_ONLY_WHEN_ICON_IS_BIGGER

A scale option.

SCALE_OPTION_ONLY_WHEN_ICON_IS_SMALLERback to summary
public static final String SCALE_OPTION_ONLY_WHEN_ICON_IS_SMALLER

A scale option.

SCALE_TYPE_ANAMORPHICback to summary
public static final String SCALE_TYPE_ANAMORPHIC

Scale to fill with of annotation, disregarding aspect ratio.

SCALE_TYPE_PROPORTIONALback to summary
public static final String SCALE_TYPE_PROPORTIONAL

Scale to fit width or height, smaller of two, while retaining aspect ration.

Constructor Detail

FDFIconFitback to summary
public FDFIconFit()

Default constructor.

FDFIconFitback to summary
public FDFIconFit(COSDictionary f)

Constructor.

Parameters
f:COSDictionary

The icon fit dictionary.

Method Detail

getCOSObjectback to summary
public COSDictionary getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

Returns:COSDictionary

The cos object that matches this Java object.

Annotations
@Override
getFractionalSpaceToAllocateback to summary
public PDRange getFractionalSpaceToAllocate()

This is guaranteed to never return null.
To quote the PDF Spec "An array of two numbers between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left and bottom of the icon. A value of [0.0 0.0] positions the icon at the bottom-left corner of the annotation rectangle; a value of [0.5 0.5] centers it within the rectangle. This entry is used only if the icon is scaled proportionally. Default value: [0.5 0.5]."

Returns:PDRange

The fractional space to allocate.

getScaleOptionback to summary
public String getScaleOption()

This will get the scale option. See the SCALE_OPTION_XXX constants. This is guaranteed to never return null. Default: Always

Returns:String

The scale option.

getScaleTypeback to summary
public String getScaleType()

This will get the scale type. See the SCALE_TYPE_XXX constants. This is guaranteed to never return null. Default: Proportional

Returns:String

The scale type.

setFractionalSpaceToAllocateback to summary
public void setFractionalSpaceToAllocate(PDRange space)

This will set frational space to allocate.

Parameters
space:PDRange

The space to allocate.

setScaleOptionback to summary
public void setScaleOption(String option)

This will set the scale option for the icon. Set the SCALE_OPTION_XXX constants.

Parameters
option:String

The scale option.

setScaleToFitAnnotationback to summary
public void setScaleToFitAnnotation(boolean value)

This will tell the icon to scale.

Parameters
value:boolean

The flag value.

setScaleTypeback to summary
public void setScaleType(String scale)

This will set the scale type. See the SCALE_TYPE_XXX constants.

Parameters
scale:String

The scale type.

shouldScaleToFitAnnotationback to summary
public boolean shouldScaleToFitAnnotation()

This will tell if the icon should scale to fit the annotation bounds. Default: false

Returns:boolean

A flag telling if the icon should scale.