andyhill Posted January 9, 2018 Share Posted January 9, 2018 I am using the Mobile PdfFrame and when displaying a PDF file containing an image of approx 800 x 800..1600 I get random errors during panning and zooming:- "webkit error" "a problem repeatedly occurred" "error encountered" etc. In all occasions it takes out the current session. Sometimes it shows in safari as a warning that the site is faulty. Please advise how to resolve. To test simply build a similar PDF and pan and zoom on iPhone. Link to comment Share on other sites More sharing options...
andyhill Posted January 9, 2018 Author Share Posted January 9, 2018 It makes no difference whether it is one page of text, one page of image, many pages of text or many pages of images. Platform: iPhoneX, iOS 11.2.1, Safari I have seen the same problem on Android (I will endeavor to get version). Link to comment Share on other sites More sharing options...
Sherzod Posted January 10, 2018 Share Posted January 10, 2018 Hi, Please, can you make a simple testcase for this?! Best regards, Link to comment Share on other sites More sharing options...
andyhill Posted January 10, 2018 Author Share Posted January 10, 2018 As mentioned, it is not code specific nor pdf specific, knock up any mobile PdfFrame and load any PDF file and zoom / pan all over the place and it will crash. Link to comment Share on other sites More sharing options...
Sherzod Posted January 10, 2018 Share Posted January 10, 2018 Hi, I have seen the same problem on Android (I will endeavor to get version). I couldn't reproduce this issue Link to comment Share on other sites More sharing options...
Wicket Posted January 14, 2018 Share Posted January 14, 2018 I don't know if this helps, but I get the same error when i rotate the device whilst viewing a pdf. I am currently using an iPad. It seems it's only reproducible if you rotate while the pdf is loading from a previous rotate. This is using the demo code, so i guess is it's something to do with the onshow event, as this is when the pdf is loaded for some reason. I'm going to swap this out to load the pdf on form create to see if it helps. Sent from my Pixel using Tapatalk Link to comment Share on other sites More sharing options...
andyhill Posted January 14, 2018 Author Share Posted January 14, 2018 On iPhone it happens without rotating but is related to zooming and panning. Link to comment Share on other sites More sharing options...
Wicket Posted January 16, 2018 Share Posted January 16, 2018 I have tried but I can't pin point the issue. It happens often enough that it will cause a real issue for my customers. Any ideas? Sent from my Pixel using Tapatalk Link to comment Share on other sites More sharing options...
andyhill Posted January 16, 2018 Author Share Posted January 16, 2018 Is it possible that a Zoom event is interrupted by a Pan event (or visa versa), in other words there is no logic to prevent re-entry while executing ? Link to comment Share on other sites More sharing options...
andyhill Posted January 23, 2018 Author Share Posted January 23, 2018 Further testing on iPhone appears to show that the PDFFrame object has trouble staying within (linked to) the ParentForm or optionally the ParentContainer of the ParentForm ? Is there some sort of java script required to tell the frame who the parent form is ? There is no apparent issue on Desktop. Link to comment Share on other sites More sharing options...
andyhill Posted January 24, 2018 Author Share Posted January 24, 2018 Farshad, I really need a fix for this ASAP. Please test mPDFFrame component on iPhone (it intermittently crashes on iPhoneX, iPhone7 etc. irrespective of PDF image) when one zooms in/out and pans around. Link to comment Share on other sites More sharing options...
Wicket Posted January 28, 2018 Share Posted January 28, 2018 Any news on this? I am having very similar issues using the iPad air. Sent from my Pixel using Tapatalk Link to comment Share on other sites More sharing options...
andyhill Posted January 29, 2018 Author Share Posted January 29, 2018 Farshad, As you can see it is not an isolated issue with my project. It is a problem with both iOS and Android. Can you please provide a work around ASAP - thanks. Link to comment Share on other sites More sharing options...
andyhill Posted February 6, 2018 Author Share Posted February 6, 2018 Farshad, please comment. Link to comment Share on other sites More sharing options...
andyhill Posted February 8, 2018 Author Share Posted February 8, 2018 Farshad, I can only assume you have no idea how to fix at present by your lack of response ? Please advise that you are looking into it as it is a real problem (test it yourself on an updated iPhone). Link to comment Share on other sites More sharing options...
andyhill Posted February 14, 2018 Author Share Posted February 14, 2018 Farshad, please respond ? Link to comment Share on other sites More sharing options...
andyhill Posted February 27, 2018 Author Share Posted February 27, 2018 Farshad, With lots of testing on an iPhoneX with the TUnimPDFFrame component I can report the following (I have no problems with Desktop emulation):- 1) It appears the errors occur after a certain zoom event value is exceeded (not sure at what zoom level this is [no feed back]) other than larger than would normally be required 2) The over-zoomming also effects the Form sizing as well ??? (see images below [non-zoomed and over-zoomed but not reached crash threshold at this level]) So, for the further purposes of testing I need to catch the zoom event and put limits on how far one can zoom - say cannot zoom past 200% for starters Also, how can we stop the Form and it's Title from being effected by the over zooming ? Please provide the necessary code to implement the Zoom Event with Zoom Limit - thanks. Link to comment Share on other sites More sharing options...
andyhill Posted February 28, 2018 Author Share Posted February 28, 2018 Looking through the viewer.js code I see:- ... if (pdfjsLib.PDFJS.useOnlyCssZoom) { var actualSizeViewport = viewport.clone({scale: CSS_UNITS}); // Use a scale that will make the canvas be the original intended size // of the page. outputScale.sx *= actualSizeViewport.width / viewport.width; outputScale.sy *= actualSizeViewport.height / viewport.height; outputScale.scaled = true; } ... if (pdfjsLib.PDFJS.maxCanvasPixels > 0) { var pixelsInViewport = viewport.width * viewport.height; var maxScale = Math.sqrt(pdfjsLib.PDFJS.maxCanvasPixels / pixelsInViewport); if (outputScale.sx > maxScale || outputScale.sy > maxScale) { outputScale.sx = maxScale; outputScale.sy = maxScale; outputScale.scaled = true; this.hasRestrictedScaling = true; } else { this.hasRestrictedScaling = false; } } For testing purposes how do I set:- 1) useOnlyCssZoom 2) maxCanvasPixels 3) maxScale I need to resolve this issue urgently - please advise. Link to comment Share on other sites More sharing options...
Recommended Posts