Browse Source

Bugfix of bugfix for escaped PDF names.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@965390 13f79535-47bb-0310-9956-ffa450edef68
pull/21/head
Jeremias Maerki 14 years ago
parent
commit
a7f626b3c0
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/java/org/apache/fop/pdf/PDFName.java

+ 5
- 3
src/java/org/apache/fop/pdf/PDFName.java View File

@@ -49,10 +49,12 @@ public class PDFName extends PDFObject {
*/
static String escapeName(String name) {
StringBuffer sb = new StringBuffer(Math.min(16, name.length() + 4));
if (!name.startsWith("/")) {
sb.append('/');
boolean skipFirst = false;
sb.append('/');
if (name.startsWith("/")) {
skipFirst = true;
}
for (int i = 0, c = name.length(); i < c; i++) {
for (int i = (skipFirst ? 1 : 0), c = name.length(); i < c; i++) {
char ch = name.charAt(i);
if (ch < 33 || ch > 126 || ch == 0x2F) {
sb.append('#');

Loading…
Cancel
Save