[ 
https://issues.apache.org/jira/browse/PDFBOX-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069988#comment-13069988
 ] 

Andreas Lehmkühler commented on PDFBOX-1064:
--------------------------------------------

This is not a bug. PDOutlinItem contains 2 methods called "setDestination" with 
different signatures. 

public void setDestination( PDDestination dest )
public void setDestination( PDPage page )

When you're using "null" as value for the parameter the compiler can't decide 
which method to use. Use a cast to solve that issue:

setDestionation( (PDDestionation)null );

> Can't set destination of a PDOutlineItem to null
> ------------------------------------------------
>
>                 Key: PDFBOX-1064
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1064
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>         Environment: Windows 7, Eclipse Helios SR2 
>            Reporter: Gilad Denneboom
>            Priority: Minor
>              Labels: bookmarks
>
> Because of the overloaded setDestination() method of PDOutlineItem it's not 
> possible to set it to null and therefore remove the Go To Named Destination 
> action, like it is possible with PDOutlineItem.setAction(), for example.
> Sample code:
> PDOutlineItem bookmark = 
> doc.getDocumentCatalog().getDocumentOutline().getFirstChild();
> bookmark.setDestination(null); // DOES NOT COMPILE

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to