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 declares 45 methods for PdfFileStamp objects in .NET programs. Available methods include: AddFooter, AddGrayscaleImageStamp, AddHeader, AddImageStamp, AddPageNumber, AddPageNumbers, AddStamp, AddTextStamp, AddWatermark, BindPdf, Close, Dispose, and 2 additional methods. 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(inputStream: Stream)Bind a PDF document from a stream 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.
Close()Close the document and save to the output path.
Dispose()IDisposable implementation; delegates to Close.
AddStamp(stamp: Stamp)Add a facade stamp to the bound document.
AddHeader(formattedText: FormattedText, topMargin: float)Adds the text as a header centered at the top of every page, topMargin points below the top edge, with left and right margins of 36 points.
AddHeader(formattedText: FormattedText, topMargin: float, leftMargin: float, rightMargin: float)Adds the text as a header on every page, topMargin points below the top edge and centered between the left and right margins (in points).
AddHeader(imageStream: Stream, topMargin: float)Adds the image read from the stream as a header centered at the top of every page, topMargin points below the top edge, with left and right margins of 36 points.
AddHeader(inputStream: Stream, topMargin: float, leftMargin: float, rightMargin: float)Adds the image read from the stream as a header on every page, topMargin points below the top edge and centered between the left and right margins (in points).
AddHeader(imageFile: string, topMargin: float)Adds the image file as a header centered at the top of every page, topMargin points below the top edge, with left and right margins of 36 points.
AddHeader(imageFile: string, topMargin: float, leftMargin: float, rightMargin: float)Adds the image file as a header on every page, topMargin points below the top edge and centered between the left and right margins (in points).
AddFooter(formattedText: FormattedText, bottomMargin: float)Adds the text as a footer centered at the bottom of every page, bottomMargin points above the bottom edge, with left and right margins of 36 points.
AddFooter(formattedText: FormattedText, bottomMargin: float, leftMargin: float, rightMargin: float)Adds the text as a footer on every page, bottomMargin points above the bottom edge and centered between the left and right margins (in points).
AddFooter(imageStream: Stream, bottomMargin: float)Adds the image read from the stream as a footer centered at the bottom of every page, bottomMargin points above the bottom edge, with left and right margins of 36 points.
AddFooter(imageStream: Stream, bottomMargin: float, leftMargin: float, rightMargin: float)Adds the image read from the stream as a footer on every page, bottomMargin points above the bottom edge and centered between the left and right margins (in points).
AddFooter(imageFile: string, bottomMargin: float)Adds the image file as a footer centered at the bottom of every page, bottomMargin points above the bottom edge, with left and right margins of 36 points.
AddFooter(imageFile: string, bottomMargin: float, leftMargin: float, rightMargin: float)Adds the image file as a footer on every page, bottomMargin points above the bottom edge and centered between the left and right margins (in points).
AddPageNumber(formattedText: FormattedText)Adds a page number at the bottom middle of every page, using the text and formatting of formattedText; {0} in the text becomes the page number and {1} the page count.
AddPageNumber(formattedText: FormattedText, position: int)Adds a page number to every page at the given position (one of the Pos* constants), using the text and formatting of formattedText; {0} becomes the page number and {1} the page count.
AddPageNumber(formattedText: FormattedText, position: int, leftMargin: float, rightMargin: float, topMargin: float, bottomMargin: float)Adds a page number to every page at the given position (one of the Pos* constants) with the given margins in points, using the text and formatting of formattedText; {0} becomes the page number and {1} the page count.
AddPageNumber(formattedText: FormattedText, x: float, y: float)Adds a page number to every page at (x, y) in points, using the text and formatting of formattedText; {0} becomes the page number and {1} the page count.
AddPageNumber(formatString: string)Adds a page number at the bottom middle of every page; {0} in the format string becomes the page number and {1} the page count.
AddPageNumber(formatString: string, position: int)Adds a page number to every page at the given position (one of the Pos* constants); {0} in the format string becomes the page number and {1} the page count.
AddPageNumber(formatString: string, position: int, leftMargin: float, rightMargin: float, topMargin: float, bottomMargin: float)Adds a page number to every page at the given position (one of the Pos* constants) with the given margins in points; {0} in the format string becomes the page number and {1} the page count.
AddPageNumber(formatString: string, x: float, y: float)Adds a page number to every page at (x, y) in points; {0} in the format string becomes the page number and {1} the page count.
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

 English