Change the Document Title

PSPDFKit by default parses the document and extracts the PDF title from the PDF metadata. If there is no metadata or the PDF name equals "Untitled", then it'll fall back to the file name, just removing the .pdf filetype.

PSPDFKit exposes various metadata keys:

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public abstract class DocumentMetadata {
    @Nullable
    public abstract String getTitle();

    @Nullable
    public abstract String getAuthor();

    @Nullable
    public abstract String getSubject();

    @Nullable
    public abstract String getKeywords();

    @Nullable
    public abstract String getCreator();

    @Nullable
    public abstract String getProducer();

    @Nullable
    public abstract String getCreationDate();

    @Nullable
    public abstract String getModDate();
}

You can learn more about PDF metadata in the PDF Reference 1.7, Table 317:

Actionbar Changes

PSPDFKit by default sets the title of the navigation bar to the document title. To avoid that behaviour and customize the document title you'll have to extend PdfActivity and override onSetActivityTitle() method.