}
private String getDictString() {
- return "<< /URI (" + encodeString(uri) + ")\n/S /URI >>";
+ return "<< /URI " + encodeURI(uri) + "\n/S /URI >>";
}
/** {@inheritDoc} */
return getDictString();
}
+ private String encodeURI(String text) {
+ if (getDocument() != null && getDocumentSafely().isEncryptionActive()) {
+ final byte[] buf = PDFText.encode(text);
+ byte[] enc = getDocument().getEncryption().encrypt(buf, this);
+ return PDFText.toHex(enc, true);
+ } else {
+ return "(" + text + ")";
+ }
+ }
}