mirror of
https://github.com/apache/xmlgraphics-fop.git
synced 2024-09-14 00:01:49 +02:00
Bugfix: need to properly escape the PDF names in a dictionary (bug triggered by my PDF plug-in)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@833375 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a964e7ec26
commit
96db64d94e
@ -133,8 +133,7 @@ public class PDFDictionary extends PDFObject {
|
||||
} else {
|
||||
writer.write("\n ");
|
||||
}
|
||||
writer.write('/');
|
||||
writer.write(key);
|
||||
writer.write(PDFName.escapeName(key));
|
||||
writer.write(' ');
|
||||
Object obj = this.entries.get(key);
|
||||
formatObject(obj, out, writer);
|
||||
|
@ -42,7 +42,12 @@ public class PDFName extends PDFObject {
|
||||
}
|
||||
|
||||
|
||||
private static String escapeName(String name) {
|
||||
/**
|
||||
* Escapes a PDF name. It adds the leading slash and escapes characters as necessary.
|
||||
* @param name the name
|
||||
* @return the escaped name
|
||||
*/
|
||||
static String escapeName(String name) {
|
||||
StringBuffer sb = new StringBuffer(Math.min(16, name.length() + 4));
|
||||
if (!name.startsWith("/")) {
|
||||
sb.append('/');
|
||||
|
Loading…
Reference in New Issue
Block a user