|
20 | 20 | import java.io.IOException; |
21 | 21 | import org.apache.logging.log4j.Logger; |
22 | 22 | import org.apache.logging.log4j.LogManager; |
23 | | -import org.apache.pdfbox.cos.COSArray; |
24 | | -import org.apache.pdfbox.cos.COSBase; |
25 | | -import org.apache.pdfbox.cos.COSNumber; |
26 | 23 | import org.apache.pdfbox.pdmodel.common.PDRectangle; |
27 | 24 | import org.apache.pdfbox.pdmodel.graphics.color.PDColor; |
28 | 25 | import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; |
29 | 26 | import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationPolyline; |
30 | 27 | import org.apache.pdfbox.pdmodel.PDAppearanceContentStream; |
31 | 28 | import org.apache.pdfbox.pdmodel.PDDocument; |
32 | 29 | import static org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationLine.LE_NONE; |
33 | | -import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup; |
34 | | -import org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary; |
35 | 30 | import org.apache.pdfbox.util.Matrix; |
36 | 31 |
|
37 | 32 | /** |
@@ -213,45 +208,4 @@ public void generateDownAppearance() |
213 | 208 | { |
214 | 209 | // No down appearance generated for a polyline annotation |
215 | 210 | } |
216 | | - |
217 | | - //TODO DRY, this code is from polygonAppearanceHandler so it's double |
218 | | - |
219 | | - /** |
220 | | - * Get the line with of the border. |
221 | | - * |
222 | | - * Get the width of the line used to draw a border around the annotation. |
223 | | - * This may either be specified by the annotation dictionaries Border |
224 | | - * setting or by the W entry in the BS border style dictionary. If both are |
225 | | - * missing the default width is 1. |
226 | | - * |
227 | | - * @return the line width |
228 | | - */ |
229 | | - // TODO: according to the PDF spec the use of the BS entry is annotation |
230 | | - // specific |
231 | | - // so we will leave that to be implemented by individual handlers. |
232 | | - // If at the end all annotations support the BS entry this can be handled |
233 | | - // here and removed from the individual handlers. |
234 | | - float getLineWidth() |
235 | | - { |
236 | | - PDAnnotationMarkup annotation = (PDAnnotationMarkup) getAnnotation(); |
237 | | - |
238 | | - PDBorderStyleDictionary bs = annotation.getBorderStyle(); |
239 | | - |
240 | | - if (bs != null) |
241 | | - { |
242 | | - return bs.getWidth(); |
243 | | - } |
244 | | - |
245 | | - COSArray borderCharacteristics = annotation.getBorder(); |
246 | | - if (borderCharacteristics.size() >= 3) |
247 | | - { |
248 | | - COSBase base = borderCharacteristics.getObject(2); |
249 | | - if (base instanceof COSNumber) |
250 | | - { |
251 | | - return ((COSNumber) base).floatValue(); |
252 | | - } |
253 | | - } |
254 | | - |
255 | | - return 1; |
256 | | - } |
257 | 211 | } |
0 commit comments