PdfFileStamp

Overview

PdfFileStamp is a class in Aspose.PDF FOSS for .NET. Inherits from: System.IDisposable.

Facade for adding stamps, page numbers, headers, footers, and watermarks.

This class provides 44 methods for working with PdfFileStamp objects in .NET programs. Available methods include: AddFooter, AddGrayscaleImageStamp, AddHeader, AddImageStamp, AddPageNumber, AddPageNumbers, AddStamp, AddTextStamp, AddWatermark, BindPdf, Close, Dispose, and 2 additional methods. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: ConvertTo, Document, InputFile, InputStream, KeepSecurity, NumberingStyle, and 16 more.

Properties

NameTypeAccessDescription
DocumentDocumentReadThe bound document.
InputFilestring?Read/WriteInput file path.
OutputFilestring?Read/WriteOutput file path.
PageWidthfloatReadWidth of the first page in the bound document.
PageHeightfloatReadHeight of the first page in the bound document.
InputStreamStream?Read/WriteInput stream — setting binds the PDF eagerly so page-dimension queries reflect the new input.
OutputStreamStream?Read/WriteOutput stream — Save() writes here when no explicit destination is passed.
KeepSecurityboolRead/WriteIf true, the source document’s security (encryption, permissions) should be preserved on Save.
NumberingStyleNumberingStyleRead/WriteNumbering style for AddPageNumber.
OptimizeSizeboolRead/WriteHint: optimize the saved output for size.
PageNumberRotationfloatRead/WriteRotation (degrees) applied to AddPageNumber stamps.
StampIdintRead/WriteStamp identifier embedded as a content-stream comment by AddStamp.
StartingNumberintRead/WriteStarting number used by AddPageNumber.
ConvertToPdfFormatRead/WritePDF/A or PDF version target for the saved output.
PosUpperLeftintReadGets the pos upper left.
PosUpperMiddleintReadGets the pos upper middle.
PosUpperRightintReadGets the pos upper right.
PosSidesLeftintReadGets the pos sides left.
PosSidesRightintReadGets the pos sides right.
PosBottomLeftintReadGets the pos bottom left.
PosBottomMiddleintReadGets the pos bottom middle.
PosBottomRightintReadGets the pos bottom right.

Methods

SignatureDescription
PdfFileStamp()Default constructor for stateless mode.
PdfFileStamp(document: Document)Bind an already-loaded Document.
PdfFileStamp(document: Document, outputStream: Stream)Bind a Document and pre-configure an output stream for the parameterless Save.
PdfFileStamp(document: Document, outputFile: string)Bind a Document and pre-configure an output file path for the parameterless Save.
PdfFileStamp(inputStream: Stream, outputStream: Stream)Open from an input stream, writing to an output stream on Save.
PdfFileStamp(inputStream: Stream, outputStream: Stream, keepSecurity: bool)Open from an input stream, writing to an output stream on Save.
PdfFileStamp(inputFile: string, outputFile: string)Open from an input file, writing to an output file on Save.
PdfFileStamp(inputFile: string, outputFile: string, keepSecurity: bool)Open from an input file, writing to an output file on Save.
PdfFileStamp(inputData: byte[], outputPath: string)Create a PdfFileStamp for given input bytes, saving to the given output file on Close().
BindPdf(path: string)Bind a PDF document from a file path for stateful processing.
BindPdf(doc: Document)Bind a PDF document for stateful processing.
Save(destFile: string)Save the modified document to the specified path.
Save(destStream: Stream)Save the modified document to a stream.
Save()Save the modified document to a byte array.
AddStamp(stamp: Stamp)Add a facade stamp to the bound document.
Close()Close the document and save to the output path.
Dispose()IDisposable implementation; delegates to Close.
AddHeader(formattedText: FormattedText, topMargin: float)Calls AddHeader on this PdfFileStamp instance.
AddHeader(formattedText: FormattedText, topMargin: float, leftMargin: float, rightMargin: float)
AddHeader(imageStream: Stream, topMargin: float)
AddHeader(inputStream: Stream, topMargin: float, leftMargin: float, rightMargin: float)
AddHeader(imageFile: string, topMargin: float)
AddHeader(imageFile: string, topMargin: float, leftMargin: float, rightMargin: float)
AddFooter(formattedText: FormattedText, bottomMargin: float)Calls AddFooter on this PdfFileStamp instance.
AddFooter(formattedText: FormattedText, bottomMargin: float, leftMargin: float, rightMargin: float)
AddFooter(imageStream: Stream, bottomMargin: float)
AddFooter(imageStream: Stream, bottomMargin: float, leftMargin: float, rightMargin: float)
AddFooter(imageFile: string, bottomMargin: float)
AddFooter(imageFile: string, bottomMargin: float, leftMargin: float, rightMargin: float)
AddPageNumber(formattedText: FormattedText)Calls AddPageNumber on this PdfFileStamp instance.
AddPageNumber(formattedText: FormattedText, position: int)
AddPageNumber(formattedText: FormattedText, position: int, leftMargin: float, rightMargin: float, topMargin: float, bottomMargin: float)
AddPageNumber(formattedText: FormattedText, x: float, y: float)
AddPageNumber(formatString: string)
AddPageNumber(formatString: string, position: int)
AddPageNumber(formatString: string, position: int, leftMargin: float, rightMargin: float, topMargin: float, bottomMargin: float)
AddPageNumber(formatString: string, x: float, y: float)
AddTextStamp(input: byte[], text: string, hAlign: HorizontalAlignment, vAlign: VerticalAlignment, fontSize: double, fontName: string)Add a text stamp to all pages.
AddPageNumbers(input: byte[], format: string, hAlign: HorizontalAlignment, vAlign: VerticalAlignment, fontSize: double)Add page numbers to all pages.
AddHeader(input: byte[], text: string, fontSize: double, margin: double)Add a header text to all pages.
AddFooter(input: byte[], text: string, fontSize: double, margin: double)Add a footer text to all pages.
AddWatermark(input: byte[], text: string, fontSize: double, rotation: double, opacity: double)Add a watermark text to all pages.
AddImageStamp(input: byte[], rgbPixels: byte[], width: int, height: int, displayWidth: double, displayHeight: double, x: double, y: double)Add an RGB image stamp to all pages.
AddGrayscaleImageStamp(input: byte[], grayPixels: byte[], width: int, height: int, displayWidth: double, displayHeight: double, x: double, y: double)Add a grayscale image stamp to all pages.

See Also