diff options
author | Andreas L. Delmelle <adelmelle@apache.org> | 2008-04-25 11:27:19 +0000 |
---|---|---|
committer | Andreas L. Delmelle <adelmelle@apache.org> | 2008-04-25 11:27:19 +0000 |
commit | 6a5f719385be496af9d8fede33a8af0b5e2c7815 (patch) | |
tree | 36381050e97b2220df8597a84790dd552fabf7ca /src/java/org/apache/fop/render/pdf | |
parent | c47f87ac1bc127389597c979e1e4a344b3e9fe88 (diff) | |
download | xmlgraphics-fop-6a5f719385be496af9d8fede33a8af0b5e2c7815.tar.gz xmlgraphics-fop-6a5f719385be496af9d8fede33a8af0b5e2c7815.zip |
Bugzilla 44634: Added partial implementation for show-destination.
Only works for PDF output, when the PDF is opened in a standalone viewer, and for links that point to destinations in another PDF document.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@651575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/pdf')
-rw-r--r-- | src/java/org/apache/fop/render/pdf/PDFRenderer.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index 936bf4384..06f5921cc 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -837,7 +837,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer { * @param value the value * @return the formatted value */ - protected static final String format(float value) { + protected static String format(float value) { return PDFNumber.doubleOut(value); } @@ -1134,9 +1134,11 @@ public class PDFRenderer extends AbstractPathOrientedRenderer { * (i.e. if the area qualifies as a link target). * Otherwise, or if the area has no id, null is returned. * - * NOTE : area must be on currentPageViewport, otherwise result may be wrong! + * <i>NOTE</i>: area must be on currentPageViewport, otherwise result may be wrong! * * @param area the area for which to return the id + * @return the area's id (null if the area has no id or + * other preceding areas have the same id) */ protected String getTargetableID(Area area) { String id = (String) area.getTrait(Trait.PROD_ID); @@ -1374,11 +1376,14 @@ public class PDFRenderer extends AbstractPathOrientedRenderer { // no INTERNAL_LINK, look for EXTERNAL_LINK if (!linkTraitFound) { - String extDest = (String) ip.getTrait(Trait.EXTERNAL_LINK); - if (extDest != null && extDest.length() > 0) { - linkTraitFound = true; - if (annotsAllowed) { - action = factory.getExternalAction(extDest); + Trait.ExternalLink extLink = (Trait.ExternalLink) ip.getTrait(Trait.EXTERNAL_LINK); + if (extLink != null) { + String extDest = extLink.getDestination(); + if (extDest != null && extDest.length() > 0) { + linkTraitFound = true; + if (annotsAllowed) { + action = factory.getExternalAction(extDest, extLink.newWindow()); + } } } } @@ -1610,7 +1615,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer { * Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced. * @param uri URL of the bitmap * @param pos Position of the bitmap - * @deprecated Use {@link @putImage(String, Rectangle2D, Map)} instead. + * @deprecated Use {@link #putImage(String, Rectangle2D, Map)} instead. */ protected void putImage(String uri, Rectangle2D pos) { putImage(uri, pos, null); |