Font issue exporting PDF (using viewer) in Angular

Stimulsoft Reports.JS discussion
Post Reply
adrianareigadas
Posts: 5
Joined: Thu Nov 12, 2020 5:06 pm

Font issue exporting PDF (using viewer) in Angular

Post by adrianareigadas »

Hi,

We defined a html component into mrt file with regular, bold and italic fonts (the server gets the mrt file and sends xml to the report viewer). The fonts are ok on the report viewer but it is just plain font when the viewer exports to pdf.

Code: Select all

        Stimulsoft.Base.StiFontCollection.addOpentypeFontFile('assets/reports/Arial.ttf', 'Arial');
        Stimulsoft.Base.StiFontCollection.addOpentypeFontFile('assets/reports/MicrosoftSansSerif.ttf', 'Microsoft Sans Serif');
        Stimulsoft.Base.StiFontCollection.addOpentypeFontFile('assets/reports/PTSansNarrow-Regular.ttf', 'PT Sans Narrow');

        const options = new Stimulsoft.Viewer.StiViewerOptions();
        options.appearance.showTooltips = false;
        options.toolbar.showDesignButton = false;
        options.toolbar.showAboutButton = false;
        options.toolbar.showOpenButton = false;
        options.toolbar.showSaveButton = false;
        options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Pdf;

        this.viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false);
        this.report = new Stimulsoft.Report.StiReport();
And the bold/italic format are not working when printing PDF. Is there anything missing?

Thank you.
Attachments
From Viewer.png
From Viewer.png (22.6 KiB) Viewed 852 times
print PDF.png
print PDF.png (18.76 KiB) Viewed 852 times
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Font issue exporting PDF (using viewer) in Angular

Post by Lech Kulikowski »

Hello,

In our web viewers, fonts are loaded, so everything should work when printing from the viewer.
If it is the export of an entire file, then yes, it has not been implemented yet. There is the task in our todo-list.

Thank you.
Post Reply