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.
this is quite a problem for me 🙁
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.
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