Performance issue

Bug Report or Feature Request (mark with an x)
- [X ] bug report -> please search issues before submitting
- [ ] feature request

The viewer is very slow with not that large PDF file(around 10 pages, 600k size), especially when the source is Uint8Array. It took a couple of seconds for the scrollbar to respond to page up/downs each time.

3 thoughts on “Performance issue

  1. Guys root cause is [render-text]=”true”, set it to false, this has solved my problem.
    When it is set to true it is creating html elements which is I think creating memory problem.

  2. Bind the pdfsrc with ArrayBuffer instead of Uint8Array ..Then performance will improve a lot.
    See below for ur reference:
    html
    <pdf-viewer [src]=”pdfSrc” style=”display: block;”>

    .ts
    pdfSrc: ArrayBuffer;
    this._fileservice.downloadfilewithbytes(reportdata)
    .subscribe((filebytes: ArrayBuffer) => {
    this.pdfSrc = filebytes;
    });

    service.ts
    public downloadfilewithbytes(data: any): Observable {
    var apiUrl = this._config.ApiUrl + “api/Filedownload/”;
    var reportData = JSON.stringify(data);
    return this.http.post(apiUrl, reportData, { responseType: ‘arraybuffer’ });
    }

    Note : the Response from the Api is bytes array