use of com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary in project PdfBox-Android by TomRoush.
the class PDCircleAppearanceHandler method getLineWidth.
/**
* Get the line with of the border.
*
* Get the width of the line used to draw a border around the annotation.
* This may either be specified by the annotation dictionaries Border
* setting or by the W entry in the BS border style dictionary. If both are
* missing the default width is 1.
*
* @return the line width
*/
// TODO: according to the PDF spec the use of the BS entry is annotation
// specific
// so we will leave that to be implemented by individual handlers.
// If at the end all annotations support the BS entry this can be handled
// here and removed from the individual handlers.
float getLineWidth() {
PDAnnotationMarkup annotation = (PDAnnotationMarkup) getAnnotation();
PDBorderStyleDictionary bs = annotation.getBorderStyle();
if (bs != null) {
return bs.getWidth();
}
COSArray borderCharacteristics = annotation.getBorder();
if (borderCharacteristics.size() >= 3) {
COSBase base = borderCharacteristics.getObject(2);
if (base instanceof COSNumber) {
return ((COSNumber) base).floatValue();
}
}
return 1;
}
use of com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary in project PdfBox-Android by TomRoush.
the class PDLinkAppearanceHandler method getLineWidth.
/**
* Get the line with of the border.
*
* Get the width of the line used to draw a border around the annotation.
* This may either be specified by the annotation dictionaries Border
* setting or by the W entry in the BS border style dictionary. If both are
* missing the default width is 1.
*
* @return the line width
*/
// TODO: according to the PDF spec the use of the BS entry is annotation
// specific
// so we will leave that to be implemented by individual handlers.
// If at the end all annotations support the BS entry this can be handled
// here and removed from the individual handlers.
float getLineWidth() {
PDAnnotationLink annotation = (PDAnnotationLink) getAnnotation();
PDBorderStyleDictionary bs = annotation.getBorderStyle();
if (bs != null) {
return bs.getWidth();
}
COSArray borderCharacteristics = annotation.getBorder();
if (borderCharacteristics.size() >= 3) {
COSBase base = borderCharacteristics.getObject(2);
if (base instanceof COSNumber) {
return ((COSNumber) base).floatValue();
}
}
return 1;
}
Aggregations