Hi, 
  I am using FOP 0.20.3 and stumbled across  the interesting behavior that 
even if you specify an external link to a pdf file, like 

<fo:basic-link color="#0000ff"
      external-destination="http://www.somewhere.com/test.pdf";> some pdf file 
</fo:basic-link>
the pdf link is transformed into a FileSpec.

I guess this is a bug rather than a feature and if so, can be traced to:

public PDFLink makeLink(Rectangle rect, String destination,  int linkType) 
in Fop-0.20.3rc/src/org/apache/fop/pdf/PDFDocument.java
which should be like this rather than with the lines uncommented:

 public PDFLink makeLink(Rectangle rect, String destination,
                            int linkType) {

        PDFLink linkObject;
        PDFAction action;

        PDFLink link = new PDFLink(++this.objectcount, rect);
        this.objects.addElement(link);

        if (linkType == LinkSet.EXTERNAL) {
            // check destination
            //if (destination.endsWith(".pdf")) {    // FileSpec
            //    PDFFileSpec fileSpec = new PDFFileSpec(++this.objectcount,
            //                                           destination);
            //    this.objects.addElement(fileSpec);
            //    action = new PDFGoToRemote(++this.objectcount, fileSpec);
            //    this.objects.addElement(action);
            //    link.setAction(action);
            //} else {                               // URI
                PDFUri uri = new PDFUri(destination);
                link.setAction(uri);
            //}
        } else {                                   // linkType is internal
            String goToReference = getGoToReference(destination);
            PDFInternalLink internalLink = new PDFInternalLink(goToReference);
            link.setAction(internalLink);
        }
        return link;
    }


thanks, 
-ram







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to