PrizmDoc Viewer v13.24 Release - Updated
API Reference / PrizmDoc Server REST API / Pre-Conversion to PDF Support / "v3" Viewing Packages
In This Topic
    "v3" Viewing Packages
    In This Topic

    Introduction

    The "v3" viewing package REST APIs allow you to manage and use documents that have been pre-converted and cached for viewing.

    NOTE: These APIs are not for use with the PrizmDoc Viewer Client. If you need to pre-convert a document for the PrizmDoc Viewer client, use the PAS "v2" viewing package creators and viewing packages REST APIs instead (see Work with Viewing Packages in the PAS Developer Guide for more information).

    NOTE: The "v3" viewing packages and viewing package creators REST APIs are currently only available for on-premise deployments.

    NOTE: This feature is disabled by default. See Enable Pre-Conversion to PDF on how to enable and configure this feature.

    Available URLs

    The URLs described on this page allow you to get information about an already-created viewing package and download its associated PDF. If you need to create a new viewing package, see the viewing package creators REST API.

    URL Description
    GET /v3/viewingPackages/{packageId} Gets the state of an existing viewing package.
    GET /v3/viewingPackages/{packageId}/content/pdf Gets a PDF representation of a viewing package.

    GET /v3/viewingPackages/{packageId}

    Gets information about an already-created viewing package (to create a new viewing package, see viewing package creators).

    Request

    URL Parameters

    Parameter Description
    {packageId} Id of the viewing package (which you provided when creating the package with POST /v3/viewingPackageCreators).

    Response body

    JSON object with the following properties:

    • expirationDateTime (String) Only present when lifetimeAfterLastUse is not "forever". Specifies the date and time (in ISO 8601 Extended Format) when the viewing package is currently scheduled to be deleted. Each time the package is used, this value will be extended into the future so that it points to current time plus the amount specified by lifetimeAfterLastUse.
    • creationDateTime (String) Date and time (in ISO 8601 Extended Format) when the viewing package was created.
    • bytes (Integer) Size of the viewing package in bytes.
    • lifetimeAfterLastUse (String) Amount of time a viewing package will be kept after its most recent use, after which it will be automatically deleted. Value will be one of the following:
      • A string indicating a number of days, such as "30d" for 30 days
      • "forever" if the package is set to be kept indefinitely

    Error Responses and JSON Error Codes

    Status Code JSON errorCode Description
    404 "ResourceNotFound" No viewing package with the provided {packageId} could be found. This can happen if creation process for this {packageId} had never started, or started but has not completed yet.
    480 "LicenseCouldNotBeVerified" The server's license could not be verified. If you are evaluating the product without a license, the product is running in evaluation mode and this particular part of the product is unavailable without a license. To obtain a license, contact us at info@accusoft.com. If you have a license, make sure you configured your license correctly, that your license has not expired, and that you have not exceeded any license limits (such as, for a Cloud License, the total number of logical CPU cores in use).
    480 "FeatureDisabled" The "v3" viewing packages feature has not been enabled.
    580 "InternalError" The server encountered an internal error when handling the request.

    Example

    Request

    GET /v3/viewingPackages/U3BlY2lhbCBPcmRlciAjOTM3
    
    

    Response

    HTTP 200 OK
    Content-Type: application/json
    
    {
      "expirationDateTime": "2122-07-03T00:00:00.000Z",
      "creationDateTime": "2101-01-01T0:00:00.000Z",
      "bytes": 180924609,
      "lifetimeAfterLastUse": "30d"
    }
    
    

    GET /v3/viewingPackages/{packageId}/content/pdf

    Gets the PDF contained in the viewing package (a PDF representation of the original document used to create the viewing package).

    Issuing this request will count as a use of the viewing package. If lifetimeAfterLastUse is not "forever", the package's expirationDateTime will be increased to the current time plus lifetimeAfterLastUse.

    Request

    URL Parameters

    Parameter Description
    {packageId} Id of the viewing package (which you provided when creating the package with POST /v3/viewingPackageCreators).

    Response body

    PDF file bytes.

    Error Responses and JSON Error Codes

    Status Code JSON errorCode Description
    404 "ResourceNotFound" No viewing package with the provided {packageId} could be found. This can happen if creation process for this {packageId} had never started, or started but has not completed yet.
    480 "LicenseCouldNotBeVerified" The server's license could not be verified. If you are evaluating the product without a license, the product is running in evaluation mode and this particular part of the product is unavailable without a license. To obtain a license, contact us at info@accusoft.com. If you have a license, make sure you configured your license correctly, that your license has not expired, and that you have not exceeded any license limits (such as, for a Cloud License, the total number of logical CPU cores in use).
    480 "FeatureDisabled" The "v3" viewing packages feature has not been enabled.
    580 "InternalError" The server encountered an internal error when handling the request.

    Example

    Request

    GET /v3/viewingPackages/U3BlY2lhbCBPcmRlciAjOTM3/content/pdf
    
    

    Response

    HTTP 200 OK
    Content-Type: application/pdf
    
    <PDF file bytes>