[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Text.FontSimple.TryGetPdfCode

TryGetPdfCode Method

TryGetPdfCode(string, out uint, out int)

Tries to convert a Unicode value to the character's PDF code.

Note that this method can fail if the font does not contain the necessary info for the conversion or does not contain the specified Unicode value.

Note also that this method can be slow as it uses large font tables like /Encoding, /ToUnicode etc., so it is recommended that the returned results are cached by the caller.

Declaration
public override bool TryGetPdfCode(string unicode, out uint pdfCode, out int pdfCodeLength)
Parameters
Type Name Description
string unicode

The character Unicode.

uint pdfCode

OUT: The character PDF code.

int pdfCodeLength

OUT: The length of pdfCode in bytes.

Returns
Type Description
bool

true if the conversion was successful, false otherwise.

Overrides