My backend creates a PDF based on a formular I submitted. The next page should show the Pdf Documents. I use ng2-pdf-viewer for that purpose. My problem is, that every time I run it the very first time I start my browser I always get the "pdf.worker.min.js:22 Warning: Indexing all PDF objects" warning. When I submit my next formular I dont get the error again and instead it shows the pdf documents.
My GET Request looks as follow:
this.pdfService.getMaterialPdf().subscribe((file: ArrayBuffer) => {this.pdfMaterial = file});
in the pdfService:
getMaterialPdf() : Observable<any>
{
return this.http.get(this.url+'Material', {responseType:"arraybuffer"});
}
and the response from the server:
app.get("/pdf/Material", (req, res) => {
fs.readFile(materialPath,(err, data) => {
if (err) {
throw err;
}
res.send((data));
});
});