public class

CustomStampAppearanceStreamGenerator

extends Object
implements AppearanceStreamGenerator
java.lang.Object
   ↳ com.pspdfkit.annotations.stamps.CustomStampAppearanceStreamGenerator

Class Overview

Collection of AppearanceStreamGenerator that can be registered via addAppearanceStreamGenerator(AppearanceStreamGenerator) to generate appearance streams for stamps with custom subjects.

Summary

Public Constructors
CustomStampAppearanceStreamGenerator()
Public Methods
void addAppearanceStreamGenerator(String subject, AppearanceStreamGenerator appearanceStreamGenerator)
Adds new appearance stream generator for stamp annotations with given subject.
DataProvider getDataProviderForAnnotation(Annotation annotation, EnumSet<AppearanceStreamGenerator.AppearanceStreamGenerationOptions> options)
Called when the appearance stream data for the given annotation is needed.
void removeAppearanceStreamGenerator(String subject)
Removes appearance stream generator for the given subject that was previously registered via addAppearanceStreamGenerator(String, AppearanceStreamGenerator).
boolean shouldUseGeneratorForAnnotation(Annotation annotation)
Asks the generator whether it should be used to generate the appearance stream for annotation.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pspdfkit.annotations.appearance.AppearanceStreamGenerator

Public Constructors

public CustomStampAppearanceStreamGenerator ()

Public Methods

public void addAppearanceStreamGenerator (String subject, AppearanceStreamGenerator appearanceStreamGenerator)

Adds new appearance stream generator for stamp annotations with given subject. This overrides previously registered appearance stream generator for the subject.

Parameters
subject Subject of annotations that will use appearanceStreamGenerator to generate their AP stream.
appearanceStreamGenerator Appearance stream generator for the specified subject.

public 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 void removeAppearanceStreamGenerator (String subject)

Removes appearance stream generator for the given subject that was previously registered via addAppearanceStreamGenerator(String, AppearanceStreamGenerator).

Parameters
subject Previously registered subject.

public 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.