public override void ToPdf(PdfWriter writer, Stream os)
{
byte[] b = GetBytes();
PdfEncryption crypto = null;
if (writer != null)
crypto = writer.Encryption;
if (crypto != null && !crypto.IsEmbeddedFilesOnly()) {
b = crypto.EncryptByteArray(b);
}
if (hexWriting) {
ByteBuffer buf = new ByteBuffer();
buf.Append('<');
int len = b.Length;
for (int k = 0; k < len; ++k)
buf.AppendHex(b[k]);
buf.Append('>');
os.Write(buf.ToByteArray(), 0, buf.Size);
}
else {
b = PdfContentByte.EscapeString(b);
os.Write(b, 0, b.Length);
}
}