//////////////////////////////////////////////////////////////////// // C# string text to PDF strings only //////////////////////////////////////////////////////////////////// internal string TextToPdfString ( string Text, PdfObject Parent ) { // convert C# string to byte array var ByteArray = TextToByteArray(Text); // encryption is active. PDF string must be encrypted except for encryption dictionary if (Parent != null && Encryption != null && Encryption != Parent) { ByteArray = Encryption.EncryptByteArray(Parent.ObjectNumber, ByteArray); } // convert byte array to PDF string format return(ByteArrayToPdfString(ByteArray)); }