[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Spec.IPdfArrayExt.TryAsArray

TryAsArray Method

TryAsArray<T>(IPdfArray, out T[], bool, bool)

Tries to convert all elements of this IPdfArray to T, and copies the converted values to a new array of T. Returns true if all elements can be converted to a T or they are PDF Null and allowNulls is true.

Declaration
public static bool TryAsArray<T>(this IPdfArray array, out T[] values, bool allowNulls, bool addWarning) where T : IPdfObject
Public Shared Function TryAsArray(Of T As IPdfObject)(array As IPdfArray, ByRef values As T(), allowNulls As Boolean, addWarning As Boolean) As Boolean
Parameters
Type Name Description
IPdfArray array

The current array.

T[] values

OUT: The array of T.

bool allowNulls

Indicates whether the IPdfNull should be handled as valid value and converted to null.

bool addWarning

Indicates whether to add a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if errors occur.

Returns
Type Description
bool

Returns true if no errors occur.

Type Parameters
Name Description
T