Class AssetDataProvider

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      AssetDataProvider(String assetName) Default constructor taking the assetName of a document.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      long getSize() Return the actual file size of the PDF document which is provided by this data provider.
      String getUid() Unique document identifier used in all caching processes in PSPDFKit.
      String getTitle() Displayable document title to be used if PDF document does not contain metadata.
      int describeContents()
      void writeToParcel(@NonNull() Parcel dest, int flags)
      Uri getUri() Returns the Uri from which this provided was created.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AssetDataProvider

        AssetDataProvider(String assetName)
        Default constructor taking the assetName of a document.
        Parameters:
        assetName - Filename of the asset in the application assets folder.
    • Method Detail

      • getSize

         long getSize()

        Return the actual file size of the PDF document which is provided by this data provider. If the data provider can't determine the correct file size (e.g. in case of an error) this method has to return FILE_SIZE_UNKNOWN.

        Returns:

        Returns size of PDF document data in bytes, or FILE_SIZE_UNKNOWN in case of an error.

      • getUid

        @NonNull() String getUid()

        Unique document identifier used in all caching processes in PSPDFKit. Must be equal or shorter than 50 chars. This method must be implemented for caching to work properly.

        Returns:

        Unique identifier of the provided document. Implementations may not return null or an exception will be thrown.

      • getTitle

        @NonNull() String getTitle()

        Displayable document title to be used if PDF document does not contain metadata. For example, for file-based providers this should return the filename. `.pdf` extensions will be stripped automatically.

        Returns:

        Fallback document title if PDF document does not contain the required metadata. May be null.

      • getUri

        @NonNull() Uri getUri()

        Returns the Uri from which this provided was created.

        Returns:

        The Uri this data provider was created from.