[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Spec.IPdfDictExt

IPdfDictExt Class

Contains extension methods for the IPdfDict interface, allows working with PdfDict and PdfDictObject in the same way.

Inheritance
IPdfDictExt
Namespace: GrapeCity.Documents.Pdf.Spec
Assembly: DS.Documents.Pdf.dll
Syntax
public static class IPdfDictExt
Public Module IPdfDictExt

Methods

Name Description
Clear(IPdfDict)

Clears the dictionary.

ContainsKey(IPdfDict, PdfName)

Determines whether this IPdfDict contains the specified key.

CopyToExcluding(IPdfDict, ref PdfDict, HashSet<PdfName>)

Copies from the current dictionary to dest all properties except those specified in propsToExclude.

dest can be null, in that case it will be initialized if there are any properties to copy.

Count(IPdfDict)

Gets the count of items in the IPdfDict.

DictToString(IPdfDict)

Converts the IPdfDict to a string.

GetArray<T>(IPdfDict, PdfName, bool)

Gets the array of T objects associated with the specified key. Returns null if the array does not exist or cannot be converted to an array of T.

GetAtPath<T>(IPdfDict, params object[])

Gets the value at the specified path. The path can contain IPdfName objects which are interpreted as dictionary keys, or integers which are interpreted as IPdfArray indices.

GetBool(IPdfDict, PdfName, bool)

Gets the Boolean value associated with the specified key. If the value does not exist or cannot be converted to a Boolean, returns defValue (which can be null).

GetBool(IPdfDict, PdfName, bool?)

Gets the nullable Boolean value associated with the specified key. If the value does not exist or cannot be converted to a Boolean, returns defValue (which can be null).

GetBoolArray(IPdfDict, PdfName, bool)

Gets the Boolean array associated with the specified key. Returns null if the array does not exist or cannot be converted to a Boolean array.

GetColor(IPdfDict, PdfName, Color)

Gets the Color associated with the specified key (in a PDF a Color should be represented as an array of 1, 3 or 4 floats).

Gets defValue if the value does not exist or cannot be converted to a Color.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to a Color.
GetColor(IPdfDict, PdfName, Color?)

Gets the Color associated with the specified key (in a PDF a Color should be represented as an array of 1, 3 or 4 floats).

Gets defValue if the value does not exist or cannot be converted to a Color.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to a Color.
GetDeviceRGBColor(IPdfDict, PdfName, Color)

Gets the RGB Color associated with the specified key (in a PDF an RGB Color should be represented as an array of 3 floats).

Gets defValue if the value does not exist or cannot be converted to a Color.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to a Color.
GetDictArray(IPdfDict, PdfName, bool)

Gets the IPdfDict array associated with the specified key. Returns null if the array does not exist or cannot be converted to an IPdfDict array.

GetDouble(IPdfDict, PdfName, double?)

Gets the nullable Double value associated with the specified key. If the value does not exist or cannot be converted to a Double, returns defValue (which can be null).

GetEnum<T>(IPdfDict, PdfName, T?)

Gets the nullable enum value associated with the specified key. If the value does not exist or cannot be converted to an enum, returns defValue (which can be null).

GetEnum<T>(IPdfDict, PdfName, T)

Gets the enum value associated with the specified key. If the value does not exist or cannot be converted to an enum, returns defValue.

GetFloat(IPdfDict, PdfName, float?)

Gets the nullable Float value associated with the specified key. If the value does not exist or cannot be converted to a Float, returns defValue (which can be null).

GetFloat(IPdfDict, PdfName, float)

Gets the Float value associated with the specified key. If the value does not exist or cannot be converted to a Float, returns defValue.

GetFloatArray(IPdfDict, PdfName, bool)

Gets the float array associated with the specified key. Returns null if the array does not exist or cannot be converted to a float array.

GetInt(IPdfDict, PdfName, int)

Gets the nullable Integer value associated with the specified key. If the value does not exist or cannot be converted to an Integer, returns defValue.

GetInt(IPdfDict, PdfName, int?)

Gets the Integer value associated with the specified key. If the value does not exist or cannot be converted to an Integer, returns defValue (which can be null).

GetIntArray(IPdfDict, PdfName, bool)

Gets the Integer array associated with the specified key. Returns null if the array does not exist or cannot be converted to an Integer array.

GetMatrix(IPdfDict, PdfName, Matrix3x2?)

Gets the Matrix3x2 associated with the specified key (in a PDF a Matrix3x2 should be represented as an array of 6 floats).

Gets defValue if the value does not exist or cannot be converted to a Matrix3x2.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to a Matrix3x2.
GetMatrix(IPdfDict, PdfName, Matrix3x2)

Gets the Matrix3x2 associated with the specified key (in a PDF a Matrix3x2 should be represented as an array of 6 floats).

Gets defValue if the value does not exist or cannot be converted to a Matrix3x2.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to a Matrix3x2.
GetName(IPdfDict, PdfName, string)

Gets the PDF Name value associated with the specified key. If the value does not exist or cannot be converted to a PDF Name, returns defValue (which can be null).

GetNameArray(IPdfDict, PdfName, bool)

Gets the PdfName array associated with the specified key. Returns null if the array does not exist or cannot be converted to a PdfName array.

GetNameArrayStr(IPdfDict, PdfName, bool)

Gets the PDF Name array associated with the specified key. Returns null if the array does not exist or cannot be converted to a PDF Name array.

GetOffsets(IPdfDict, PdfName, Offsets)

Gets the Offsets associated with the specified key (in a PDF a Offsets should be represented as an array of 4 floats).

Gets defValue if the value does not exist or cannot be converted to an Offsets.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to an Offsets.
GetOffsets(IPdfDict, PdfName, Offsets?)

Gets the Offsets associated with the specified key (in a PDF an Offsets should be represented as an array of 4 floats).

Gets defValue if the value does not exist or cannot be converted to an Offsets.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to an Offsets.
GetPdfDateTime(IPdfDict, PdfName, PdfDateTime?)

Gets the PdfDateTime value associated with the specified key. If the value does not exist or cannot be converted to a PdfDateTime, returns defValue (which can be null).

GetPdfEnum<T>(IPdfDict, PdfName, T?)

Gets the nullable PdfEnum<TEnum> value associated with the specified key. If the value does not exist returns defValue (which can be null).

GetPdfEnum<T>(IPdfDict, PdfName, T)

Gets the PdfEnum<TEnum> value associated with the specified key. If the value does not exist returns defValue.

GetPdfStringBytes(IPdfDict, PdfName)

Gets the bytes of the IPdfString associated with the specified key. If the value does not exist or cannot be converted to an IPdfString, returns null.

GetRect(IPdfDict, PdfName, RectangleF)

Gets the RectangleF associated with the specified key (in a PDF a RectangleF should be represented as an array of 4 floats).

Gets defValue if the value does not exist or cannot be converted to a RectangleF.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to a RectangleF.
GetRect(IPdfDict, PdfName, RectangleF?)

Gets the RectangleF associated with the specified key (in a PDF a RectangleF should be represented as an array of 4 floats).

Gets defValue if the value does not exist or cannot be converted to a RectangleF.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value cannot be converted to a RectangleF.
GetRefArray(IPdfDict, PdfName, bool)

Gets the array of IPdfRef objects associated with the specified key, Returns null if the array does not exist or cannot be converted to an array of IPdfRef.

GetStreamData(IPdfDict)

Returns the decoded stream data if IPdfDict is a PdfStreamObjectBase.

GetString(IPdfDict, PdfName, string)

Gets the String value associated with the specified key. If the value does not exist or cannot be converted to a String, returns defValue (which can be null).

GetStringArray(IPdfDict, PdfName, bool)

Gets the String array associated with the specified key. Returns null if the array does not exist or cannot be converted to a String array.

GetStringOrName(IPdfDict, PdfName, string)

Gets the string associated with the specified key. The string can be specified in the PDF as a PDF string or a PDF name.

Gets defValue if the value does not exist or cannot be converted to a string.

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value exists but cannot be converted to a string.
Get<T>(IPdfDict, PdfName, bool)

Gets the value associated with the specified key, if the value does not exist or cannot be converted to a T returns null. Note! This method returns IPdfRef if T is IPdfRef, otherwise the method resolves the reference and returns actual object.

Get<T>(IPdfDict, PdfName, T)

Gets the value associated with the specified key, if the value does not exist or cannot be converted to a T returns the defValue. Note! This method returns IPdfRef if T is IPdfRef, otherwise the method resolves the reference and returns actual object.

Remove(IPdfDict, PdfName)

Removes the value associated with the specified key.

RemoveStreamEntries(IPdfDict)

Removes all entries related to the stream: Length, Filter, DecodeParms. The method does not change the Changed flag.

Set(IPdfDict, PdfName, IPdfName, IPdfName)

Sets the PDF Name value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

Set(IPdfDict, PdfName, IPdfObject)

Sets the value associated with the specified key. If value is null, the entry specified by the key will be removed.

SetBool(IPdfDict, PdfName, bool?, bool?)

Sets the Boolean value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetColor(IPdfDict, PdfName, Color?, Color?)

Sets the Color value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetDeviceRGBColor(IPdfDict, PdfName, Color?, Color?)

Sets the RGB Color value associated with the specified key (in a PDF an RGB Color should be represented as an array of 3 floats).

SetDouble(IPdfDict, PdfName, double?, double?)

Sets the Double value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetFloat(IPdfDict, PdfName, float?, float?)

Sets the float value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetFloatArray(IPdfDict, PdfName, float[])

Sets the float array associated with the specified key. If the value is null, removes the key from the dictionary.

SetInt(IPdfDict, PdfName, int?, int?)

Sets the Integer value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetIntArray(IPdfDict, PdfName, int[])

Sets the int array associated with the specified key. If the value is null, removes the key from the dictionary.

SetMatrix(IPdfDict, PdfName, Matrix3x2?, Matrix3x2?)

Sets the Matrix3x2 value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetName(IPdfDict, PdfName, string, string)

Sets the PDF Name value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary. Note! The method converts a string to the PdfName.

SetNameArray(IPdfDict, PdfName, string[], bool)

Sets or removes the PDF name array associated with a specified key.

If the specified value is null, the value is removed from the current dictionary. Otherwise the value is set.

SetNameNotEmpty(IPdfDict, PdfName, string)

Sets the PDF Name value associated with the specified key. If the value is null or empty, removes the key from the dictionary. Note! The method converts a string to the PdfName.

SetOffsets(IPdfDict, PdfName, Offsets?, Offsets?)

Sets the Offsets value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetPdfDateTime(IPdfDict, PdfName, PdfDateTime?, PdfDateTime?)

Sets the PdfDateTime value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetPdfEnum<T>(IPdfDict, PdfName, PdfEnum<T>?, T?)

Sets the nullable PdfEnum<TEnum> value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary. Note! The method converts a PdfEnum<TEnum> to the PdfName.

SetPdfStringBytes(IPdfDict, PdfName, byte[])

Sets the IPdfString associated with the specified key to the specified value. If the value is null, removes the key from the dictionary. Returns the created PdfString.

SetRect(IPdfDict, PdfName, RectangleF?, RectangleF?)

Sets the RectangleF value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary.

SetRichTextNotEmpty(IPdfDict, PdfName, string)

Sets the String value representing the Rich Text associated with the specified key. If the value is null or empty removes the key from the dictionary. Note! The method converts a string to the PdfString. Note! The method encloses the value with PdfConsts.c_RichStringPrefix and PdfConsts.c_RichStringSuffix

SetSilent(IPdfDict, PdfName, IPdfObject)

Sets the value associated with the specified key without affecting the Changed value. If value is null, the entry specified by the key will be removed.

SetString(IPdfDict, PdfName, string, string)

Sets the String value associated with the specified key. If the value is null or is equal to defValue, removes the key from the dictionary. Note! The method converts a string to the PdfString.

SetStringArray(IPdfDict, PdfName, IEnumerable<string>, bool)

Sets or removes the PDF string array associated with a specified key.

If the specified value is null, the value is removed from the current dictionary. Otherwise the value is set.

SetStringNotEmpty(IPdfDict, PdfName, string)

Sets the String value associated with the specified key. If the value is null or empty removes the key from the dictionary. Note! The method converts a string to the PdfString.

TryGetArray<T>(IPdfDict, PdfName, out T[], bool)

Tries to get the array associated with the specified key, if the value does not exist or cannot be converted to an array of T returns false.

TryGetArray<T>(IPdfDict, PdfName, out T[], bool, bool, bool)

Tries to gets the array of T objects associated with the specified key.

TryGetAtPath<T>(IPdfDict, out T, out bool, bool, params object[])

Gets the value at the specified path. The path can contain IPdfName objects which are interpreted as dictionary keys, or integers which are interpreted as IPdfArray indices.

TryGetBool(IPdfDict, PdfName, out bool)

Tries to get the Boolean value associated with the specified key. If the value does not exist or cannot be converted to a Boolean, returns false.

TryGetBoolArray(IPdfDict, PdfName, out bool[], bool)

Tries to get the bool array associated with the specified key.

TryGetColor(IPdfDict, PdfName, out Color)

Tries to get the Color associated with the specified key (in a PDF a Color should be represented as an array of 1, 3 or 4 floats).

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value exists but cannot be converted to Color.

TryGetDeviceRGBColor(IPdfDict, PdfName, out Color)

Tries to get the RGB Color associated with the specified key (in a PDF an RGB Color should be represented as an array of 3 floats).

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value exists but cannot be converted to Color.

TryGetDictArray(IPdfDict, PdfName, out IPdfDict[], bool)

Tries to gets the array of IPdfDict objects associated with the specified key.

TryGetDouble(IPdfDict, PdfName, out double)

Tries to get the Double value associated with the specified key. If the value does not exist or cannot be converted to a Double, returns false.

TryGetEnum<T>(IPdfDict, PdfName, out T)

Tries to get the enum value associated with the specified key. If the value does not exist or cannot be converted to an enum, returns false.

TryGetFloat(IPdfDict, PdfName, out float)

Tries to get the Float value associated with the specified key. If the value does not exist or cannot be converted to a Float, returns false.

TryGetFloatArray(IPdfDict, PdfName, out float[], bool)

Tries to get the float array associated with the specified key.

TryGetInt(IPdfDict, PdfName, out int)

Tries to get the Integer value associated with the specified key. If the value does not exist or cannot be converted to an Integer, returns false.

TryGetIntArray(IPdfDict, PdfName, out int[], bool)

Tries to get the Integer array associated with the specified key.

TryGetMatrix(IPdfDict, PdfName, out Matrix3x2)

Tries to get the Matrix3x2 associated with the specified key (in a PDF a Matrix3x2 should be represented as an array of 6 floats).

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value exists but cannot be converted to Matrix3x2.

TryGetName(IPdfDict, PdfName, out string)

Tries to get the PDF Name value associated with the specified key. If the value does not exist or cannot be converted to a PDF Name, returns false.

TryGetNameArray(IPdfDict, PdfName, out PdfName[], bool)

Tries to get the PDF Name array associated with the specified key.

TryGetNameArrayStr(IPdfDict, PdfName, out string[], bool)

Tries to get the PDF Name array associated with the specified key, the PDF names converted to strings.

TryGetOffsets(IPdfDict, PdfName, out Offsets)

Tries to get the Offsets associated with the specified key (in a PDF an Offsets should be represented as an array of 4 floats).

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value exists but cannot be converted to Offsets.

TryGetPdfDateTime(IPdfDict, PdfName, out PdfDateTime?)

Tries to get the PdfDateTime value associated with the specified key. If the value does not exist or cannot be converted to the PdfDateTime, returns false.

TryGetPdfEnum<T>(IPdfDict, PdfName, out PdfEnum<T>)

Tries to get the PdfEnum<TEnum> value associated with the specified key. If the value does not exist or cannot be converted to an enum, returns false.

TryGetRect(IPdfDict, PdfName, out RectangleF)

Tries to get the RectangleF associated with the specified key (in a PDF a RectangleF should be represented as an array of 4 floats).

Adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value exists but cannot be converted to RectangleF.

TryGetRefArray(IPdfDict, PdfName, out IPdfRef[], bool)

Tries to gets the array of IPdfRef objects associated with the specified key.

TryGetString(IPdfDict, PdfName, out string)

Tries to get the String value associated with the specified key. If the value does not exist or cannot be converted to a String, returns false.

TryGetStringArray(IPdfDict, PdfName, out string[], bool)

Tries to get the string array associated with the specified key.

TryGetStringOrName(IPdfDict, PdfName, out string, bool)

Tries to get the string associated with the specified key. The string can be specified in the PDF as a PDF string or a PDF name.

Optionally adds a warning to GrapeCity.Documents.Pdf.GcPdfDocument.ParserLog if the value exists but cannot be converted to a PdfString.

TryGetValue(IPdfDict, PdfName, out IPdfObject)

Tries to get a value with specified key. The method does not perform any processing of the value and returns it as is.

TryGet<T>(IPdfDict, PdfName, out T, bool)

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.

TryGet<T>(IPdfDict, PdfName, out T, out bool, bool)

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.