Class AssetAppearanceStreamGenerator
-
- All Implemented Interfaces:
-
android.os.Parcelable
,com.pspdfkit.annotations.appearance.AppearanceStreamGenerator
public class AssetAppearanceStreamGenerator implements AppearanceStreamGenerator, Parcelable
Annotation appearance stream generator that supplies a PDF file in app assets to be used as annotation appearance stream.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<AssetAppearanceStreamGenerator>
CREATOR
-
Constructor Summary
Constructors Constructor Description AssetAppearanceStreamGenerator(String assetName)
Default constructor taking the assetName
of an AP stream source document.
-
Method Summary
Modifier and Type Method Description DataProvider
getDataProviderForAnnotation(@NonNull() Annotation annotation, @NonNull() EnumSet<AppearanceStreamGenerator.AppearanceStreamGenerationOptions> options)
Called when the appearance stream data for the given annotation is needed. boolean
shouldUseGeneratorForAnnotation(@NonNull() Annotation annotation)
Asks the generator whether it should be used to generate the appearance stream for annotation
.int
describeContents()
void
writeToParcel(Parcel dest, int flags)
int
hashCode()
boolean
equals(Object o)
-
-
Constructor Detail
-
AssetAppearanceStreamGenerator
AssetAppearanceStreamGenerator(String assetName)
Default constructor taking theassetName
of an AP stream source document.- Parameters:
assetName
- Filename of the asset in the application assets folder.
-
-
Method Detail
-
getDataProviderForAnnotation
@Nullable() 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
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.
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
hashCode
int hashCode()
-
-
-
-