intarsys PDF library API

de.intarsys.pdf.pd
Class PDAnnotationTools

java.lang.Object
  extended by de.intarsys.pdf.pd.PDAnnotationTools

public class PDAnnotationTools
extends Object

Tool class for common tasks with PDAnnotation objects.


Field Summary
static String CAPTION_CHECK
           
static String CAPTION_CIRCLE
           
static String CAPTION_CROSS
           
static String CAPTION_DIAMOND
           
static String CAPTION_SQUARE
           
static String CAPTION_STAR
           
 
Method Summary
static PDAppearance getAppearance(PDAnnotation annotation)
          The PDAppearance for annotation.
static float[] getBorderColor(PDWidgetAnnotation annotation)
           
static float[] getBorderColorNegative(PDWidgetAnnotation annotation)
           
static float[] getFillColor(PDWidgetAnnotation annotation)
           
static float[] getFillColorNegative(PDWidgetAnnotation annotation)
           
static PDAnnotation getNextAnnotation(PDAnnotation annotation)
          Returns the next annotation following annotation on the same page.
static PDAnnotation getNextAnnotationAllPages(PDAnnotation annotation)
          Returns the next annotation following annotation in the whole document.
static PDPage getPage(PDAnnotation annotation)
           
static PDAnnotation getPreviousAnnotation(PDAnnotation annotation)
          Returns the annotation preceding annotation on the same page.
static PDAnnotation getPreviousAnnotationAllPages(PDAnnotation annotation)
          Returns the annotation preceding annotation in the whole document.
static COSName getStateChecked(PDWidgetAnnotation annotation)
          Lookup the state that is used to represent "not off" in annotation.
static boolean isAnnotationSpec14(COSDictionary dict)
          Checks a COSDictionary for being a subtyped known annotation as of Spec PDF 1.4
static boolean isStateChecked(COSName state)
          true if state represents a state that is not "/Off".
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAPTION_CHECK

public static final String CAPTION_CHECK
See Also:
Constant Field Values

CAPTION_CIRCLE

public static final String CAPTION_CIRCLE
See Also:
Constant Field Values

CAPTION_CROSS

public static final String CAPTION_CROSS
See Also:
Constant Field Values

CAPTION_DIAMOND

public static final String CAPTION_DIAMOND
See Also:
Constant Field Values

CAPTION_SQUARE

public static final String CAPTION_SQUARE
See Also:
Constant Field Values

CAPTION_STAR

public static final String CAPTION_STAR
See Also:
Constant Field Values
Method Detail

getPage

public static PDPage getPage(PDAnnotation annotation)

getNextAnnotation

public static PDAnnotation getNextAnnotation(PDAnnotation annotation)
Returns the next annotation following annotation on the same page. Returns null if no annotation following annotation could be found or annotation is the last one on the page.

Parameters:
annotation -
Returns:
the next annotation or null

getNextAnnotationAllPages

public static PDAnnotation getNextAnnotationAllPages(PDAnnotation annotation)
Returns the next annotation following annotation in the whole document. Returns null if no annotation following annotation could be found in the document.

Parameters:
annotation -
Returns:
the next annotation or null

getPreviousAnnotation

public static PDAnnotation getPreviousAnnotation(PDAnnotation annotation)
Returns the annotation preceding annotation on the same page. Returns null if no annotation preceding annotation could be found or annotation is the first one on the page.

Parameters:
annotation -
Returns:
the preceding annotation or null

getPreviousAnnotationAllPages

public static PDAnnotation getPreviousAnnotationAllPages(PDAnnotation annotation)
Returns the annotation preceding annotation in the whole document. Returns null if no annotation preceding annotation could be found in the document.

Parameters:
annotation -
Returns:
the previous annotation or null

isAnnotationSpec14

public static boolean isAnnotationSpec14(COSDictionary dict)
Checks a COSDictionary for being a subtyped known annotation as of Spec PDF 1.4

Parameters:
dict -
Returns:
true if known as of Spec PDF 1.4

getBorderColor

public static float[] getBorderColor(PDWidgetAnnotation annotation)

getBorderColorNegative

public static float[] getBorderColorNegative(PDWidgetAnnotation annotation)

getFillColor

public static float[] getFillColor(PDWidgetAnnotation annotation)

getFillColorNegative

public static float[] getFillColorNegative(PDWidgetAnnotation annotation)

getAppearance

public static PDAppearance getAppearance(PDAnnotation annotation)
The PDAppearance for annotation. If no PDAppearance is yet available, a new one is created but NOT associated with the annotation. This behavior is intended to allow for dynamic appearance creation when rendering without changing the document itself.

Returns:
The PDAppearance for annotation.

getStateChecked

public static COSName getStateChecked(PDWidgetAnnotation annotation)
Lookup the state that is used to represent "not off" in annotation.

Parameters:
annotation - The annotation to inspect for its "not off" state.
Returns:
Lookup the state that is used to represent "not off" in annotation.

isStateChecked

public static boolean isStateChecked(COSName state)
true if state represents a state that is not "/Off". "/Off" is the only legal way to switch of a toggle button, so anything else is "on".

Parameters:
state - The state to inspect if it is not "/Off".
Returns:
true if state represents a state that is not "/Off".

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.