pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hesham Gneady" <heshamgne...@gmail.com>
Subject Understanding PDPageXYZDestination.setTop(...)
Date Tue, 12 Dec 2017 09:50:56 GMT
Hello ,

 

I am trying to use PDPageXYZDestination to create an internal link that
could move to a specific area in another page in the same PDF. Here is the
code I've tried:

 

List<PDAnnotation> annotations = page1.getAnnotations();

PDPageXYZDestination dest = new PDPageXYZDestination();

dest.setPage( page3 );

dest.setZoom( 3 );

dest.setLeft( 200 );

dest.setTop( 200 );  // Does nothing at any value!!

txtLink.setDestination(dest);

annotations.add( txtLink );

 

When opening the output PDF using Adobe Reader and clicking the link it
takes me to page 3, zooms in to 300% and moves the viewable area 200 points
in X direction, so dest.setLeft( 200 ) works just fine, but for the Y
direction it keeps showing the top rectangle of page 3 whatever value I try
to use for dest.setTop( . ).

 

Do you understand PDPageXYZDestination.setTop( . ) wrong, or there is a bug
with it?

 

 

Best regards,

Hesham 

 

 

 



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message