ImageStamp

Overview

ImageStamp is a class in Aspose.PDF FOSS for .NET. Inherits from: BaseParagraph.

Adds an image to a PDF page.

This class provides 12 methods for working with ImageStamp objects in .NET programs. Available methods include: ApplyTo, Clone, FromGrayscale, FromJpeg, FromJpegStream, FromPngData, FromRgb, ImageStamp, Put, setStampId. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: AlternativeText, Background, DisplayHeight, DisplayWidth, Height, HorizontalAlignment, and 23 more.

Properties

NameTypeAccessDescription
XdoubleRead/WritePosition X in points from bottom-left.
YdoubleRead/WritePosition Y in points from bottom-left.
DisplayWidthdoubleRead/WriteDisplay width in points.
DisplayHeightdoubleRead/WriteDisplay height in points.
WidthdoubleRead/WriteAlias for DisplayWidth.
HeightdoubleRead/WriteAlias for DisplayHeight.
XIndentdoubleRead/WriteHorizontal offset from the stamp’s anchor point.
YIndentdoubleRead/WriteVertical offset from the stamp’s anchor point.
QualityintRead/WriteJPEG quality (1..100).
AlternativeTextstring?Read/WriteTagged-PDF alternate text for accessibility.
BackgroundboolRead/WriteWhether the stamp is drawn behind the page content (true) or on top of it (false).
OpacitydoubleRead/WriteOpacity, 0.0 (transparent) … 1.0 (opaque).
ZoomdoubleRead/WriteUniform zoom percentage applied to the image.
ZoomXdoubleRead/WriteHorizontal zoom percentage.
ZoomYdoubleRead/WriteVertical zoom percentage.
RotateRotationRead/WriteRotation enum (0/90/180/270 in degrees).
RotateAngledoubleRead/WriteArbitrary rotation angle in degrees.
StampIdintRead/WriteThe /StampId entry written into the stamp’s resource entry.
ImageSystem.IO.StreamReadRead-only view of the original source bytes (or the decoded image bytes when constructed via FromRgb / FromGrayscale).
HorizontalAlignmentHorizontalAlignmentRead/WriteHorizontal alignment applied to this paragraph.
VerticalAlignmentVerticalAlignmentRead/WriteVertical alignment applied to this paragraph.
MarginMarginInfo?Read/WriteOuter-margin info applied to this paragraph.
IsFirstParagraphInColumnboolRead/WriteForce the paragraph to start a new column.
IsKeptWithNextboolRead/WriteKeep this paragraph on the same page as the next one.
IsInNewPageboolRead/WriteForce the paragraph to start on a new page.
IsInLineParagraphboolRead/WriteInline paragraph flag (does not start a new line).
HyperlinkTextstring?Read/WriteLegacy string-typed hyperlink target.
HyperlinkHyperlink?Read/WriteTyped hyperlink decoration applied to the paragraph.
ZIndexintRead/WriteZ-order index used by the DOM renderer.

Methods

SignatureDescription
ImageStamp(image: System.IO.Stream)Construct from an image stream (auto-detects JPEG vs PNG by header).
ImageStamp(fileName: string)Construct from an image file path (auto-detects JPEG vs PNG by header).
setStampId(id: int)Set the stamp’s PDF /StampId entry.
Put(page: Page)Alias for ApplyTo.
FromRgb(pixelData: byte[], width: int, height: int)Create an image stamp from raw RGB pixel data.
FromGrayscale(pixelData: byte[], width: int, height: int)Create an image stamp from raw grayscale pixel data.
FromJpeg(jpegData: byte[], width: int, height: int)Create an image stamp from JPEG bytes.
FromJpeg(jpegData: byte[])Create an image stamp from JPEG bytes, auto-detecting dimensions from the JPEG header.
FromJpegStream(jpegStream: Stream)Create an image stamp from a JPEG file stream.
FromPngData(pngData: byte[])Create an image stamp from PNG file data.
ApplyTo(page: Page)Add this image to a page.
Clone()Shallow clone — copies scalar/ref-shared state.

See Also