Overview
The Hybrid Viewing and PDF Viewing Package creation features reduce the overall server usage by enabling document rendering in the Viewer and the creation of much smaller viewing packages.
Hybrid Viewing and PDF Viewing Package creation are licensed features which have been added to PrizmDoc Server and Prizm Application Services (PAS).
PAS must be configured with a license key to take advantage of these features. All previously existing PAS functionality may continue to be used without providing a license key. If you are using a metered license, you can simply provide the same license to both PrizmDoc Server and PAS.
Requirements & Considerations
-
You are required to use metered licensing with PAS to enable the creation of PDF-only viewing packages and view them client-side using the Hybrid Viewing feature. You will need a database for both creating and viewing the Viewing Package and tracking your metered license usage.
-
If you want to create the original, full Viewing Packages and view them with SVG viewing, then you do not need a metered license for PAS. However, a database is still required.
-
If you want to only view a document with the Hybrid Viewing feature (not using Viewing Packages), then the metered license on PrizmDoc server will enable that and again, no additional PAS licensing is required.
Get Started with PAS Licensing & PDF Viewing Package Creation
Step 1: Set the License Key in the Config File
NOTE: A metered license is required for this feature.
Edit your pas.win.yml
/ pas.nix.yml
-
Set the License Key:
license.key: eyJrZXkiOiJNTnFraUtoM...
Step 2: Set up a Database
- Use the PAS Configuring a Database page to configure a connection to your database, which is required for the Viewing Package feature.
-
Once you have set up the database, you should have something similar in your PAS config file as shown below:
NOTE: The example below is for a mysql database. It's okay if yours looks slightly different if you are using an SQL Server instead.
database.adapter: mysql database.connectionString: "mysql://dbUser:dbPassword@host.docker.internal:3306/dbName"
Edit your pas.win.yml
/ pas.nix.yml
-
Now enable the Viewing Package feature by adding a line in the config:
feature.viewingPackages: "enabled"
-
Now use the Run Database Scripts topic to create the necessary tables in the database for the Viewing Package feature.
- Your PAS is now ready to create Viewing Packages. The following steps will help you verify that everything is functioning properly.
Step 3: Verify that everything works by creating a Viewing Session from a Viewing Package
Create a Viewing Package
- Create a PDF Viewing Package from the
viewingPackageCreators
endpoint in PAS. Note thepackageType
ofpdf
is how you indicate to PAS that you want a PDF Viewing Package.
Example Request
POST http://localhost:3000/v2/viewingPackageCreators
Content-Type: application/json
{
"input": {
"source": {
"type": "document",
"fileName": "PdfDemoSample.pdf",
"documentId": "test-id-1",
"packageType": "pdf"
},
"viewingPackageLifetime": 2592000
}
}
Example Response
200 OK
Content-Type: application/json
{
"input": {
"source": {
"documentId": "test-id-1",
"type": "document",
"packageType": "pdf",
"fileName": "PdfDemoSample.pdf"
},
"viewingPackageLifetime": 2592000
},
"expirationDateTime": "2022-11-14T20:39:31.000Z",
"processId": "YOxF4JFiuaXjfsfNKga1iw",
"state": "queued",
"percentComplete": 0
}
- Wait for the viewing package creation to be complete by checking the
percentComplete
in the response toGET /v2/viewingPackageCreators
.
Example Request
GET http://localhost:3000/v2/viewingPackageCreators/<your-process-id>
Example Response
200 OK
Content-Type: application/json
{
"input": {
"source": {
"documentId": "test-id-1",
"type": "document",
"packageType": "pdf",
"fileName": "PdfDemoSample.pdf"
},
"viewingPackageLifetime": 2592000
},
"expirationDateTime": "2022-11-14T20:40:28.000Z",
"processId": "YOxF4JFiuaXjfsfNKga1iw",
"state": "processing",
"percentComplete": 100
}
- Now create a viewing session using the
documentId
from the previous step, again setting theallowedClientFileFormats
to['pdf']
andpackageType
topdf
.
Example Request
POST http://localhost:3000/ViewingSession
Content-Type: application/json
{
"source": {
"type": "upload",
"displayName": "PdfDemoSample.pdf",
"documentId": "test-id-1",
"packageType": "pdf"
},
"allowedClientFileFormats": ["pdf"]
}
Example Response
200 OK
Content-Type: application/json
{
"viewingSessionId": "ceDKddC6Lx6vYMyzmRhVl0xoDsxHlPHHQQUMsNqs1YeXLiwX-5NNBjmHy0SITQdTbliB8J_y5Inn5BvBG460Sg"
}
Step 4: View the Document
- You can now follow the instructions in the Use Hybrid Viewing topic to set up a viewer for your viewing session.