Ng2-pdf-viewer: Blank page IOS #449

Created on 12 Nov 2020  路  7Comments  路  Source: VadimDez/ng2-pdf-viewer

IOS 14 is working fine but not in IOS 12.4.9.

Please help!

_Originally posted by @yeshchaubey in https://github.com/VadimDez/ng2-pdf-viewer/issues/449#issuecomment-725895322_

Most helpful comment

@VadimDez same for me, not rendering on iOS 12.4.9 on iphone 5s, any news about this? Thanks for help

All 7 comments

Any errors or warnings in the console?

Thanks for response. No Any errors or warnings in the console.

ng2-pdf-viewer.js
image

pdf.js
image

Error on this.loadingTask.promise, onError emit undefined object. Tested on iOS 14

@VadimDez same for me, not rendering on iOS 12.4.9 on iphone 5s, any news about this? Thanks for help

@VadimDez please help.

I am interested in a solution too! Thanks.

You need to add the Promise.all polyfill:

if (!Promise.allSettled) {
  Promise.allSettled = function (promises) {
    let mappedPromises = promises.filter(o => !!o).map(p => {
      return p.then(value => {
        return {
          status: 'fulfilled',
          value
        };
      }).catch(reason => {
        return {
          status: 'rejected',
          reason
        };
      });
    });
    return Promise.all(mappedPromises);
  };
}

Note you also need to add it to the pdf.worker.min.js file. That, in turn, means you must host it locally so you can modify it.

Plus, make sure you're using zone.js 0.10.3. Older versions don't implementPromise.all`, and 0.11.3 breaks it again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShayShaked picture ShayShaked  路  5Comments

kuba007 picture kuba007  路  3Comments

fncamm picture fncamm  路  4Comments

RahmatAliMalik5 picture RahmatAliMalik5  路  5Comments

VadimDez picture VadimDez  路  5Comments