Table of Contents

Method GetRectangle

Namespace
PdfSharp.Pdf
Assembly
PdfSharp.dll

GetRectangle(string, bool, PdfRectangle?)

Gets the rectangle value that corresponds to the specified key. If the key does not exist and create is false, the function returns the defaultValue. If the key does not exist and create is true, a direct value will be created using the defaultValue. If the key exists but the value is neither a rectangle or an array with four elements nor a PDF reference to a rectangle or an array with four elements, the function throws an InvalidOperationException.

public PdfRectangle? GetRectangle(string key, bool create = false, PdfRectangle? defaultValue = null)

Parameters

key string
create bool
defaultValue PdfRectangle

Returns

PdfRectangle