PDF Reports
The SDK enables generation and optional sending of PDF reports, containing all the metrics and indices computed during the current measurement session.
Prerequisites
In order for the PDF to be generated, internet connection must be available and the video measurement must have finished successfully. The functionality is only available starting from the Professional plan.
Available generation modes
Four modes are available in the SDK’s API for PDF generation/sending:
- generating an URL pointing to the PDF, valid for 24 hours
- downloading the PDF locally
- sending the PDF to a specified email address
- opening the PDF directly in the end-user’s web browser via a ‘print’ dialog
Customizing the report
The generated report will contain all metrics (summaryMetrics
) and indices (healthIndices
) defined in the currently loaded measurement configuration. In case of the default preset, all available metrics and indices will be included.
The language of the report will mirror the local language set in the SDK at the time of report generation. In case of an emailed report, the title and contents of the email will also be localized to the chosen language.
API
Currently the PDF API is callback-based for the Web SDK and polling-based for native SDKs.
Send to email
To send the PDF to a given email address, use the sendMeasurementResultsPdfToEmail
method.
ShenaiSDK.sendMeasurementResultsPdfToEmail("someone@some.where")
Note that calling the method repeatedly with the same email address will not send more than one email.
Open in browser
To open the PDF in the on-device browser, use the openMeasurementResultsPdfInBrowser
method.
ShenaiSDK.openMeasurementResultsPdfInBrowser()
Generate URL
To generate a URL for the PDF, use the getMeasurementResultsPdfUrl
method.
First, call requestMeasurementResultsPdfUrl
to initiate the request, then periodically poll for the result using getMeasurementResultsPdfUrl
.
ShenaiSDK.requestMeasurementResultsPdfUrl();
...
var pdfUrl = await ShenaiSDK.getMeasurementResultsPdfUrl();
Get PDF as bytes
To obtain the PDF as bytes, use the getMeasurementResultsPdfBytes
method.
First, call requestMeasurementResultsPdfBytes
to initiate the request, then periodically poll for the result using getMeasurementResultsPdfBytes
.
ShenaiSDK.requestMeasurementResultsPdfBytes();
...
var pdfBytes = await ShenaiSDK.getMeasurementResultsPdfBytes();