Class Util
Useful methods for working with HTML and PDF files.
Inheritance
System.Object
Util
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: IronPdf
Assembly: IronPdf.dll
Syntax
public static class Util
Methods
ImageToDataUri(Image, Boolean)
Turns a System.Drawing.Image or System.Drawing.Bitmap into a DataUri which can used to embed the Image directly into an HTML document.
Read standard https://en.wikipedia.org/wiki/Data_URI_scheme
Declaration
public static string ImageToDataUri(Image Image, bool Rasterize = false)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Image | Image | A non-null System.Drawing.Image or System.Drawing.Bitmap |
System.Boolean | Rasterize | Optional flag to flatten the image to raw pixels to increase compatibility with HTML (may affect PDF file size and rendering time) |
Returns
Type | Description |
---|---|
System.String | A data URL which can be used as the src attribute of an HTML <img tag |