Document loading
Please refer Formats for information about what file-types can be displayed.
Document Loading
Drag & Drop
Documents can simply be display by dragging them from your computer and dropping them in the according area of the jadice web viewer.
When you start dragging, the file-open-dialog will be automatically opened.
Open File
URL
When you open the viewer and pass a request-param named u
, the document will be loaded directly.
The u
-param accepts a URL-encoded Source
that looks like that:
{
"uris":[
"http://digbib.org/Franz_Kafka_1883/Amerika_.pdf"
]
}
The URL to open that document will look as follows:
https://web-viewer.jadice.com/?u=%7B%22uris%22%3A%5B%22http%3A%2F%2Fdigbib.org%2FFranz_Kafka_1883%2FAmerika_.pdf%22%5D%7D
If you provide more than one URI, the documents are loaded in the given order and displayed as a single merged document.
JavaScript API
It is possible to load documents via the JavaScript API. The syntax is simplified form of the "fusion collection" that is used in other levigo products. A more detailed description can be found here.
const compositePaged = {
pageSequences: [{
mediaType: "application/pdf",
contentURI: "http://digbib.org/Franz_Kafka_1883/Die_Verwandlung_.pdf"
}],
type: "compositePaged"
}
window.viewerApi.collectionApi.showCompositePaged(compositePaged)
Loading Multiple documents
To get a selection of multiple documents you can achieve this with the JavaScript API as follows:
const collection = {
elements: [
{
specification: {
type: "compositePaged",
pageSequences: [
{
mediaType: "application/pdf",
contentURI: "http://www.digbib.org/Franz_Kafka_1883/Der_Prozess_.pdf",
}
]
},
metadata: {override_page_sequence_name: "Der Prozess", override_page_sequence_description: "Franz Kafka: Der Prozess"}
},
{
specification: {
type: "compositePaged",
pageSequences: [
{
mediaType: "application/pdf",
contentURI: "http://www.digbib.org/Franz_Kafka_1883/Das_Urteil_.pdf"
}
]
},
metadata: {override_page_sequence_name: "Das Urteil", override_page_sequence_description: "Franz Kafka: Das Urteil"}
}
]
};
window.viewerApi.collectionApi.showCollection(collection);
This will enable the document selection sidebar: