Download Annotated PDF
- Initiate Merging
- Check if Download is Ready
- Download the Annotation PDF
- Notify that Merge is Finished
Intro
DocViewer contains a merger service used for downloading PDFs with annotations. When a user wants to download their PDF with annotation data included, the annotations and PDF are merged together.
Initiate Merging
POST /1/sessions/{session_id}/annotated.pdf
Starts the annotation merging process. The session_id specifies for which document to merge annotations.
Parameters
Query:
session_id: string
Responses
202 Accepted
Example Call
POST canvadocs.docker/1/sessions/eyJhb.../annotated.pdf
202 Accepted
Check if Download is Ready
GET /1/sessions/{session_id}/annotated.pdf/is_ready
The provides a way for the client to poll the server to see when the merging process is complete and the download is ready.
Parameters
Query:
session_id: string
Responses
200
{
"ready": true
}
404
{
"ready": false
}
Example Call
GET canvadocs.docker/1/sessions/eyJhb.../annotated.pdf/is_ready
200 OK
{
"ready": true
}
Download the Annotated PDF
GET /1/sessions/{session_id}/annotated.pdf
Downloads the annotated PDF. In order to download the PDF, it must first be merged.
Parameters
Query:
session_id: string
Responses
Returns the annotated .pdf file
Example Call
GET canvadocs.docker/1/sessions/eyJhb/annotated.pdf
200 OK
// The .pdf file was then downloaded
Notify that Merge is Finished
POST /1/sessions/{session_id}/merge_finished
This endpoint is used by the merge to inform the clients that the merging process is complete. It should not be called by clients.