diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/codegen/extproperties.xml projekte/infotakt/vdp/fop/src/codegen/extproperties.xml
*** fop/xml-fop/src/codegen/extproperties.xml	Tue Feb  6 08:34:46 2001
--- projekte/infotakt/vdp/fop/src/codegen/extproperties.xml	Tue Jan 21 19:03:25 2003
***************
*** 13,18 ****
        <datatype>String</datatype>
        <default></default>
      </property>
!     
    </generic-property-list>
  </property-list>
--- 13,23 ----
        <datatype>String</datatype>
        <default></default>
      </property>
!     <property>
!       <name>destination-name</name>
!       <inherited>false</inherited>
!       <datatype>String</datatype>
!       <default></default>
!     </property>
    </generic-property-list>
  </property-list>
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/codegen/foproperties.xml projekte/infotakt/vdp/fop/src/codegen/foproperties.xml
*** fop/xml-fop/src/codegen/foproperties.xml	Sun Nov 24 08:23:51 2002
--- projekte/infotakt/vdp/fop/src/codegen/foproperties.xml	Tue Jan 21 19:27:25 2003
***************
*** 1644,1649 ****
--- 1644,1656 ----
        <default></default>
      </property>
      <property>
+       <!-- Property of destination extension element -->
+       <name>destination-name</name>
+       <inherited>false</inherited>
+       <datatype>String</datatype>
+       <default></default>
+     </property>
+     <property>
        <name>show-destination</name>
        <inherited>false</inherited>
        <datatype>ToBeImplemented</datatype>
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/org/apache/fop/datatypes/IDNode.java projekte/infotakt/vdp/fop/src/org/apache/fop/datatypes/IDNode.java
*** fop/xml-fop/src/org/apache/fop/datatypes/IDNode.java	Tue Nov  5 08:53:47 2002
--- projekte/infotakt/vdp/fop/src/org/apache/fop/datatypes/IDNode.java	Tue Jan 21 18:18:39 2003
***************
*** 49,54 ****
--- 49,74 ----
          return pageNumber;
      }
  
+     /**
+      * Returns the page reference.
+      *
+      * @return page reference of this node.
+      */
+     public String getPageReference() {
+        if (null != internalLinkGoTo) {
+          return internalLinkGoTo.getPageReference();
+        } else {
+          return internalLinkGoToPageReference;
+        }
+     }
+ 
+     public int getXPosition() {
+        return xPosition;
+     }
+     
+     public int getYPosition() {
+        return yPosition;
+     }
      
      /**
       * creates a new GoTo object for an internal link
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/org/apache/fop/datatypes/IDReferences.java projekte/infotakt/vdp/fop/src/org/apache/fop/datatypes/IDReferences.java
*** fop/xml-fop/src/org/apache/fop/datatypes/IDReferences.java	Tue Nov  5 08:53:47 2002
--- projekte/infotakt/vdp/fop/src/org/apache/fop/datatypes/IDReferences.java	Tue Jan 21 16:23:59 2003
***************
*** 344,347 ****
--- 344,367 ----
      public Iterator getInvalidElements() {
          return idValidation.keySet().iterator();
      }
+     
+     /**
+      * Returns a destination reference for the node with the
+      * specified id.  If id does not exist, returns null.
+      * Destination format is: [ ?objectId 0 R /XYZ ?x ?y null ]
+      *
+      * @param id The id whose destination reference to return
+      * @return Destination reference for this node
+      */
+     public String getDestinationRef(String id) {
+         if (doesIDExist(id)) {
+             IDNode node = (IDNode)idReferences.get(id);
+             return "[ " + node.getPageReference() + " /XYZ " +
+             node.getXPosition()/1000f + " " + node.getYPosition()/1000f + " null ]";
+         } else {
+             addToIdValidationList(id);
+             return null;
+         }
+     }
+     
  }
Only in projekte/infotakt/vdp/fop/src/org/apache/fop/extensions: Destination.java
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/org/apache/fop/extensions/ExtensionElementMapping.java projekte/infotakt/vdp/fop/src/org/apache/fop/extensions/ExtensionElementMapping.java
*** fop/xml-fop/src/org/apache/fop/extensions/ExtensionElementMapping.java	Sun Nov 24 22:29:11 2002
--- projekte/infotakt/vdp/fop/src/org/apache/fop/extensions/ExtensionElementMapping.java	Tue Jan 21 12:04:18 2003
***************
*** 26,31 ****
--- 26,32 ----
              foObjs.put("outline", Outline.maker());
              foObjs.put("label", Label.maker());
              foObjs.put("continued-label", ContinuedLabel.maker());
