List of usage examples for com.itextpdf.text Annotation Annotation
public Annotation(final String title, final String text)
Annotation
with a certain title and some text. From source file:com.vectorprint.report.itext.debug.DebugHelper.java
License:Open Source License
/** * When in debugging mode, adds a border to the image and calls {@link VectorPrintDocument#addHook(com.vectorprint.report.itext.VectorPrintDocument.AddElementHook) * } to be able to print debugging info and link for the image * * @param canvas//from ww w. j a v a 2 s . c o m * @param img * @param bordercolor * @param styleClass * @param extraInfo * @param settings * @param layerAware * @param document */ public static void debugImage(PdfContentByte canvas, Image img, Color bordercolor, String styleClass, String extraInfo, EnhancedMap settings, LayerManager layerAware, VectorPrintDocument document) { if (null != img) { img.setBorder(Rectangle.BOX); img.setBorderWidth(0.3f); img.setBorderColor(itextHelper.fromColor(bordercolor)); if (styleClass == null) { log.warning("not showing link to styleClass because there is no styleClass"); return; } img.setAnnotation(new Annotation(DEBUG, "click for link to styleClass information (" + styleClass + extraInfo + ")")); document.addHook(new VectorPrintDocument.AddElementHook( VectorPrintDocument.AddElementHook.INTENTION.DEBUGIMAGE, img, null, styleClass)); } }