|
|
@@ -49,7 +49,7 @@ public class PDFUri extends PDFAction { |
|
|
|
} |
|
|
|
|
|
|
|
private String getDictString() { |
|
|
|
return "<< /URI (" + encodeString(uri) + ")\n/S /URI >>"; |
|
|
|
return "<< /URI " + encodeURI(uri) + "\n/S /URI >>"; |
|
|
|
} |
|
|
|
|
|
|
|
/** {@inheritDoc} */ |
|
|
@@ -58,4 +58,13 @@ public class PDFUri extends PDFAction { |
|
|
|
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 + ")"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |