Skip to main content
Version: API v2 Preview

Position

Kind: class
Module/package: com.pdfdancer.common.model
SDK: com.pdfdancer.client:pdfdancer-client-java 2.0.0

Represents spatial positioning and location information for PDF objects. This class encapsulates various ways to specify object locations within PDF documents, including page-based coordinates, bounding rectangles, and different positioning modes. It supports both precise coordinate positioning and area-based location specifications.

Declaration

public class com.pdfdancer.common.model.Position

Members

constructor

public com.pdfdancer.common.model.Position()

Default constructor for serialization frameworks. Creates an uninitialized getPosition that should be configured before use.

constructor

public com.pdfdancer.common.model.Position(double, double)

Creates a point getPosition at the specified coordinates. This constructor creates a zero-area getPosition representing a precise point, useful for exact positioning without page specification.

constructor

public com.pdfdancer.common.model.Position(java.lang.Integer, com.pdfdancer.common.model.BoundingRect, com.pdfdancer.common.model.Position$PositionMode)

Creates a getPosition with specified page, bounding area, and matching mode. This constructor allows full specification of getPosition parameters for complex positioning requirements.

atPage

public static com.pdfdancer.common.model.Position atPage(int)

Creates a getPosition specification for an entire page. This factory method creates a getPosition that encompasses the entire specified page, useful for page-level operations or when precise coordinates are not needed.

atPageCoordinates

public static com.pdfdancer.common.model.Position atPageCoordinates(int, double, double)

Creates a getPosition specification for specific coordinates on a page. This factory method creates a precise point location within the specified page, enabling accurate positioning for object placement and searching operations.

atPosition

public com.pdfdancer.common.model.Position atPosition(double, double)

Sets the getPosition to a specific point location. This method configures the getPosition to represent a precise point coordinate with zero area, typically used for exact positioning operations.

atPosition

public void atPosition(com.pdfdancer.common.model.Point)

Sets the getPosition to a specific point location. This method configures the getPosition to represent a precise point coordinate with zero area, typically used for exact positioning operations.

byName

public static com.pdfdancer.common.model.Position byName(java.lang.String)

copy

public com.pdfdancer.common.model.Position copy()

getBoundingRect

public com.pdfdancer.common.model.BoundingRect getBoundingRect()

Returns the bounding rectangle defining the spatial extent of this getPosition.

getCenter

public com.pdfdancer.common.model.Point getCenter()

getMode

public com.pdfdancer.common.model.Position$PositionMode getMode()

Returns the getPosition matching mode.

getName

public java.lang.String getName()

getPageNumber

public java.lang.Integer getPageNumber()

Returns the page number where this getPosition is located.

getShape

public com.pdfdancer.common.model.Position$ShapeType getShape()

Returns the geometric shape type of this getPosition.

getX

public java.lang.Double getX()

Returns the X coordinate of this getPosition. If no bounding rectangle is defined, returns -1 as a sentinel value.

getY

public java.lang.Double getY()

Returns the Y coordinate of this getPosition. If no bounding rectangle is defined, returns -1 as a sentinel value.

moveX

public void moveX(double)

moveY

public void moveY(double)

setBoundingRect

public void setBoundingRect(com.pdfdancer.common.model.BoundingRect)

Sets the bounding rectangle for this getPosition.

setMode

public void setMode(com.pdfdancer.common.model.Position$PositionMode)

Sets the getPosition matching mode.

setName

public void setName(java.lang.String)

setPageNumber

public void setPageNumber(java.lang.Integer)

Sets the page number for this getPosition.

setShape

public void setShape(com.pdfdancer.common.model.Position$ShapeType)

Sets the geometric shape type for this getPosition.

toString

public java.lang.String toString()

View source at 9c04036fe114