diff options
author | Jeremias Maerki <jeremias@apache.org> | 2003-03-27 10:44:41 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2003-03-27 10:44:41 +0000 |
commit | 9413ba3fbda4d02b61f6e854d1bf09de195dd3ab (patch) | |
tree | d0ed6e26de1a0bece13ea671e36fe6f15759cf73 /src/java/org/apache/fop/pdf/PDFLink.java | |
parent | 29290e1b26ffdf806624cdc4b39a9996f6c57116 (diff) | |
download | xmlgraphics-fop-9413ba3fbda4d02b61f6e854d1bf09de195dd3ab.tar.gz xmlgraphics-fop-9413ba3fbda4d02b61f6e854d1bf09de195dd3ab.zip |
The PDF object number doesn't get passed to the constructor anymore. Adjust for that.
Use the toPDFString() (returns String) method instead of toPDF() (returns byte[]) where appropriate. String to byte[] conversion is done in PDFObject in a well-defined location instead of scattered around the codebase.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196159 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf/PDFLink.java')
-rw-r--r-- | src/java/org/apache/fop/pdf/PDFLink.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFLink.java b/src/java/org/apache/fop/pdf/PDFLink.java index 23e36e41d..78da2d867 100644 --- a/src/java/org/apache/fop/pdf/PDFLink.java +++ b/src/java/org/apache/fop/pdf/PDFLink.java @@ -77,12 +77,11 @@ public class PDFLink extends PDFObject { /** * create objects associated with a link annotation (GoToR) * - * @param number the object's number * @param r the rectangle of the link hotspot in absolute coordinates */ - public PDFLink(int number, Rectangle2D r) { + public PDFLink(Rectangle2D r) { /* generic creation of PDF object */ - super(number); + super(); this.ulx = (float)r.getX(); this.uly = (float)r.getY(); @@ -101,18 +100,16 @@ public class PDFLink extends PDFObject { } /** - * produce the PDF representation of the object - * - * @return the PDF + * @see org.apache.fop.pdf.PDFObject#toPDFString() */ - public byte[] toPDF() { - String p = this.number + " " + this.generation + " obj\n" + public String toPDFString() { + String s = getObjectID() + "<< /Type /Annot\n" + "/Subtype /Link\n" + "/Rect [ " + (ulx) + " " + (uly) + " " + (brx) + " " + (bry) + " ]\n" + "/C [ " + this.color + " ]\n" + "/Border [ 0 0 0 ]\n" + "/A " + this.action.getAction() + "\n" + "/H /I\n>>\nendobj\n"; - return p.getBytes(); + return s; } /* |