Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions profiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| [Audiobook Profile](audiobook.md) | Defines a dedicated profile for audiobooks. | [https//readium.org/webpub-manifest/profiles/audiobook](https//readium.org/webpub-manifest/profiles/audiobook) |
| [Digital Visual Narratives Profile](divina.md) | Defines a dedicated profile for visual narratives (comics, manga and bandes dessinées). | [https//readium.org/webpub-manifest/profiles/divina](https//readium.org/webpub-manifest/profiles/divina) |
| [EPUB Profile](epub.md) | Additional metadata and collection roles for representing EPUB publications. |[https//readium.org/webpub-manifest/profiles/epub](https//readium.org/webpub-manifest/profiles/epub) |
| [PDF Profile](pdf.md) | Defines a dedicated profile for representing PDF publications. | [https://readium.org/webpub-manifest/profiles/pdf](https://readium.org/webpub-manifest/profiles/pdf) |


## Registering a profile
Expand Down
51 changes: 51 additions & 0 deletions profiles/pdf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# PDF Profile

**Editors:**

* Michael Benowitz ([NYPL](https://www.nypl.org))

**Participate:**

* [GitHub readium/webpub-manifest](https://github.com/readium/webpub-manifest)
* [File an issue](https://github.com/readium/webpub-manifest/issues)

## Introduction

The display of static PDF files can be governed by the standard Webpub Manifest guidelines, as the format was specifically conceived of to provide a constent, portable format. However there are many optional features, mainly pertaining to accessibility and preservation, that can be communicated to users. These features may be used in a client context or used in other ways by consuming applications.

This profile is intended to ensure that full functionality of PDF resources is documented in Webpub Manifests, and conversely ensuring that PDFs with limited functionality are documented.

## 1. Declaring conformance with PDF Profile

In order for a Webpub Manifest to conform to this profile it <strong class="rfc">must</strong> include a `conformsTo` key in the `metadata` section, with `http://readium.org/webpub-manifest/profiles/pdf` as the value.

## 2. `readingOrder` resource restrictions

A conforming Webpub Manifsest <strong class="rfc">must</strong> only refererence PDF documenents with a media type of `application/pdf` in the `readingOrder` section.

## 3. PDF Encryption

If a Webpub Manifest contains encrypted resources, those resources <strong class="rfc">must</strong> include an [encryption object](https://github.com/readium/webpub-manifest/blob/master/modules/encryption.md#encryption-object) in the `properties` object attached to each `Link` object.


## 4. Link Parameters

A Manifest <strong class="rfc">may</strong> include the following parameters in the `href` attribute of elements in the `readingOrder` and `toc` sections.

| Key | Semantics | Type | Values |
| ----- | --------- | -------- | --------- |
| [start](#start) | Specifies the initial page of the PDF to display when displaying this resource | Integer | 1 to (page count of current resource) |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing fragments in the reading order might introduce a lot of complexities in the toolkits. We'll need to talk about this, would you be able to come to one of our weekly Zoom meetings (next one)?

That being said, you could use the fragment identifier page instead of start, as it is widely supported for PDF:

The list of PDF-open parameters and the action they imply is:

  • page=<pagenum> Open the specified (physical) page.

https://datatracker.ietf.org/doc/html/rfc3778#section-3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @mickael-menu, we want to avoid fragments in the reading order.

This use case isn't restricted to PDF either and would be better addressed in the main spec IMO:

  • if this matches a resource, specifying start as a rel in the readingOrder is enough
  • if this matches a fragment of a resource, then a new Link Object in links would be the better option

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, would be happy chat about this! I may not be able to make next weeks, but will try to attend one soon. I'm curious about the fragment discussion and what we can do to support features like this without introducing too much complexity.

@HadrienGardeur can you explain your second point regarding representing fragments as a new object in links? I'm not sure I follow how this addresses the functionality we're looking for.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's say that we have the following RWPM:

{
  "metadata": {
    "title": "Publication containing multiple PDF files",
    "conformsTo": "http://readium.org/webpub-manifest/profiles/pdf"
  },
  "readingOrder": [
    {
      "href": "introduction.pdf",
      "type": "application/pdf"
    },
    {
      "href": "chapter1.pdf",
      "type": "application/pdf"
    },
    {
      "href": "chapter2.pdf",
      "type": "application/pdf"
    }
  ]
}

If you want to only include a subset of each PDF in the full publication, that's not something that we support with RWPM.

But if the first time that you open that publication, you'd like the jump straight to the first chapter, this could be supported using start in readingOrder:

{
  "metadata": {
    "title": "Publication containing multiple PDF files",
    "conformsTo": "http://readium.org/webpub-manifest/profiles/pdf"
  },  
  "readingOrder": [
    {
      "href": "introduction.pdf",
      "type": "application/pdf"
    },
    {
      "rel": "start",
      "href": "chapter1.pdf",
      "type": "application/pdf"
    },
    {
      "href": "chapter2.pdf",
      "type": "application/pdf"
    }
  ]
}

If you need to point to a fragment instead of a resource, this could be handled using links:

{
  "metadata": {
    "title": "Publication containing multiple PDF files",
    "conformsTo": "http://readium.org/webpub-manifest/profiles/pdf"
  },
  "links": [
    "rel": "start",
    "href": "introduction.pdf?page=5"
  ],
  "readingOrder": [
    {
      "href": "introduction.pdf",
      "type": "application/pdf"
    },
    {
      "href": "chapter1.pdf",
      "type": "application/pdf"
    },
    {
      "href": "chapter2.pdf",
      "type": "application/pdf"
    }
  ]
}


### start

In some cases a system may wish to display a PDF but skip certain pages that appear at the beginning of the file, including:
- Skipping blank pages
- Skipping repetitive or unnecessary front matter
- Providing a direct link to a chapter, section or sub-section within a larger PDF resources

The `start` parameter conveys this information in a way that aligns with other standards for displaying and consuming PDF resources. This parameter is indexed from 1 to match the mental model for most users.
```
https://example.com/example.pdf?start=1 # First page, equivalent to no parameter specification
https://example.com/example.pdf?start=2 # Second page
https://example.com/example.pdf?start=10 # Arbitrary page position
```