PdfImageContent Class
Represents a PDF content that is a rectangular array of sample values, each representing a color.
public sealed class PdfImageContent : PdfVisualContentElement
Public NotInheritable Class PdfImageContent
Inherits PdfVisualContentElement
- Inheritance:
- PdfImageContent
Properties
Bounds
Gets the bounds of the PdfImageContent.
Property Value
The bounds of the PdfImageContent.
Overrides
Remarks
This member, although exposed as a property for easier debugging, performs complex calculations, so instead of accessing it frequently, cache its result instead.
ElementType
Gets the Image value.
public override PdfContentElementType ElementType { get; }
Public Overrides ReadOnly Property ElementType As PdfContentElementType
Property Value
The Image value.
Overrides
Image
Gets or sets the image.
If IsInline is true, the Image is made read-only. This is required to correctly detect content changes.
If IsInline is true, use Clone() method on the Image to get PdfImage that you want to edit and set the edited clone back to the Image property.
Property Value
The image.
Remarks
If PdfImage value that is being set is associated with another PdfDocument, this property setter will automatically clone it and associate the clone with the current PdfDocument.
Exceptions
Value is null.
The specified image cannot be used as an inline image because either its stream dictionary has indirect descendants or it has stream filters that are not supported in inline images (JPXDecode or JBIG2Decode).
IsInline
Gets or sets a value indicating whether the image content is inlined in the content stream.
If IsInline is true, the Image is made read-only. This is required to correctly detect content changes.
Property Value
true if this image content is inlined in the content stream; otherwise, false.
Exceptions
Value is true and Image stream dictionary has indirect descendants or has stream filters that are not supported in inline images (JPXDecode or JBIG2Decode).
Methods
Save(Stream, ImageSaveOptions)
Saves the image content in the specified stream.
public void Save(Stream stream, ImageSaveOptions options)
Public Sub Save(stream As Stream, options As ImageSaveOptions)
Parameters
stream
- Stream
The stream in which to save the image content.
options
- ImageSaveOptions
The saving options which can be used to define settings for save operation.
Save(String)
Saves the image content to a file with the specified path. Path must include file extension.
Parameters
path
- String
The path to which to save the image content.
Remarks
File extension that is extracted from the path
is used to create the appropriate ImageSaveOptions class instance that is then passed to the Save(String, ImageSaveOptions) method.
Following file extensions are supported:
- Portable Network Graphics: .png
- Joint Photographic Experts Group: .jpeg, .jpg
- Bitmap: .bmp
- Tagged Image File Format: .tiff, .tif
Exceptions
If file extension is not specified or not supported. If file extension is not recognized, use Save(String, ImageSaveOptions) method overload instead.
Save(String, ImageSaveOptions)
Saves the image content to a file with the specified path.
public void Save(string path, ImageSaveOptions options)
Public Sub Save(path As String, options As ImageSaveOptions)
Parameters
path
- String
The path to which to save the image content.
options
- ImageSaveOptions
The saving options which can be used to define settings for save operation.
Inherited Properties
Collection | Gets the PdfContentElementCollection that the PdfContentElement belongs to. (Inherited from PdfContentElement) |
Format | Gets or sets the formatting properties applied to the PdfVisualContentElement. (Inherited from PdfVisualContentElement) |
Next | Gets the next PdfContentElement in the Collection. (Inherited from PdfContentElement) |
Previous | Gets the previous PdfContentElement in the Collection. (Inherited from PdfContentElement) |
Transform | Gets or sets the transformation from the new (transformed) coordinate system to the original (untransformed) coordinate system. All coordinates used after the transformation are expressed in the transformed coordinate system. tipBefore setting the Transform, move PdfVisualContentElement into its own PdfContentGroup so that the transformation is confined to that PdfContentGroup and doesn't have any effect on PdfContentElements outside that PdfContentGroup. (Inherited from PdfVisualContentElement) |