Java create link to page in PDF with PDFBox -


my program links position in pdf-file page in same file. can click on defined position in file you'll linked page.

i use pdrectangle define position. unfortunately rectangle visible in document. want create link without visible border.

my code:

    pdactiongoto action = new pdactiongoto();     action.setdestination(destination);      pdannotationlink annotationlink = new pdannotationlink();     annotationlink.setaction(action);      pdrectangle position = new pdrectangle();     position.setlowerleftx(bookmarklinkpositionentry.getlowerleftx());     position.setlowerlefty(bookmarklinkpositionentry.getlowerlefty());     position.setupperrightx(bookmarklinkpositionentry.getupperrightx());     position.setupperrighty(bookmarklinkpositionentry.getupperrighty());      annotationlink.setrectangle(position);      destinationpdf.getpage(0).getannotations().add(annotationlink); 

i tried use annotationlink.sethidden(true); , annotationlink.setnoview(true);. documentation says "set hidden flag." , "set noview flag." , don't know happened there.

how can change visibility of rectangle or remove border completely?

you'll need set border style:

pdborderstyledictionary borderuline = new pdborderstyledictionary(); borderuline.setstyle(pdborderstyledictionary.style_underline); borderuline.setwidth(0); annotationlink.setborderstyle(borderuline); 

more on topic in addannotations.java example in source code download.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -