Export settings can be adjusted on the server when the user exports from the viewer, through the onBeginExportReport event.

Exporting the document. Load and render the report, configure the requested export format, and deliver the generated bytes as a file, stream, or web response.
$viewer->onBeginExportReport = function (StiExportEventArgs $args) {
    $args->fileName = "MyExportedFileName.$args->fileExtension";
    if ($args->format == StiExportFormat::Pdf) {
        /** @var StiPdfExportSettings $settings */
        $settings = $args->settings;
        $settings->creatorString = 'My Company Name';
        $settings->embeddedFonts = false;
    }
};
$viewer->process();


The event exposes the target format, file name and the format-specific settings object, so you can enforce naming, metadata or security on every export from the server side.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.