+             foObjs.put("destination", Destination.maker());
          }
      }
  
Only in projekte/infotakt/vdp/fop/src/org/apache/fop/pdf: PDFDestination.java
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/org/apache/fop/pdf/PDFDocument.java projekte/infotakt/vdp/fop/src/org/apache/fop/pdf/PDFDocument.java
*** fop/xml-fop/src/org/apache/fop/pdf/PDFDocument.java	Fri Nov  8 11:25:26 2002
--- projekte/infotakt/vdp/fop/src/org/apache/fop/pdf/PDFDocument.java	Tue Jan 21 18:37:12 2003
***************
*** 1000,1005 ****
--- 1000,1006 ----
  
          PDFLink linkObject;
          PDFAction action;
+         int index;
          
          PDFLink link = new PDFLink(++this.objectcount, rect);
          this.objects.add(link);
***************
*** 1013,1018 ****
--- 1014,1035 ----
                  action = new PDFGoToRemote(++this.objectcount, fileSpec);
                  this.objects.add(action);
                  link.setAction(action);
+              } else if ((index = destination.indexOf(".pdf#page=")) > 0) {
+                  String file = destination.substring(0, index + 4);
+                  int page = Integer.parseInt(destination.substring(index + 10));
+                  PDFFileSpec fileSpec = new PDFFileSpec(++this.objectcount, file);
+                  this.objects.add(fileSpec);
+                  action = new PDFGoToRemote(++this.objectcount, fileSpec, page);
+                  this.objects.add(action);
+                  link.setAction(action);
+              } else if ((index = destination.indexOf(".pdf#dest=")) > 0) {
+                  String file = destination.substring(0, index + 4);
+                  String dest = destination.substring(index + 10);
+                  PDFFileSpec fileSpec = new PDFFileSpec(++this.objectcount, file);
+                  this.objects.add(fileSpec);
+                  action = new PDFGoToRemote(++this.objectcount, fileSpec, dest);
+                  this.objects.add(action);
+                  link.setAction(action);
              } else {                               // URI
                  PDFUri uri = new PDFUri(destination);
                  link.setAction(uri);
***************
*** 1322,1325 ****
--- 1339,1355 ----
          this.idReferences = idReferences;
      }
  
+     /**
+      * Make a destination object and add it
+      * @param label the title for the new destination object
+      * @param dest the destination name to reference
+      */
+     public void addDestination(String destinationName, String internalDest) {
+        if (!idReferences.doesIDExist(internalDest)) {
+            idReferences.addToUnvalidatedIdList(internalDest);
+        }
+        PDFDestination obj = new PDFDestination(idReferences, destinationName, internalDest);
+        root.getDestinations().add(obj);
+     }
+     
  }
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/org/apache/fop/pdf/PDFGoTo.java projekte/infotakt/vdp/fop/src/org/apache/fop/pdf/PDFGoTo.java
*** fop/xml-fop/src/org/apache/fop/pdf/PDFGoTo.java	Fri May 31 02:17:16 2002
--- projekte/infotakt/vdp/fop/src/org/apache/fop/pdf/PDFGoTo.java	Tue Jan 21 18:19:13 2003
***************
*** 48,54 ****
          this.pageReference = pageReference;
      }
  
! 
  
      /**
       * Sets the Y position to jump to
--- 48,56 ----
          this.pageReference = pageReference;
      }
  
!     public String getPageReference() { 
!       return pageReference;
!     }
  
      /**
       * Sets the Y position to jump to
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/org/apache/fop/pdf/PDFGoToRemote.java projekte/infotakt/vdp/fop/src/org/apache/fop/pdf/PDFGoToRemote.java
*** fop/xml-fop/src/org/apache/fop/pdf/PDFGoToRemote.java	Fri May 31 02:17:16 2002
--- projekte/infotakt/vdp/fop/src/org/apache/fop/pdf/PDFGoToRemote.java	Tue Jan 21 12:17:42 2003
***************
*** 19,24 ****
--- 19,26 ----
       * the file specification
       */
      protected PDFFileSpec pdfFileSpec;
