PageNumberStamp

PageNumberStamp

Overview

PageNumberStamp is a class in Aspose.PDF FOSS for Java. Inherits from: TextStamp.

Represents a page number stamp that renders the current page number and total page count on each page of the PDF document.

This class provides 53 methods for working with PageNumberStamp objects in Java programs. Available methods include: PageNumberStamp, TextStamp, formatPageNumber, getBottomMargin, getFormat, getHeight, getHorizontalAlignment, getLeftMargin, getOpacity, getRightMargin, getRotate, getRotateAngle, and 40 additional methods. All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package. Properties: background, bottomMargin, format, height, horizontalAlignment, leftMargin, and 18 more.

Properties

NameTypeAccessDescription
formatStringReadReturns the format string for the page number.
startingNumberintReadReturns the starting page number.
valueStringReadReturns the text content of this stamp.
textStateTextStateReadReturns the text state for this stamp, creating it lazily if needed.
wordWrapModeTextFormattingOptions.WordWrapModeReadReturns the word wrap mode for this stamp’s text.
textAlignmentHorizontalAlignmentReadReturns the text alignment within the stamp area.
xIndentdoubleReadReturns the horizontal position (X indent) of the stamp in points.
yIndentdoubleReadReturns the vertical position (Y indent) of the stamp in points.
widthdoubleReadReturns the width of the stamp area in points.
heightdoubleReadReturns the height of the stamp area in points.
backgroundbooleanReadReturns whether this stamp is rendered behind the page content.
rotateRotationReadReturns the rotation enum for this stamp.
rotateAngledoubleReadReturns the rotation angle of the stamp in degrees.
opacitydoubleReadReturns the opacity (transparency) of the stamp.
horizontalAlignmentHorizontalAlignmentReadReturns the horizontal alignment of the stamp on the page.
verticalAlignmentVerticalAlignmentReadReturns the vertical alignment of the stamp on the page.
leftMargindoubleReadReturns the left margin of the stamp in points.
rightMargindoubleReadReturns the right margin of the stamp in points.
topMargindoubleReadReturns the top margin of the stamp in points.
bottomMargindoubleReadReturns the bottom margin of the stamp in points.
stampIdintReadReturns the stamp identifier.
zoomdoubleReadReturns the zoom (scale) factor for the stamp.
zoomXdoubleReadReturns the horizontal zoom (scale) factor for the stamp.
zoomYdoubleReadReturns the vertical zoom (scale) factor for the stamp.

Methods

SignatureDescription
PageNumberStamp()Creates a new PageNumberStamp with the default format “Page # of $P”.
PageNumberStamp(format: String)Creates a new PageNumberStamp with the specified format string.
getFormat()StringReturns the format string for the page number.
setFormat(format: String)Sets the format string for the page number.
getStartingNumber()intReturns the starting page number.
setStartingNumber(startingNumber: int)Sets the starting page number.
formatPageNumber(pageIndex: int, totalPages: int)StringFormats the page number text for the given page index and total page count.
TextStamp(value: String)Creates a new TextStamp with the given text value.
getValue()StringReturns the text content of this stamp.
setValue(value: String)Sets the text content of this stamp.
getTextState()TextStateReturns the text state for this stamp, creating it lazily if needed.
setTextState(textState: TextState)Sets the text state for this stamp.
getWordWrapMode()TextFormattingOptions.WordWrapModeReturns the word wrap mode for this stamp’s text.
setWordWrapMode(wordWrapMode: TextFormattingOptions.WordWrapMode)Sets the word wrap mode for this stamp’s text.
getTextAlignment()HorizontalAlignmentReturns the text alignment within the stamp area.
setTextAlignment(textAlignment: HorizontalAlignment)Sets the text alignment within the stamp area.
put(page: Page)Applies this text stamp to the given page.
getXIndent()doubleReturns the horizontal position (X indent) of the stamp in points.
setXIndent(xIndent: double)Sets the horizontal position (X indent) of the stamp in points.
getYIndent()doubleReturns the vertical position (Y indent) of the stamp in points.
setYIndent(yIndent: double)Sets the vertical position (Y indent) of the stamp in points.
getWidth()doubleReturns the width of the stamp area in points.
setWidth(width: double)Sets the width of the stamp area in points.
getHeight()doubleReturns the height of the stamp area in points.
setHeight(height: double)Sets the height of the stamp area in points.
isBackground()booleanReturns whether this stamp is rendered behind the page content.
setBackground(background: boolean)Sets whether this stamp is rendered behind the page content.
getRotate()RotationReturns the rotation enum for this stamp.
setRotate(rotate: Rotation)Sets the rotation using the {@link Rotation} enum.
getRotateAngle()doubleReturns the rotation angle of the stamp in degrees.
setRotateAngle(rotateAngle: double)Sets the rotation angle of the stamp in degrees.
getOpacity()doubleReturns the opacity (transparency) of the stamp.
setOpacity(opacity: double)Sets the opacity (transparency) of the stamp.
getHorizontalAlignment()HorizontalAlignmentReturns the horizontal alignment of the stamp on the page.
setHorizontalAlignment(horizontalAlignment: HorizontalAlignment)Sets the horizontal alignment of the stamp on the page.
getVerticalAlignment()VerticalAlignmentReturns the vertical alignment of the stamp on the page.
setVerticalAlignment(verticalAlignment: VerticalAlignment)Sets the vertical alignment of the stamp on the page.
getLeftMargin()doubleReturns the left margin of the stamp in points.
setLeftMargin(leftMargin: double)Sets the left margin of the stamp in points.
getRightMargin()doubleReturns the right margin of the stamp in points.
setRightMargin(rightMargin: double)Sets the right margin of the stamp in points.
getTopMargin()doubleReturns the top margin of the stamp in points.
setTopMargin(topMargin: double)Sets the top margin of the stamp in points.
getBottomMargin()doubleReturns the bottom margin of the stamp in points.
setBottomMargin(bottomMargin: double)Sets the bottom margin of the stamp in points.
getStampId()intReturns the stamp identifier.
setStampId(stampId: int)Sets the stamp identifier.
getZoom()doubleReturns the zoom (scale) factor for the stamp.
setZoom(zoom: double)Sets the zoom (scale) factor for the stamp.
getZoomX()doubleReturns the horizontal zoom (scale) factor for the stamp.
setZoomX(zoomX: double)Sets the horizontal zoom (scale) factor for the stamp.
getZoomY()doubleReturns the vertical zoom (scale) factor for the stamp.
setZoomY(zoomY: double)Sets the vertical zoom (scale) factor for the stamp.

See Also

 English