public interface

AppearanceStreamGenerator

com.pspdfkit.annotations.appearance.AppearanceStreamGenerator
Known Indirect Subclasses

Class Overview

Interface for custom annotation appearance stream generators.

Instances can be set on Annotation via setAppearanceStreamGenerator(AppearanceStreamGenerator) to replace default PSPDFKit provided appearance stream.

The annotation will use the first page of the PDF opened from DataProvider returned by getDataProviderForAnnotation(Annotation, EnumSet) as its appearance and this content will be embedded into the PDF.

Summary

Nested Classes
enum AppearanceStreamGenerator.AppearanceStreamGenerationOptions Options for appearance stream generation. 
Public Methods
abstract DataProvider getDataProviderForAnnotation(Annotation annotation, EnumSet<AppearanceStreamGenerator.AppearanceStreamGenerationOptions> options)
Called when the appearance stream data for the given annotation is needed.
abstract boolean shouldUseGeneratorForAnnotation(Annotation annotation)
Asks the generator whether it should be used to generate the appearance stream for annotation.

Public Methods

public abstract DataProvider getDataProviderForAnnotation (Annotation annotation, 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.

public abstract boolean shouldUseGeneratorForAnnotation (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.