TryGetValue(String, out CosObject) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Looks up the key that reads as the text key.

public bool TryGetValue(string key, [MaybeNullWhen(false)] scoped out CosObject value)

Parameters

key
String

The key as text.

value
CosObject

The value, resolved one level, when found.

Returns

Boolean
true when the tree holds a key that reads as key.

Remarks

ISO 32000-2 §7.9.6 and §7.9.2.2: the file may encode a key in PDFDocEncoding or as UTF-16BE (or UTF-8) with a byte order marker. The text is tried as PDFDocEncoding bytes (when every character has a code), then as UTF-16BE with the marker; when neither is a key, every key is decoded and compared with the text ordinally, and the first match in tree order is returned.