Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to go about opening a PDF in iOS where the PDF is part of the App
Forum Updated to NodeBB v4.3 + New Features

How to go about opening a PDF in iOS where the PDF is part of the App

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 376 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • aarelovichA Offline
    aarelovichA Offline
    aarelovich
    wrote on last edited by
    #1

    I have an application that must open up its manual. The manual is a PDF file.

    I have the file as a resource of the application. And the application will run on an iPad. Obviously my app is written using Qt. I use QML for the UI stuff.

    I would like write some code that would launch the default application for PDF reading. I would guess Safari would do the job just fine.

    Here is my issue. Since the file is part of the App it means I have to copy it somewhere that is both accessible as a Write location for my app and as a read location for the Reader. And as far as I undestand it, this is not possible due to security restrictions on iPad.

    So is there a way in which I can get what I want?

    Basically I need the user to click a link in my app and then display a PDF file that is part of the App. Anyway to accomplish this would be viable.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      There's the built-in PDF module in Qt: https://doc.qt.io/qt-6/qtpdf-index.html It should work directly with QRC data, so no need to worry about sharing it with Safari.

      If licensing is OK for you and if it works on iOS - I haven't checked myself.

      (Z(:^

      1 Reply Last reply
      1
      • aarelovichA Offline
        aarelovichA Offline
        aarelovich
        wrote on last edited by
        #3

        Unfortunately it works, just not on iOS. I have tried this. I created an example compiled and run for MacOS. But when I tried it on iOS the application crashed showing me some strange memory error inside one of the qt sources. I've actually raised a support ticket with Qt (we have the paid license) and their first answer was read the documentation, like they didn't even read my ticket. So I'm looking for alternatives.

        1 Reply Last reply
        0
        • ekkescornerE Offline
          ekkescornerE Offline
          ekkescorner
          Qt Champions 2016
          wrote on last edited by
          #4

          have you tried QDesktopServices (https://doc.qt.io/qt-6/qdesktopservices.html) to open the pdf inside your app with Pdf app outside ?

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
          5.15 --> 6.9 https://t1p.de/ekkeChecklist
          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved