txtLink.setBorderStyle(borderULine); pageLink.setBorderStyle(borderULine);
private void addLinkToPage(PDPage page, PDAnnotationLink annot) { PDBorderStyleDictionary styleDict = new PDBorderStyleDictionary(); styleDict.setWidth(0); styleDict.setStyle(PDBorderStyleDictionary.STYLE_SOLID); annot.setBorderStyle(styleDict); try { List<PDAnnotation> annots = page.getAnnotations(); if (annots == null) { annots = new ArrayList<PDAnnotation>(); page.setAnnotations(annots); } annots.add(annot); } catch (IOException e) { throw new PdfContentStreamAdapter.PdfException("processLink", e); } }
private void addLinkToPage(PDPage page, PDAnnotationLink annot) { PDBorderStyleDictionary styleDict = new PDBorderStyleDictionary(); styleDict.setWidth(0); styleDict.setStyle(PDBorderStyleDictionary.STYLE_SOLID); annot.setBorderStyle(styleDict); try { List<PDAnnotation> annots = page.getAnnotations(); if (annots == null) { annots = new ArrayList<PDAnnotation>(); page.setAnnotations(annots); } annots.add(annot); } catch (IOException e) { throw new PdfContentStreamAdapter.PdfException("processLink", e); } }
private void addLinkToPage(PDPage page, PDAnnotationLink annot) { PDBorderStyleDictionary styleDict = new PDBorderStyleDictionary(); styleDict.setWidth(0); styleDict.setStyle(PDBorderStyleDictionary.STYLE_SOLID); annot.setBorderStyle(styleDict); try { List<PDAnnotation> annots = page.getAnnotations(); if (annots == null) { annots = new ArrayList<PDAnnotation>(); page.setAnnotations(annots); } annots.add(annot); } catch (IOException e) { throw new PdfContentStreamAdapter.PdfException("processLink", e); } }
PDBorderStyleDictionary borderULine = new PDBorderStyleDictionary(); borderULine.setWidth(0); txtLink.setBorderStyle(borderULine); PDActionGoTo action = (PDActionGoTo) actionsMap.get(key); txtLink.setAction(action);
PDBorderStyleDictionary borderULine = new PDBorderStyleDictionary(); borderULine.setStyle(PDBorderStyleDictionary.STYLE_UNDERLINE); borderULine.setWidth(1); PDAnnotationLink txtLink = new PDAnnotationLink(); txtLink.setBorderStyle(borderULine); // Set the rectangle containing the link textWidth = font.getStringWidth("Click here") / 1000 * xscale; position = new PDRectangle(); position.setLowerLeftX(...); position.setLowerLeftY(...); position.setUpperRightX(...); position.setUpperRightY(...); txtLink.setRectangle(position); // add an action PDActionURI action = new PDActionURI(); action.setURI("http://pdfbox.apache.org"); txtLink.setAction(action); annotations.add(txtLink);
txtLink.setBorderStyle(borderULine); pageLink.setBorderStyle(borderULine);