When the user exports from the viewer, the export settings can be adjusted on the PHP server through the onBeginExportReport event.

Change file name and format settings.
$viewer->onBeginExportReport = function (StiExportEventArgs $args) {
    $args->fileName = "MyExportedFileName.$args->fileExtension";

    if ($args->format == StiExportFormat::Pdf) {
        /** @var StiPdfDashboardExportSettings $settings */
        $settings = $args->settings;
        $settings->orientation = StiPageOrientation::Landscape;
        $settings->paperSize = PaperKind::A4;
    }
};

How it works. The event runs on the server, so export options are applied centrally regardless of what the user clicks in the viewer.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.