Interface AppearanceStreamGenerator
-
- All Implemented Interfaces:
public interface AppearanceStreamGenerator
Interface for custom annotation appearance stream generators.
Instances can be set on Annotation via setAppearanceStreamGenerator to replace default PSPDFKit provided appearance stream.
The annotation will use the first page of the PDF opened from DataProvider returned by getDataProviderForAnnotation as its appearance and this content will be embedded into the PDF.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
AppearanceStreamGenerator.AppearanceStreamGenerationOptions
Options for appearance stream generation.
-
Method Summary
Modifier and Type Method Description abstract DataProvider
getDataProviderForAnnotation(@NonNull() Annotation annotation, @NonNull() EnumSet<AppearanceStreamGenerator.AppearanceStreamGenerationOptions> options)
Called when the appearance stream data for the given annotation is needed. abstract boolean
shouldUseGeneratorForAnnotation(@NonNull() Annotation annotation)
Asks the generator whether it should be used to generate the appearance stream for annotation
.-
-
Method Detail
-
getDataProviderForAnnotation
@Nullable() abstract DataProvider getDataProviderForAnnotation(@NonNull() Annotation annotation, @NonNull() EnumSet<AppearanceStreamGenerator.AppearanceStreamGenerationOptions> options)
Called when the appearance stream data for the given annotation is needed.
The data represented by the DataProvider must be a validly formed PDF. The contents of the first page of that PDF file will be embedded in the
annotation
as its appearance stream.- Parameters:
annotation
- Annotation for which the AP stream is being generated.options
- Enum set of AP stream generation options.- Returns:
DataProvider representing a validly formed PDF or
null
to use annotation's default AP stream.
-
shouldUseGeneratorForAnnotation
abstract boolean shouldUseGeneratorForAnnotation(@NonNull() Annotation annotation)
Asks the generator whether it should be used to generate the appearance stream for
annotation
.- Parameters:
annotation
- Annotation for which the AP stream is being generated.
-
-
-
-