facebook

HOW PROBLEM WAS SOLVED: PDFs IN NATIVE APP

  1. MobiOne Archive
  2.  > 
  3. Examples, HOW-TOs
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #345082 Reply

    herb200mph
    Participant

    Problem:
    Place a PDF document with a Native App so that display of it can be zoomed/pinched/scrolled. Also, so that the PDF documents would be accessible when no internet or wi-fi connection.

    Solution-the Basics:
    1) Screen with link buttons to the PDF documents.
    2) Create an “htm” file for each PDF document to be displayed.
    3) Adjust the CSS in the “htm” file to display the PDF, re: size, etc.
    4) Add a simple “href” link to the PDF within the “htm.”
    5) Make each button open “Go to URL” and “Popup (toolbar).

    Solution-the “Trick” Used:
    The App ended up with 70 “htm” files for 70 “PDF” documents – which needed to be embedded so they would upload as part of the App. So this was done:
    1) Created a “mobi” page with no content called: “Z-htm-pages” (The “Z” so it shows up bottom of alpha directory lists).
    2) Attached each “htm” file to the “mobi” page.
    3) Created a “mobi” page with no content called: “Z-PDF-pages.”
    4) Attached each “PDF” file to the “mobi” page.

    Once those two “mobi” pages were created and the respective files attached:
    (5) Both of the “Z…” pages where then made attachments to the “index” page for the App. This loaded the App and pulled all the “htm” and “PDF” files with it.

    Result:
    When a button is tapped, it opens the “htm” page wherein the “PDF” document is displayed with zoom/pinch/scrolling features.

    The pages display correctly in portrait and landscape mode on both iPad and iPhone. This App isn’t going to be used on Android devices, so that was not tested; only “i” thingies.

    The “PDF” screen is closed using the automatic “Done” button at the lower left of the screen.

    Switched devices to “airplane mode” and opened the App. Each PDF displayed and functioned perfectly.

    Hope this helps anyone that runs into the same problem.

    HERB

    P.S. Didn’t test it, but should also work with images.

    P.S.S. If there were spaces in the “htm” or “PDF” file names, it would not work, so each needed to have NO SPACES in the file name.

Viewing 1 post (of 1 total)
Reply To: HOW PROBLEM WAS SOLVED: PDFs IN NATIVE APP

You must be logged in to post in the forum log in