PdfFileStamp

Overview

PdfFileStamp is a class in Aspose.Pdf FOSS for Java. Inherits from: AutoCloseable.

Provides methods for adding stamps (text or image) to PDF pages.

Properties

NameTypeAccessDescription
documentDocumentReadReturns the bound document, or {@code null}.
stampIdintReadReturns the stamp id used by convenience stamp helpers.
stampCountintReadReturns the number of stamps that have been added.

Methods

SignatureDescription
PdfFileStamp()Creates a new {@code PdfFileStamp} instance.
PdfFileStamp(inputStream: InputStream, outputStream: OutputStream)Creates a {@code PdfFileStamp} bound to the input stream and configured to
write the stamped result to the supplied output stream when
{@link #close()} is called.
PdfFileStamp(inputFile: String, outputFile: String)Creates a {@code PdfFileStamp} bound to {@code inputFile} and configured
to write the stamped result to {@code outputFile} when {@link #close()}
is called.
PdfFileStamp(document: Document)Creates a {@code PdfFileStamp} bound to {@code document}.
getDocument()DocumentReturns the bound document, or {@code null}.
setInputFile(inputFile: String)Sets the input file path.
bindPdf(inputFile: String)booleanBinds a PDF file to this stamp editor.
bindPdf(inputStream: InputStream)booleanBinds a PDF from an input stream.
bindPdf(document: Document)booleanBinds an existing {@link Document} to this stamp editor.
addStamp(stamp: TextStamp)Adds a text stamp to the list of stamps to apply.
addStamp(stamp: Stamp)Adds a facades {@link Stamp} to the list of stamps to apply.
addFooter(footerText: FormattedText, bottomMargin: float)Adds a text footer to all pages.
addFooter(footerText: FormattedText, bottomMargin: float, leftIndent: float, rightIndent: float)Adds a text footer to all pages with explicit left/right indents
(mirrors the C# {@code AddFooter(FormattedText, float, float, float)}
4-arg overload used by PDFNEWNET-28949 and similar tests).
addFooter(imageFile: String, bottomMargin: float)Adds an image footer to all pages.
addHeader(headerText: FormattedText, topMargin: float)Adds a text header to all pages.
addHeader(imageFile: String, topMargin: float)Adds an image header to all pages.
addPageNumber(formattedText: FormattedText)Adds a page number stamp to all pages using the supplied formatted text
as the source for text value and text state.
getStampId()intReturns the stamp id used by convenience stamp helpers.
setStampId(stampId: int)Sets the stamp id used by subsequent convenience stamp helpers.
getStampCount()intReturns the number of stamps that have been added.
save(outputFile: String)booleanSaves the bound document to a file.
save(outputStream: OutputStream)booleanSaves the bound document to an output stream.
close()Closes the stamp editor and releases the bound document.

See Also