Image Public class
Description
An Image is the representation of a graphic element (JPEG, PNG or GIF) that has to be inserted into the document
Diagram
flowchart LR classDef interfaceStyle stroke-dasharray: 5 5; classDef abstractStyle stroke-width:4px subgraph iTextSharp.text iTextSharp.text.Image[[Image]] class iTextSharp.text.Image abstractStyle; iTextSharp.text.Rectangle[[Rectangle]] end subgraph iTextSharp.text.api iTextSharp.text.api.IIndentable[[IIndentable]] class iTextSharp.text.api.IIndentable interfaceStyle; iTextSharp.text.api.ISpaceable[[ISpaceable]] class iTextSharp.text.api.ISpaceable interfaceStyle; end subgraph iTextSharp.text.pdf.interfaces iTextSharp.text.pdf.interfaces.IAccessibleElement[[IAccessibleElement]] class iTextSharp.text.pdf.interfaces.IAccessibleElement interfaceStyle; iTextSharp.text.pdf.interfaces.IAlternateDescription[[IAlternateDescription]] class iTextSharp.text.pdf.interfaces.IAlternateDescription interfaceStyle; end iTextSharp.text.api.IIndentable --> iTextSharp.text.Image iTextSharp.text.api.ISpaceable --> iTextSharp.text.Image iTextSharp.text.pdf.interfaces.IAccessibleElement --> iTextSharp.text.Image iTextSharp.text.pdf.interfaces.IAlternateDescription --> iTextSharp.text.Image iTextSharp.text.Rectangle --> iTextSharp.text.Image
Members
Properties
Public properties
|
Type |
Name |
Methods |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Methods
Public Static methods
|
Returns |
Name |
|---|---|
|
|
( |
Protected Static methods
|
Returns |
Name |
|---|---|
|
|
()
|
Public methods
|
Returns |
Name |
|---|---|
|
|
(
key) |
|
,
> |
() |
|
|
() |
|
|
( |
|
|
()
|
|
|
()
|
|
|
() |
|
|
()
|
|
|
()
|
|
|
()
|
|
|
()
|
|
|
()
|
|
|
() |
|
|
()
|
|
|
( |
|
|
( |
|
|
( |
|
|
( |
|
|
( |
|
|
( |
|
|
(
key,
value) |
|
|
( |
|
|
() |
Details
Summary
An Image is the representation of a graphic element (JPEG, PNG or GIF) that has to be inserted into the document
Inheritance
Constructors
Image [1/2]
Source code
public Image(Uri url)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
url |
the URL where the image can be found. |
Summary
Constructs an Image-object, using an url.
Image [2/2]
Source code
public Image(Image image)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
image |
another Image object. |
Summary
Constructs an Image object duplicate.
Methods
GetInstance [1/18]
Source code
public static Image GetInstance(Image image)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
image |
an Image |
Summary
Gets an instance of an Image.
Returns
an object of type Gif, Jpeg or Png
GetInstance [2/18]
Source code
public static Image GetInstance(Uri url)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
url |
an URL |
Summary
Gets an instance of an Image.
Returns
an object of type Gif, Jpeg or Png
GetInstance [3/18]
Source code
public static Image GetInstance(Uri url, bool recoverFromImageError)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
url |
an URL |
|
|
recoverFromImageError |
Summary
Gets an instance of an Image.
Returns
an object of type Gif, Jpeg or Png
GetInstance [4/18]
Source code
public static Image GetInstance(Stream s)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
s |
GetInstance [5/18]
Source code
public static Image GetInstance(string filename, bool recoverFromImageError)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
filename |
|
|
|
recoverFromImageError |
GetInstance [6/18]
Source code
public static Image GetInstance(byte[] imgb)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
imgb |
GetInstance [7/18]
Source code
public static Image GetInstance(byte[] imgb, bool recoverFromImageError)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
imgb |
|
|
|
recoverFromImageError |
Summary
Gets an instance of an Image.
Returns
an object of type Gif, Jpeg or Png
GetInstance [8/18]
Source code
public static Image GetInstance(Image image, BaseColor color, bool forceBW)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
image |
the System.Drawing.Image to convert |
|
|
color |
if different from null the transparency
|
|
|
forceBW |
if true the image is treated as black and white |
Summary
Gets an instance of an Image from a System.Drwaing.Image.
Returns
an object of type ImgRaw
GetInstance [9/18]
Source code
public static Image GetInstance(Image image, ImageFormat format)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
image |
|
|
|
format |
Summary
Converts a .NET image to a Native(PNG, JPG, GIF, WMF) image
Returns
GetInstance [10/18]
Source code
public static Image GetInstance(Image image, BaseColor color)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
image |
the System.Drawing.Image to convert |
|
|
color |
if different from null the transparency
|
Summary
Gets an instance of an Image from a System.Drawing.Image.
Returns
an object of type ImgRaw
GetInstance [11/18]
Source code
public static Image GetInstance(string filename)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
filename |
a filename |
Summary
Gets an instance of an Image.
Returns
an object of type Gif, Jpeg or Png
GetInstance [12/18]
Source code
public static Image GetInstance(int width, int height, int components, int bpc, byte[] data)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
width |
the width of the image in pixels |
|
|
height |
the height of the image in pixels |
|
|
components |
1,3 or 4 for GrayScale, RGB and CMYK |
|
|
bpc |
bits per component |
|
|
data |
the image data |
Summary
Gets an instance of an Image in raw mode.
Returns
an object of type ImgRaw
GetInstance [13/18]
Source code
public static Image GetInstance(int width, int height, byte[] data, byte[] globals)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
width |
|
|
|
height |
|
|
|
data |
|
|
|
globals |
GetInstance [14/18]
Source code
public static Image GetInstance(PRIndirectReference iref)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
iref |
GetInstance [15/18]
Source code
public static Image GetInstance(PdfTemplate template)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
template |
Summary
Gets an instance of an Image in raw mode.
Returns
GetInstance [16/18]
Source code
public static Image GetInstance(int width, int height, bool reverseBits, int typeCCITT, int parameters, byte[] data)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
width |
the width of the image in pixels |
|
|
height |
the height of the image in pixels |
|
|
reverseBits |
|
|
|
typeCCITT |
|
|
|
parameters |
|
|
|
data |
Summary
Gets an instance of an Image in raw mode.
Returns
GetInstance [17/18]
Source code
public static Image GetInstance(int width, int height, bool reverseBits, int typeCCITT, int parameters, byte[] data, int[] transparency)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
width |
|
|
|
height |
|
|
|
reverseBits |
|
|
|
typeCCITT |
|
|
|
parameters |
|
|
|
data |
|
|
|
transparency |
Summary
Returns
GetInstance [18/18]
Source code
public static Image GetInstance(int width, int height, int components, int bpc, byte[] data, int[] transparency)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
width |
the width of the image in pixels |
|
|
height |
the height of the image in pixels |
|
|
components |
1,3 or 4 for GrayScale, RGB and CMYK |
|
|
bpc |
bits per component |
|
|
data |
the image data |
|
|
transparency |
transparency information in the Mask format of the
|
Summary
Gets an instance of an Image in raw mode.
Returns
an object of type ImgRaw
SetAbsolutePosition
Source code
public virtual void SetAbsolutePosition(float absoluteX, float absoluteY)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
absoluteX |
|
|
|
absoluteY |
Summary
Sets the absolute position of the Image.
ScaleAbsolute [1/2]
Source code
public virtual void ScaleAbsolute(Rectangle rectangle)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
rectangle |
dimensions to scale the Image |
Summary
Scale the image to the dimensions of the rectangle
ScaleAbsolute [2/2]
Source code
public virtual void ScaleAbsolute(float newWidth, float newHeight)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
newWidth |
the new width |
|
|
newHeight |
the new height |
Summary
Scale the image to an absolute width and an absolute height.
ScaleAbsoluteWidth
Source code
public virtual void ScaleAbsoluteWidth(float newWidth)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
newWidth |
the new width |
Summary
Scale the image to an absolute width.
ScaleAbsoluteHeight
Source code
public virtual void ScaleAbsoluteHeight(float newHeight)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
newHeight |
the new height |
Summary
Scale the image to an absolute height.
ScalePercent [1/2]
Source code
public virtual void ScalePercent(float percent)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
percent |
the scaling percentage |
Summary
Scale the image to a certain percentage.
ScalePercent [2/2]
Source code
public virtual void ScalePercent(float percentX, float percentY)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
percentX |
the scaling percentage of the width |
|
|
percentY |
the scaling percentage of the height |
Summary
Scale the width and height of an image to a certain percentage.
ScaleToFit [1/2]
Source code
public virtual void ScaleToFit(Rectangle rectangle)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
rectangle |
the dimensions to fit |
Summary
Scales the images to the dimensions of the rectangle.
ScaleToFit [2/2]
Source code
public virtual void ScaleToFit(float fitWidth, float fitHeight)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
fitWidth |
the width to fit |
|
|
fitHeight |
the height to fit |
Summary
Scales the image so that it fits a certain width and height.
GetImageRotation
Source code
public virtual float GetImageRotation()
HasAbsolutePosition
Source code
public virtual bool HasAbsolutePosition()
Summary
Checks if the Images has to be added at an absolute position.
Returns
a bool
HasAbsoluteX
Source code
public virtual bool HasAbsoluteX()
Summary
Checks if the Images has to be added at an absolute X position.
Returns
a bool
IsNestable
Source code
public override bool IsNestable()
IsJpeg
Source code
public virtual bool IsJpeg()
Summary
Returns true if the image is a Jpeg-object.
Returns
a bool
IsImgRaw
Source code
public virtual bool IsImgRaw()
Summary
Returns true if the image is a ImgRaw-object.
Returns
a bool
IsImgTemplate
Source code
public virtual bool IsImgTemplate()
Summary
Returns true if the image is an ImgTemplate-object.
Returns
a bool
GetMatrix [1/2]
Source code
public virtual float GetMatrix()
Summary
Returns the transformation matrix of the image.
GetMatrix [2/2]
Source code
public virtual float GetMatrix(float scalePercentage)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
scalePercentage |
GetSerialId
Source code
protected static long GetSerialId()
Summary
generates new serial id
SetDpi
Source code
public virtual void SetDpi(int dpiX, int dpiY)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
dpiX |
|
|
|
dpiY |
IsMaskCandidate
Source code
public virtual bool IsMaskCandidate()
Summary
Returns true if this Image has the requisites to be a mask.
Returns
true if this Image can be a mask
MakeMask
Source code
public virtual void MakeMask()
Summary
Make this Image a mask.
IsMask
Source code
public virtual bool IsMask()
Summary
Returns true if this Image is a mask.
Returns
true if this Image is a mask
HasICCProfile
Source code
public virtual bool HasICCProfile()
SimplifyColorspace
Source code
public virtual void SimplifyColorspace()
GetAccessibleAttribute
Source code
public virtual PdfObject GetAccessibleAttribute(PdfName key)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
key |
SetAccessibleAttribute
Source code
public virtual void SetAccessibleAttribute(PdfName key, PdfObject value)
Arguments
GetAccessibleAttributes
Source code
public virtual Dictionary<PdfName, PdfObject> GetAccessibleAttributes()
Properties
Rotation
public float Rotation { set; }
Summary
Sets the rotation of the image in radians.
RotationDegrees
public virtual float RotationDegrees { set; }
Summary
Sets the rotation of the image in degrees.
Annotation
public virtual Annotation Annotation { get; set; }
Summary
Get/set the annotation.
Value
the Annotation
Bpc
public virtual int Bpc { get; }
Summary
Gets the bpc for the image.
Remarks
this only makes sense for Images of the type RawImage.
Value
a bpc value
RawData
public virtual byte RawData { get; }
Summary
Gets the raw data for the image.
Remarks
this only makes sense for Images of the type RawImage.
Value
the raw data
TemplateData
public virtual PdfTemplate TemplateData { get; set; }
Summary
Get/set the template to be used as an image.
Remarks
this only makes sense for Images of the type ImgTemplate.
Value
the template
AbsoluteX
public virtual float AbsoluteX { get; }
Summary
Returns the absolute X position.
Value
a position
AbsoluteY
public virtual float AbsoluteY { get; }
Summary
Returns the absolute Y position.
Value
a position
Type
public override int Type { get; }
Summary
Returns the type.
Value
a type
Url
public virtual Uri Url { get; set; }
Summary
Gets the string-representation of the reference to the image.
Value
a string
Alignment
public virtual int Alignment { get; set; }
Summary
Get/set the alignment for the image.
Value
a value
Alt
public virtual string Alt { get; set; }
Summary
Get/set the alternative text for the image.
Value
a string
ScaledWidth
public virtual float ScaledWidth { get; }
Summary
Gets the scaled width of the image.
Value
a value
ScaledHeight
public virtual float ScaledHeight { get; }
Summary
Gets the scaled height of the image.
Value
a value
Colorspace
public virtual int Colorspace { get; }
Summary
Gets the colorspace for the image.
Remarks
this only makes sense for Images of the type Jpeg.
Value
a colorspace value
ColorTransform
public virtual int ColorTransform { get; set; }
Transparency
public virtual int Transparency { get; set; }
Summary
Returns the transparency.
Value
the transparency
PlainWidth
public virtual float PlainWidth { get; }
Summary
Gets the plain width of the image.
Value
a value
PlainHeight
public virtual float PlainHeight { get; }
Summary
Gets the plain height of the image.
Value
a value
MySerialId
public virtual long MySerialId { get; }
Summary
returns serial id for this object
DpiX
public virtual int DpiX { get; }
Summary
Gets the dots-per-inch in the X direction. Returns 0 if not available.
Value
the dots-per-inch in the X direction
DpiY
public virtual int DpiY { get; }
Summary
Gets the dots-per-inch in the Y direction. Returns 0 if not available.
Value
the dots-per-inch in the Y direction
ImageMask
public virtual Image ImageMask { get; set; }
Summary
Get/set the explicit masking.
Value
the explicit masking
Inverted
public virtual bool Inverted { get; set; }
Summary
Inverts the meaning of the bits of a mask.
Value
true to invert the meaning of the bits of a mask
Interpolation
public virtual bool Interpolation { get; set; }
Summary
Sets the image interpolation. Image interpolation attempts to produce a smooth transition between adjacent sample values.
Value
New value of property interpolation.
TagICC
public virtual ICC_Profile TagICC { get; set; }
Deflated
public virtual bool Deflated { get; set; }
Additional
public virtual PdfDictionary Additional { get; set; }
Smask
public virtual bool Smask { get; set; }
XYRatio
public virtual float XYRatio { get; set; }
IndentationLeft
public virtual float IndentationLeft { get; set; }
IndentationRight
public virtual float IndentationRight { get; set; }
OriginalType
public virtual int OriginalType { get; set; }
OriginalData
public virtual byte OriginalData { get; set; }
SpacingBefore
public virtual float SpacingBefore { get; set; }
SpacingAfter
public virtual float SpacingAfter { get; set; }
PaddingTop
public virtual float PaddingTop { get; set; }
WidthPercentage
public virtual float WidthPercentage { get; set; }
ScaleToFitLineWhenOverflow
public virtual bool ScaleToFitLineWhenOverflow { get; set; }
ScaleToFitHeight
public virtual bool ScaleToFitHeight { get; set; }
Layer
public virtual IPdfOCG Layer { get; set; }
InitialRotation
public virtual float InitialRotation { get; set; }
DirectReference
public virtual PdfIndirectReference DirectReference { get; set; }
CompressionLevel
public virtual int CompressionLevel { get; set; }
Role
public virtual PdfName Role { get; set; }
ID
public virtual AccessibleElementId ID { get; set; }
IsInline
public virtual bool IsInline { get; }
Generated with ModularDoc