API Reference

Struct

PdfColor

Namespace OfficeIMO.Pdf
Assembly OfficeIMO.Pdf
Base ValueType
Modifiers sealed

Represents an RGB color where each component is expressed in the 0..1 range. Use with writer APIs to color text and vector shapes.

Inheritance

  • ValueType
  • PdfColor

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by

Accepted by parameters

Constructors

public PdfColor(Double r, Double g, Double b) #

Initializes a new PdfColor.

Parameters

r System.Double requiredposition: 0
Red component (0..1).
g System.Double requiredposition: 1
Green component (0..1).
b System.Double requiredposition: 2
Blue component (0..1).

Methods

public static PdfColor FromOfficeColor(OfficeColor color) #
Returns: PdfColor

Creates a PDF RGB color from a shared OfficeIMO color. Alpha is ignored because the current PDF writer does not yet support transparency.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0
public static Nullable<PdfColor> FromOfficeColorOrNull(OfficeColor color) #
Returns: Nullable<PdfColor>

Creates a PDF RGB color from a shared OfficeIMO color, returning null for fully transparent colors. Partially transparent colors are converted to their RGB components until PDF transparency is supported.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0
public static PdfColor FromRgb(Byte r, Byte g, Byte b) #
Returns: PdfColor

Creates a color from 0..255 byte RGB components.

Parameters

r System.Byte requiredposition: 0
g System.Byte requiredposition: 1
b System.Byte requiredposition: 2
public static PdfColor op_Implicit(OfficeColor color) #
Returns: PdfColor

Converts a shared OfficeIMO color to a PDF RGB color.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0
public OfficeColor ToOfficeColor(Byte alpha = 255) #
Returns: OfficeColor

Converts this color to the shared OfficeIMO color type.

Parameters

alpha System.Byte = 255 optionalposition: 0

Properties

public Double R { get; } #

Red component in the 0..1 range.

public Double G { get; } #

Green component in the 0..1 range.

public Double B { get; } #

Blue component in the 0..1 range.

public static PdfColor Black { get; } #

Pure black color (#000000).

public static PdfColor White { get; } #

Pure white color (#FFFFFF).

public static PdfColor LightGray { get; } #

Light gray color useful for fills and separators.

public static PdfColor Gray { get; } #

Mid gray color useful for text and borders.