Page 1 of 9 123456 ... LastLast
Results 1 to 20 of 168
Like Tree40Likes
  1. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #1  
    Multiple users have complained about the poor PDF rendering quality on the touchpad. I have seen that myself, and decided to investigate this issue.

    I dug into the source code a and here are some findings:
    The Adobe reader app is part of the quickoffice app at:
    /media/cryptofs/apps/usr/palm/applications/com.quickoffice.ar

    It is a hybrid app, which uses a service (/media/cryptofs/apps/usr/palm/applications/com.quickoffice.ar/import/arx/arxservice) to render the PDFs. Every time a PDF file is opened, PNG image files are created (one per page) under:
    /media/internal/appdata/com.quickoffice.ar/.cache/<SOME RANDOM NAME>
    (maybe it only creates cache for a number of pages around the current page, didn't check that). I guess it makes sense, because Enyo is web based after all, so its job would be to display images.

    These PNG image files are not of great quality, hence the problem with zooming in.
    When you zoom in, you actually do that on a pre-rendered image, therefore the blurred result. Possible ways to make PDF viewing better would be to re-render the image in higher quality when zooming in; or pre-render it in high quality when the file is first opened (which might make loading time slower).
    Further investigation is required to determine if that is possible.

    Two clues I found in the log files are:
    When a file is opened, only a path is specified for the arxservice:
    [20110908-15:10:02.301073] info: Open: Published(/media/internal/downloads/Published.pdf), source/PdfArea.jsjsjs:$28$

    You also see:
    [20110908-15:10:02.976738] info: OPEN:{"pages":4,"width":612,"height":792,"units":"pt","dst":"/media/internal/appdata/com.quickoffice.ar/.cache/fa49d9ef603936522c91d455f1b55425"}, source/PxxArea.jsjsjs:$133$

    Which is the response from the arxservice after opening the PDF file. The width and height are specified in the response, so this might indicate that the Enyo code does not provide any parameters to the arxservice about resolution etc.
    It seems like the arxservice has preset configuration values concerning resolution etc.
    In that case, there is not much hope for an improved PDF experience, unless Quickoffice provide more details.

    If I have time, I might try to look more into the arxservice itself.
  2. #2  
    Thanks for the work. Is there any way to put a different version of Adobe on here?
  3. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #3  
    Quote Originally Posted by m1dwestrep View Post
    Thanks for the work. Is there any way to put a different version of Adobe on here?
    The fastest option is to figure out if the arxservice can be configured to export PNG images at a higher resolution. If that's possible, the PDFs will display better (though possibly slower).
    Sniffing the dbus for any configuration messages (none show in the log files) might reveal something.
    I don't know why the default resolution is so low.
    Perhaps Quickoffice would be willing to release an updated version with higher res image files?
    My guess is that arxservice came from Adobe, and Quickoffice wrote the UI for it, but I could be wrong.

    Another option would be to port an existing Linux command line app which export PDF pages to image files, replacing the arxservice.
  4. #4  
    It seems that it is possible to change the quality of the rendered image.
    I have found that if you change the number in the following line
    this.pageZoom = this.calculateZoom(this.pageWidth, this.pageHeight, 1200, 1200);
    to for example 1800,1800
    in PxxArea.jsjsjs $located$ $in$:
    /var/palm/jail/com.quickoffice.ar/media/cryptofs/apps/usr/palm/applications/com.quickoffice.ar/source/
    the quality increases. But as the comment from the developers in one of the file says it slows the rendering a bit and indeed it does. But at least now I can read some of the pdfs that were barely readable before.

    Luna restart is required.
    zane9000, razzbaronz and effjot like this.
  5. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #5  
    Thanks!
    Turns out this actually makes the arxservice export a different PNG file with a different resolution.

    The function generateImagePath in the same file has the following comment:
    Pages are rendered in:
    /media/internal/appdata/<appid>/.cache/<unique-id>/<prefix>XXXX-YYY<suffix>
    Where XXXX is the page number and YYY is the zoom value

    The function requestPage in the same file makes the call to the service:
    this.service.handleQueue({ cmd: 'render', from: index, count: 1, zoom: zoom, dir: this.dst, prefix: 'page-', response: this.requestPageCallback.bind(this, zoom) }
    And it actually includes the zoom level.
    (This does not show in the log files unless you uncomment the log callback at requestPageCallback() ).

    So I guess what remains is to either figure out what is the optimal resolution which does not slow it too much. Maybe an experienced Enyo developer could even add a menu entry to specify that resolution, so you could change it for different files.
    Worst case, we could hard code it to a better value.
    This should probably be packaged as a patch in Preware too.

    Some more details:
    The file PdfArea.jsjsjs $has$ $the$ $definition$ :
    function calculateZoom(image_w, image_h, screen_w, screen_h)

    The function call @bartekluk changed uses:
    calculateZoom(this.pageWidth, this.pageHeight, 1800, 1800)
    where:
    this.pageWidth = Number(r.width || r.slide_dom_width);
    this.pageHeight= Number(r.height || r.slide_dom_height);

    r.width, r.height are values returned from the arxservice callback, such as:
    [20110909-15:08:33.127905] info: OPEN:{"pages":4,"width":612,"height":792,"units":"pt","dst":"/media/internal/appdata/com.quickoffice.ar/.cache/fa49d9ef603936522c91d455f1b55425"}, source/PxxArea.jsjsjs:$133$
  6. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #6  
    Changing the screen width/height from 1200x1200 to 1800x1800 increases the file size x2: from about 300K to 600K per page. For scientific journals, this seems to be good enough (2 columns, font 8pt).
  7. #7  
    Subscribed. I'm really interested in getting this fixed, sure hope someone can write a patch for preware that'll clear all of this up (pun not intended lol)
  8. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #8  
    I submitted this as a patch to Preware. Will notify in this thread when the patch is approved.
    KCTraveler and cgk like this.
  9. #9  
    Quote Originally Posted by sagipe View Post
    I submitted this as a patch to Preware. Will notify in this thread when the patch is approved.
    Any chance of having this user set-able? From a menu item in adobe reader or whatever?then have a few different sizes to select from so each person can find their own best?
  10. #10  
    Or could you guys write a noobs user guide on how to change this resolution without any patch? I'd love to read my magazines on this tablet soon
  11. #11  
    why would Adobe not fix this?
  12. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #12  
    Quote Originally Posted by MegaMatze View Post
    Or could you guys write a noobs user guide on how to change this resolution without any patch? I'd love to read my magazines on this tablet soon
    Sure. I resubmitted the patch- otherwise it would probably be in Preware by now (forgot something in the .patch file, so it got rejected).
    If you have Internalz installed, browse to:
    /media/cryptofs/apps/usr/palm/applications/com.quickoffice.ar/source/PxxArea.jsjsjs

    and open the file in the editor.
    Goto line 156 where it says:
    this.pageZoom = this.calculateZoom(this.pageWidth, this.pageHeight, 1200, 1200);

    and change it to:
    this.pageZoom = this.calculateZoom(this.pageWidth, this.pageHeight, 1800, 1800);

    Save the file, and restart Luna (you can do that from the Preware menu), or restart your Touchpad if you don't have Preware installed.
    If you don't like the result- try increasing the resolution a bit: keep in mind that changing from 1200 to 1800, resulted in x2 PNG file size (from 300KB to 600KB per page). That's because the numbers in that line go to a function which calculates a zoom level between 5 and 500. This number depends on your specific PDF height and width. You could potentially change the line to:
    this.pageZoom = 250;
    to enforce a resolution not dependent on your PDFs. Haven't tested it, but it should work fine.
    razzbaronz, Sandiego and ztas like this.
  13. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #13  
    Quote Originally Posted by Warpedflash View Post
    Any chance of having this user set-able? From a menu item in adobe reader or whatever?then have a few different sizes to select from so each person can find their own best?
    Thought about that- but I don't have the time to work on that now.
    A better patch would provide an option to select a resolution level (regardless of the PDF actual height and width) from a few presets; and would also keep the screen on like the Kindle app!
    This is on my todo list- but don't expect anything in the coming month- I have too many things on my plate. If someone else has the time to do that in the meanwhile - great. Otherwise, I will as soon as I can.
  14. #14  
    This is pretty unbelievable! Thanks so much, it's 100 times better!
  15. #15  
    thanks for making this experience better
    If this helped you hit thanks.
  16. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #16  
    Quote Originally Posted by allowingtoo View Post
    why would Adobe not fix this?
    It's actually Quickoffice which wrote the UI. Adobe supplies the binary which converts the PDF pages to images.
    From looking at the code I can tell that they had some future capabilities planned which were never fully tested/finished. We could make some SuperPDF-patch to make the application even better if they don't.
  17. sagipe's Avatar
    Posts
    84 Posts
    Global Posts
    87 Global Posts
       #17  
    Quote Originally Posted by razzbaronz View Post
    This is pretty unbelievable! Thanks so much, it's 100 times better!
    Glad it helped!
  18. #18  
    awesome! This fix really works. Thanks a lot.
    but now i am wondering if it is possible to also increase the level of zoom that way. Maybe there is another line somewhere that allows this?
    lucky in red likes this.
  19. #19  
    I'm travelling at the moment away from my Touchpad, but really looking forward to trying this out next week. Many thanks for taking the time to dig into it.

  20. cgk
    cgk is offline
    cgk's Avatar
    Posts
    3,868 Posts
    Global Posts
    9,555 Global Posts
    #20  
    Just done this - as you say, the trade-off is that the pages are slower to read but hey they are now readable!
    Aredon likes this.
Page 1 of 9 123456 ... LastLast

Posting Permissions