Jump to content


Photo

Mobile PdfFrame Pan / Zoom random errors ?

PDF

  • Please log in to reply
17 replies to this topic

#1 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 09 January 2018 - 09:10 AM

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.

Attached Files


  • 0

Andy


#2 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 09 January 2018 - 07:58 PM

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).


  • 0

Andy


#3 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5152 posts

Posted 10 January 2018 - 06:28 AM

Hi,

Please, can you make a simple testcase for this?!

Best regards,
  • 0

#4 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 10 January 2018 - 10:49 AM

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.


  • 0

Andy


#5 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5152 posts

Posted 10 January 2018 - 11:02 AM

Hi,

 

I have seen the same problem on Android (I will endeavor to get version).

 

I couldn't reproduce this issue


  • 0

#6 dan602

dan602

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 98 posts

Posted 14 January 2018 - 09:56 AM

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
  • 0

#7 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 14 January 2018 - 07:08 PM

On iPhone it happens without rotating but is related to zooming and panning.

 

 

Attached Files


  • 0

Andy


#8 dan602

dan602

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 98 posts

Posted 16 January 2018 - 08:32 PM

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
  • 0

#9 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 16 January 2018 - 10:05 PM

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 ?


  • 0

Andy


#10 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 23 January 2018 - 01:25 AM

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.


  • 0

Andy


#11 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 24 January 2018 - 02:35 AM

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.


  • 0

Andy


#12 dan602

dan602

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 98 posts

Posted 28 January 2018 - 10:57 PM

Any news on this? I am having very similar issues using the iPad air.

Sent from my Pixel using Tapatalk
  • 0

#13 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 29 January 2018 - 11:37 PM

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.


  • 0

Andy


#14 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 06 February 2018 - 08:28 AM

Farshad, please comment.


  • 0

Andy


#15 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 08 February 2018 - 05:37 AM

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).


  • 0

Andy


#16 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 14 February 2018 - 06:44 AM

Farshad, please respond ?


  • 0

Andy


#17 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 27 February 2018 - 07:35 PM

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.

 

 

Attached Files


  • 0

Andy


#18 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts
  • LocationMelbourne Australia

Posted 28 February 2018 - 07:26 AM

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.

  • 0

Andy






Also tagged with one or more of these keywords: PDF

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users