Closed Bug 1028736 Opened 10 years ago Closed 6 years ago

PDF Viewer App (by FoxXapp) does not render big PDFs properly

Categories

(Firefox OS Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: nilaybinjola, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140608211622

Steps to reproduce:

Download a Big PDF (I used a 9.5 MB PDF) and try to view it in the app.


Actual results:

The text was garbled. Navigation was bad. Images were not rendered properly. The PDF could not be rendered. However, small PDFs are rendered properly.


Expected results:

The PDF should have rendered properly with proper text and images.
Confirmed on Flatfish build 20141026. Sorry but I can't post commit or other build details due to bug 1087813.

I don't know if very small PDFs are readable, but all the ones I have tested are afflicted by the bug (max size 45 Mb, minimim size 1.2Mb). 
It seem to happen expecially when a resize is required. So, when in portrait mode "automatic zoom" is set, while some file seems readable at first, after scrolling a few pages all the text becomes unreadable. That happens in all the files I have tested. It happens with some files also when "Actual size" is selected.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Confirmed with respect to Comment 1.
I can still reproduce on current Flatfish build. Could someone please add [Flatfish] to whiteboard?

Firmware revision: flatfish_20141113-0106
OS Version: 2.2.0.0-prerelease
Build Identifier: 20141113011509
Platform version: 36.0a1
Git commit info: 2014-11-12 16:29:28 d13f29ef
Just curious why component set to "Gaia::PDF Viewer"? The screenshot demonstrates that it is not a standard B2G viewer, but custom app.
(In reply to Yury Delendik (:yury) from comment #4)
> Just curious why component set to "Gaia::PDF Viewer"? The screenshot
> demonstrates that it is not a standard B2G viewer, but custom app.

Maybe he did that because a very similar behaviour happens also with the default viewer. I cannot say it's totally the same as the default PDF JS viewer could not successfully open any of the files I have tested. At least PDF Viewer was able to show one or two if Actual Size is chosen.
The behaviors of the generic/desktop pdf.js viewer and B2G PDF Viewer are different. First one is repainting a page on a canvas every time scale changes. The latter draws a page once in the "actual size" and using CSS scale. BTW, B2G PDF Viewer has no "Actual Size".

P.S. Generic/desktop viewer sometimes gives too big canvas for mobile devices; so some crash, some start displaying artifacts due to (video?) memory corruption.
https://marketplace.firefox.com/app/pdf-viewer?src=search has nothing to do with "Gaia::PDF Viewer" -- resetting the component. The garbled text can be overuse/corruption of the memory on the actual device, which can be done by any app.
Component: Gaia::PDF Viewer → General
The title of the bug says "PDF Viewer App (by FoxXapp) does not render big PDFs properly". We can consider it a bug specific to that application by FoxXapp.
@ :yuri I agree that this might have nothing to do with "Gaia::PDF Viewer". At the time of filing this bug, I couldn't make sure of that. Better safe than sorry, I say. I assumed it was worth making the PDF Viewer developers take note of it.
Also, I don't think there was an overuse of memmory since I had newly flashed my FLATFISH (so it had no other apps installed) and the problem still existed.
If someone can stress test the Default PDF Viewer for B2G/FLATFISH and announce that no such rendering problems exist, then we can close this bug.
(In reply to Nilay Binjola from comment #9)
> @ :yuri I agree that this might have nothing to do with "Gaia::PDF Viewer".
> At the time of filing this bug, I couldn't make sure of that. Better safe
> than sorry, I say. I assumed it was worth making the PDF Viewer developers
> take note of it.
> Also, I don't think there was an overuse of memmory since I had newly
> flashed my FLATFISH (so it had no other apps installed) and the problem
> still existed.

Looks like the app by FoxXapp using the same code for viewer as the desktop browser webapp hosted at http://mzl.la/pdf-js -- can you check this page on FLATFISH? (See also https://github.com/mozilla/pdf.js/releases for offline use or to change PDF)

There is no reason this app shall behave this way: the rendering is done on the regular HTML5 canvas. I bet the issue is with B2G (during composition?), and I'm sure this app works fine on the Firefox OS emulator. I saw the similar problem early versions of B2G devices (even without running PDF Viewer).
In response to Comment 10. I have opened the file you linked, using the browser. If I choose Automatic zoom in landscape mode, the file is reproduced correctly. While it's not if in portrait mode. If I choose "Page fit", the bug shows on both landscape (see attachment) and portrait mode.
So we could assume the problem regards resizing, as I previously wrote. The same fault happens with resized images in browser or other applications, so I *suppose* it's a common FX OS (or Flatfish) problem concerning the resizing of objects, not just confined to PDF Viewers. For as long as I have been using Flatfish, I have always seen this behaviour on a scaled image, they are always garbled, with those oblique stripes that you can see in these attachments.
Update. With the latest Flatfish build, the default Gaia's PDF viewer is not able to reproduce any of the PDF files I have tested (all above 1.2 MB), the window opens but remains empty even after some minutes. While the Viewer app by FoxXapp (uninstalled and reinstalled) is no more able to access the SD card. I was able to test only PDFs in the local HD and it continue to show the same problems already reported.

OS version: 2.2.0.0-prerelease
Platform version: 37.0a1
Build identifier: 20141217021324 
Git commit info: 2014-12-16 16:17:31 939cf033
Firmware revision: flatfish_20141217-0144
(In reply to Carlo 'Carcarlo' Carmagnini from comment #12)
> Update. With the latest Flatfish build, the default Gaia's PDF viewer is not
> able to reproduce any of the PDF files I have tested (all above 1.2 MB), the
> window opens but remains empty even after some minutes. 

Could you open a separate bug for Gaia's PDF Viewer?
(In reply to Yury Delendik (:yury) from comment #13)
> Could you open a separate bug for Gaia's PDF Viewer?

I had already reported this problem on bug 1094032. Is it enough or should I open a new one?
(In reply to Carlo 'Carcarlo' Carmagnini from comment #14)
> (In reply to Yury Delendik (:yury) from comment #13)
> > Could you open a separate bug for Gaia's PDF Viewer?
> 
> I had already reported this problem on bug 1094032. Is it enough or should I
> open a new one?

As I understand it, https://bugzilla.mozilla.org/show_bug.cgi?id=1094032 only sees performance problem in terms of rendering time. Not whether the redering itself is done properly or not. Am I right?
Flags: needinfo?(carlo)
(In reply to Nilay Binjola from comment #15)
> As I understand it, https://bugzilla.mozilla.org/show_bug.cgi?id=1094032
> only sees performance problem in terms of rendering time. Not whether the
> redering itself is done properly or not. Am I right?

I suppose it's caused by the same problem, I really don't know what's the best practice in this circumstance. If it has to be filed as a new bug, I'll do it.
Flags: needinfo?(carlo)
(In reply to Yury Delendik (:yury) from comment #13)
> Could you open a separate bug for Gaia's PDF Viewer?

I have opened a new bug 1114601.

Using FoxXapp's PDFViewer, I still can reproduce the problems reported in the previous comment 1 and comment 11.

OS version: 2.2.0.0-prerelease
Firmware revision: flatfish_20141222-0147
Build number: 20141222
Platform version: 37.0a1
Build ID: 20141222021922
Git commit: 2014-12-21 06:28:07 155f9c1b
(In reply to Carlo 'Carcarlo' Carmagnini from comment #17)
> (In reply to Yury Delendik (:yury) from comment #13)
> > Could you open a separate bug for Gaia's PDF Viewer?
> 
> I have opened a new bug 1114601.

Thank you.
 
> Using FoxXapp's PDFViewer, I still can reproduce the problems reported in
> the previous comment 1 and comment 11.

Can you reproduce the same exact issue as in the comment 0 with http://mozilla.github.io/pdf.js/web/viewer.html with device's web browser? (I'm not sure in "Open File" button works on the FxOS -- no device) It's not clear from the comment 11, there is a garbled text. If there is the same issue as in comment 0, then it's possible to create a smaller test that does not involve PDF or PDF.js.

Can you reproduce the issue the Firefox OS emulator?
(In reply to Yury Delendik (:yury) from comment #18)
> Can you reproduce the same exact issue as in the comment 0 with
> http://mozilla.github.io/pdf.js/web/viewer.html with device's web browser?

I have opened the URL using the latest build's browser (Flatfish build 20150103). "Automatic zoom" works fine in landscape mode, I was able to scroll and read all the document (the scrolling movement is far from perfect, as it shows the bottom of a page before the top, but it's a minor problem at the moment). On the contary, it's garbled in portrait mode. "Actual size" does never reproduce the content, but shows the usual garbled text both in panorama and portrait mode.

If I download the file, open SD Explorer, open the PDF file, it behaves as any other PDF file I have tested using the build 20150103: it does not show the content (as shown in attachment 8540161 [details] for bug 1114601). Furthermore, it's impossible to close that almost empty screen.

Steps:
1) Try to close using the "application carousel" (I don't know how it's called the app horizontal list)
2) The empty pdf viewer screen it's still there.
3) reopen the app carousel, no app is shown (Your recent app windows show up here")
4) sweep the finger from bottom to show the home screen, the empty pdf viewer is shown instead (as the attachment 8540161 [details] mentioned above).
5) There is no way to have the home screen back again, the only option is to Restart the device.

I have not tested using the Firefox OS emulator (I haven't installed it).

OS Version: 2.2.0.0-prerelease
Firmware: flatfish_20150103-0139
Build ID: 20150103020233
Platform version: 37.0a1
Git commit: 2015-01-02 09:18:59 a14de2c4
Okay, there are several threads in this bug report:

1) FoxXapp app shows corrupted PDF content. This app packages standard PDF.js code for desktop viewer.
2) Standard Gaia PDF Viewer does not works. This uses viewer is PDF.js code that is optimized for mobile experience and a little bit different from desktop version.

We are interested it thread #1 here and particularly in execution of PDF.js code for desktop viewer. Personally I want create a minimal test cases to demonstrate that it *isn't* a PDF.js code problem but an issue with CANVAS in Flatfish build -- the PDF.js code just a *regular* web page that is executed just fine on desktop systems and has issues only on Flatfish. My recommendation is to keep this bug about how to reproduce this CANVAS bug.
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: