[]
Tries to get the value associated with the specified key,
Returns true if value exists and can be converted to a T
,
resolves a PDF reference if needed.
Note! The method does not resolve reference if T
is IPdfRef,
otherwise the method resolves the reference and returns actual object.
public static bool TryGet<T>(this IPdfDict dict, PdfName key, out T value, out bool isNull, bool addWarning) where T : IPdfObject
Public Shared Function TryGet(Of T As IPdfObject)(dict As IPdfDict, key As PdfName, ByRef value As T, ByRef isNull As Boolean, addWarning As Boolean) As Boolean
Type | Name | Description |
---|---|---|
IPdfDict | dict | The current dictionary. |
PdfName | key | The key identifying the value. |
T | value | OUT: The value. |
bool | isNull | OUT: Indicates whether the value is PDF null. |
bool | addWarning | Indicates whether to add a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if errors occur. |
Type | Description |
---|---|
bool | Returns true if no errors occur. |
Name | Description |
---|---|
T |
Tries to get the value associated with the specified key,
if the value does not exist or cannot be converted to a T
returns false.
public static bool TryGet<T>(this IPdfDict dict, PdfName key, out T value, bool addWarning = true) where T : IPdfObject
Public Shared Function TryGet(Of T As IPdfObject)(dict As IPdfDict, key As PdfName, ByRef value As T, Optional addWarning As Boolean = True) As Boolean
Type | Name | Description |
---|---|---|
IPdfDict | dict | The current dictionary. |
PdfName | key | The key identifying the value. |
T | value | OUT: The value. |
bool | addWarning | Indicates whether to add a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog
if value at the specified index can't be converted to the |
Type | Description |
---|---|
bool | true if value exists, false otherwise. |
Name | Description |
---|---|
T |