+     protected int pageReference = 0;
+     protected String destination = null;
  
      /**
       * create an GoToR object.
***************
*** 35,40 ****
--- 37,74 ----
      }
  
      /**
+      * create an GoToR object.
+      *
+      * @param number the object's number
+      * @param fileSpec the fileSpec associated with the action
+      * @param page a page reference within the remote document
+      */
+     public PDFGoToRemote(int number, PDFFileSpec pdfFileSpec, int page) {
+ 
+         /* generic creation of object */
+         super(number);
+ 
+         this.pdfFileSpec = pdfFileSpec;
+         this.pageReference = page;
+     }
+ 
+     /**
+      * create an GoToR object.
+      *
+      * @param number the object's number
+      * @param fileSpec the fileSpec associated with the action
+      * @param dest a named destination within the remote document
+      */
+     public PDFGoToRemote(int number, PDFFileSpec pdfFileSpec, String dest) {
+ 
+         /* generic creation of object */
+         super(number);
+ 
+         this.pdfFileSpec = pdfFileSpec;
+         this.destination = dest;
+     }
+ 
+     /**
       * return the action string which will reference this object
       *
       * @return the action String
***************
*** 51,59 ****
      public byte[] toPDF() {
          String p = new String(this.number + " " + this.generation + " obj\n"
                                + "<<\n/S /GoToR\n" + "/F "
!                               + pdfFileSpec.referencePDF() + "\n"
!                               + "/D [ 0 /XYZ null null null ]"
!                               + " \n>>\nendobj\n");
  
          try {
              return p.getBytes(PDFDocument.ENCODING);
--- 85,99 ----
      public byte[] toPDF() {
          String p = new String(this.number + " " + this.generation + " obj\n"
                                + "<<\n/S /GoToR\n" + "/F "
!                               + pdfFileSpec.referencePDF() + "\n");
!         
!         if (destination != null) {
!             p += "/D (" + this.destination + ")";
!         } else {
!             p += "/D [ " + this.pageReference + " /XYZ null null null ]";
!         }
! 
!         p += " \n>>\nendobj\n";
  
          try {
              return p.getBytes(PDFDocument.ENCODING);
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/org/apache/fop/pdf/PDFRoot.java projekte/infotakt/vdp/fop/src/org/apache/fop/pdf/PDFRoot.java
*** fop/xml-fop/src/org/apache/fop/pdf/PDFRoot.java	Fri May 31 02:17:16 2002
--- projekte/infotakt/vdp/fop/src/org/apache/fop/pdf/PDFRoot.java	Tue Jan 21 13:02:27 2003
***************
*** 11,16 ****
--- 11,17 ----
  import java.io.IOException;
  import java.io.UnsupportedEncodingException;
  import java.io.PrintWriter;
+ import java.util.*;
  
  /**
   * class representing a Root (/Catalog) object
***************
*** 28,33 ****
--- 29,39 ----
      private PDFOutline _outline;
  
      /**
+      * Collection of destinations
+      */
+     private Collection _destinations;
+ 
+     /**
       * create a Root (/Catalog) object. NOTE: The PDFRoot
       * object must be created before the PDF document is
       * generated, but it is not assigned an object ID until
***************
*** 76,81 ****
--- 82,94 ----
          return _outline;
      }
  
+     public Collection getDestinations() {
+         if (_destinations == null) {
+             _destinations = new ArrayList();
+         }
+         return _destinations;
+     }
+  
  
      /**
       * represent the object as PDF.
***************
*** 95,100 ****
--- 108,121 ----
              p.append(" /Outlines " + _outline.referencePDF() + "\n");
              p.append(" /PageMode /UseOutlines\n");
  
+         }
+         if (_destinations != null) {
+            p.append(" /Names << /Dests << /Names [ ");
+           for (Iterator i = _destinations.iterator(); i.hasNext(); ) {
+               PDFDestination dest = (PDFDestination)i.next();
+               p.append(dest.toPDF());
+            }
+            p.append(" ] >> >>\n");
          }
          p.append(" >>\nendobj\n");
  
diff -brc -x *~ -x .nbattrs -x CVS fop/xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java projekte/infotakt/vdp/fop/src/org/apache/fop/render/pdf/PDFRenderer.java
*** fop/xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java	Thu Jan  9 02:25:41 2003
--- projekte/infotakt/vdp/fop/src/org/apache/fop/render/pdf/PDFRenderer.java	Tue Jan 21 19:42:55 2003
***************
*** 915,920 ****
--- 915,923 ----
                  ExtensionObj ext = (ExtensionObj) extensions.get(i);
                  if (ext instanceof Outline) {
                      renderOutline((Outline) ext);
+                 } else if (ext instanceof Destination) {
+                     Destination d = (Destination)ext;
+                     pdfDoc.addDestination(d.getDestinationName(), d.getInternalDestination());
                  }
              }
          }
