Export output can be tuned through a settings object. This example exports to PDF while adjusting metadata, font embedding and a user password.

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.
@Component({
    selector: "exporting-report-from-code-with-changing-export-settings",
    template: `
        <div class="container">
            <h4>This example shows how to export a report to a PDF file and adjust the export settings via code. Please, enter the password <b>123</b> to show report</h4>
            <div class="container-button">
                <button (click)="saveReportPdf()" class="button" title="Export Report to PDF File">Export to PDF</button>
            </div>
        </div>
        `,
    styleUrls: ['../styles.css']
})

export class ExportingReportFromCodeWithChangingExportSettings {
    async saveReportPdf() {
        var report = new Stimulsoft.Report.StiReport();
        report.loadFile("Reports/SimpleList.mrt");

        await report.renderAsync2();

        var settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
        settings.creatorString = 'My Company Name';
        settings.keywordsString = 'SimpleList Report Export';
        settings.embeddedFonts = false;
        settings.passwordInputUser = "123";

        var pdfData = await report.exportDocumentAsync2(Stimulsoft.Report.StiExportFormat.Pdf, undefined, settings);
        Stimulsoft.System.StiObject.saveAs(pdfData, report.reportAlias + ".pdf", "application/pdf");
    }
}

StiPdfExportSettings carries options such as creatorString, embeddedFonts and passwordInputUser; passing it to exportDocumentAsync2 applies them to the generated PDF.

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