View | Details | Raw Unified | Return to bug 46980
Collapse All | Expand All

(-)PDFGoTo.java (+12 lines)
Lines 35-40 Link Here
35
    private String destination = null;
35
    private String destination = null;
36
    private float xPosition = 0;
36
    private float xPosition = 0;
37
    private float yPosition = 0;
37
    private float yPosition = 0;
38
    private boolean namedDestination = false;
38
39
39
    /**
40
    /**
40
     * create a /GoTo object.
41
     * create a /GoTo object.
Lines 109-114 Link Here
109
    }
110
    }
110
111
111
    /**
112
    /**
113
     * Sets a named destination internal to the PDF.
114
     * @param dest the internal named destination.
115
     */
116
    public void setNamedDestination(String dest) {
117
        this.namedDestination = true;
118
        this.destination = dest;
119
    }
120
121
    /**
112
     * Get the PDF reference for the GoTo action.
122
     * Get the PDF reference for the GoTo action.
113
     *
123
     *
114
     * @return the PDF reference for the action
124
     * @return the PDF reference for the action
Lines 125-130 Link Here
125
        if (destination == null) {
135
        if (destination == null) {
126
            dest = "/D [" + this.pageReference + " /XYZ " + xPosition
136
            dest = "/D [" + this.pageReference + " /XYZ " + xPosition
127
                          + " " + yPosition + " null]\n";
137
                          + " " + yPosition + " null]\n";
138
        } else if (namedDestination == true) {
139
            dest = "/D (" + this.destination + ")\n";
128
        } else {
140
        } else {
129
            dest = "/D [" + this.pageReference + " " + destination + "]\n";
141
            dest = "/D [" + this.pageReference + " " + destination + "]\n";
130
        }
142
        }
(-)PDFFactory.java (+6 lines)
Lines 1028-1033 Link Here
1028
            String filename = target.substring(0, index + 4);
1028
            String filename = target.substring(0, index + 4);
1029
            String dest = target.substring(index + 10);
1029
            String dest = target.substring(index + 10);
1030
            return getGoToPDFAction(filename, dest, -1, newWindow);
1030
            return getGoToPDFAction(filename, dest, -1, newWindow);
1031
        } else if (targetLo.startsWith("#")) {
1032
            String dest = target.substring(1);
1033
            PDFGoTo gt = new PDFGoTo("-1");
1034
            gt.setNamedDestination(dest);
1035
            getDocument().registerObject(gt);
1036
            return gt;
1031
        // None of the above? Default to URI:
1037
        // None of the above? Default to URI:
1032
        } else {
1038
        } else {
1033
            return new PDFUri(target);
1039
            return new PDFUri(target);

Return to bug 46980