Introduction
Converting an online URL to an “offline” URL can be as simple as identifying which of the following patterns it matches and performing the substitutions described in each. If your URL does not match one of these patterns, it probably isn’t a universal URL.
This document also describes each URL and what the parameters mean, as well as to what book formats it applies. This is provided for informational purposes only. To convert a URL from universal to offline, you don’t need to know anything about the book, such as which format it is. Just match the patterns.
The three book formats are as follows:
- XML-based refers to our legacy DTD and is sometimes also referred to as DashML.
- PDF-based refers to fixed layout books built using PDF input files.
- EPUB-based refers to our newer books built using EPUB input files.
Note: The Pageburst branded client for Mac / Windows produces Universal URLs that also fit this same format, except that the “online.vitalsource.com” hostname is replaced with the branded “pageburstls.elsevier.com” hostname.
1. Book URL
A book URL just links the user to a book without specifying any specific location within the book.
Book URLs apply to XML-based, PDF-based, and EPUB-based books.
These URLs for online take the form:
http://online.vitalsource.com/books/[VBID]
To convert this to an offline URL just construct the URL as follows:
vbk://[VBID]
For example, this URL:
http://online.vitalsource.com/books/L-999-70168
would become this URL:
vbk://L-999-70168
All of the other URL formats contain the book URL with additional path components appended to it describing a location within the book. The path component immediately after the VBID in the URL will determine the type of the URL, according to the following table:
Path Component |
URL Type |
outline |
Outline URL |
id |
ID URL |
page |
Page URL |
pageid |
Page ID URL |
epubcfi |
EPUB CFI URL |
If this path component exists but does not match any of the values described in this document, then the URL is not a valid universal URL, and you should not attempt to convert it.
Additionally, the Search Query URL format is a book URL with a search query string, but no additional path components.
2. Outline URL
An outline URL specifies the VBID of a book and an outline number to go to within a book. Outline numbers only apply to XML-based books.
Universal URL format:
http://online.vitalsource.com/books/[VBID]/outline/[outline number]
Offline URL Format:
vbk://[VBID]#outline([outline number])
For example, this URL:
http://online.vitalsource.com/books/L-999-70168/outline/18
Becomes this URL:
vbk://L-999-70168#outline(18)
3. ID URL
An ID URL specifies the VBID of a book and an identifier to go to within the book. An identifier is a unique ID specified in the markup that uniquely identifies an element. These are most commonly used with figures and tables, but they can appear on other elements as well.
ID URLs only apply to XML-based books.
Universal URL format:
http://online.vitalsource.com/books/[VBID]/id/[IDENTIFIER]
Offline URL Format:
vbk://[VBID]#[IDENTIFIER]
For example, this URL:
http://online.vitalsource.com/books/9780072965476/id/ch08fig04
Becomes this URL:
vbk://9780072965476#ch08fig04
4. Search query URL
A search query specifies the VBID of a book, and one or more search terms. When the URL is opened, it opens the book and performs a search for the search terms. Search terms MUST be URL encoded.
Search query URLs apply to XML-based, PDF-based, and EPUB-based books.
Universal URL Format:
http://online.vitalsource.com/books/[VBID]?q=[SEARCH TERMS]
Offline URL format:
vbk://[VBID]?q=[SEARCH TERMS]
For example, this URL:
http://online.vitalsource.com/books/9780072965476?q=political%20movement
Becomes this URL:
vbk://9780072965476?q=political%20movement
5. Page URL
Page URLs specify the VBID of a book, and a printed page number to go to within that book.
Page URLs apply to both XML-based, PDF-based, and EPUB-based books.
Universal URL Format:
http://online.vitalsource.com/books/[VBID]/page/[PAGE]
Offline URL Format:
vbk://[VBID]#page([PAGE])
For example, this URL:
http://online.vitalsource.com/books/PBK9780135024171/page/1
Becomes this URL:
vbk://PBK9780135024171#page(1)
6. Page ID URL
Page ID URLs specify both the VBID of a book, and a page ID. A page ID is a zero-based index that specifies a page within a PDF-based book. (For example, the cover is page ID 0.) Page IDs are used in cases where a page in a PDF-based book does not have a printed page number associated with it.
Page ID URLs only apply to PDF-based books.
Universal URL Format:
http://online.vitalsource.com/books/[VBID]/pageid/[PAGE ID]
Offline URL Format:
vbk://[VBID]#pageid([PAGE ID])
For example, this URL:
http://online.vitalsource.com/books/PBK9780135024171/pageid/0
Becomes this URL:
vbk://PBK9780135024171#pageid(0)
7. EPUB CFI URL
EPUB CFI URLs specify the VBID of a book along with a CFI specifying the location within the book. CFI is a part of the EPUB standard that specifies a unique identifier for any location within an EPUB document.
A CFI resembles a path. For example: “/6/4!/10/4”
For more information on CFI see: http://idpf.org/epub/linking/cfi/epub-cfi.html
EPUB CFI URLs only apply to EPUB-based books.
Notes:
- The vbk:// form of these URLs is different from the other URL types. Instead of using a URL fragment to specify the CFI, the CFI is specified within the path in precisely the same way that it is specified in the Universal URL format. Conversion of these URLs between the universal and offline formats is therefore much simpler and can be performed by replacing the prefix “http://online.vitalsource.com/books/” with the prefix “vbk://” with no parsing necessary.
- When escaping a raw CFI string for inclusion in the path portion of a CFI URL, characters that are legal in a path should not be URL escaped. This improves the readability of the CFI URL. Characters that should not be URL escaped in a CFI are : / and ! .
- Also note that there is no / character between “epubcfi” and “[EPUBCFI]” (the CFI string). A CFI string is a path, and it always begins with a /. This initial / is the path separator between “epubcfi” and the rest of the path.
Universal URL Format:
http://online.vitalsource.com/books/[VBID]/epubcfi[EPUBCFI]
Offline URL Format:
vbk://[VBID]/epubcfi[EPUBCFI]
For example, this URL:
http://online.vitalsource.com/books/EPUB-TEST-9781444331332/epubcfi/6/28!/4/2/6/3:0
Becomes this URL:
vbk://EPUB-TEST-9781444331332/epubcfi/6/28!/4/2/6/3:0
In these examples the CFI string is:
/6/28!/4/2/6/3:0
Note that the leading slash in the CFI string is also the separator between the “epubcfi” path component and the CFI, and also note that : / and ! are not escaped.
Client Compatibility Chart
This chart lists each of the offline URL types and which clients (and versions) support each of them. A version number indicates the earliest version of the client that supports that format.
|
Desktop (Mac / Win) |
iOS |
Android |
Book URL |
5.5 |
1.3.2 |
1.2.1 |
Outline URL |
5.5 |
1.3.2 |
1.2.1 |
ID URL |
5.5 |
1.3.2 |
1.2.1 |
Search Query URL |
5.5 |
1.3.2 |
1.2.1 |
Page URL |
5.5 |
1.3.2 |
1.2.1 |
Page ID URL |
5.5 |
1.3.2 |
1.2.1 |
EPUB CFI URL |
6.0 |
2.1.1 |
1.4 |
Comments
Please sign in to leave a comment.