-
Notifications
You must be signed in to change notification settings - Fork 26
Add a start landmark (to the PDF Profile) #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mwbenowitz
wants to merge
2
commits into
readium:master
Choose a base branch
from
mwbenowitz:pdf-profile
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | | ||
|
|
||
| ### 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 | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
pageinstead ofstart, as it is widely supported for PDF:There was a problem hiding this comment.
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:
startas arelin thereadingOrderis enoughlinkswould be the better optionThere was a problem hiding this comment.
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.There was a problem hiding this comment.
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
startinreadingOrder:{ "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" } ] }