Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Use poppler library WITH QML not C++?
Forum Updated to NodeBB v4.3 + New Features

Use poppler library WITH QML not C++?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 670 Views 1 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.
  • A Offline
    A Offline
    adibub
    wrote on 11 Jan 2019, 13:48 last edited by adibub 1 Nov 2019, 13:49
    #1

    Hey guys,

    New to QML and want to use the poppler library to display and edit PDF`s from QML. Now most of the documentation (that is scattered across the www) it seems everything is pointing to that the poppler library can only be used from C++ code. Is that true?

    Now i have installed the poppler-0.73.0 library successfully and i import it in my .pro file without issues. But i really would like to write everything inside QML instead. Now another way is to use KDE´s Okular, but was hoping not to have to do that.

    Any help to how i can use Poppler from QML would be awsome!
    I`m btw using Macos High Sierra 10.13.x

    R 1 Reply Last reply 11 Jan 2019, 15:19
    0
    • A adibub
      11 Jan 2019, 13:48

      Hey guys,

      New to QML and want to use the poppler library to display and edit PDF`s from QML. Now most of the documentation (that is scattered across the www) it seems everything is pointing to that the poppler library can only be used from C++ code. Is that true?

      Now i have installed the poppler-0.73.0 library successfully and i import it in my .pro file without issues. But i really would like to write everything inside QML instead. Now another way is to use KDE´s Okular, but was hoping not to have to do that.

      Any help to how i can use Poppler from QML would be awsome!
      I`m btw using Macos High Sierra 10.13.x

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 11 Jan 2019, 15:19 last edited by
      #2

      @adibub
      Since poppler doesn't provide QML types, you will need to bring it to QML yourself.
      For example read this and this as a starting point.

      For displaying images from C++ in QML you need to create a simple QQuickImageProvider.
      Editing is a whole different feature. How should the editing exactly happen?
      Do you want to resize each element individually?
      What element types (text, images, vector graphics, etc.)?

      This is by far not trivial to implement.

      You will need to map each element/info/... you get out of poppler to a corresponding QML item and vice versa.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      A 1 Reply Last reply 11 Jan 2019, 23:51
      2
      • R raven-worx
        11 Jan 2019, 15:19

        @adibub
        Since poppler doesn't provide QML types, you will need to bring it to QML yourself.
        For example read this and this as a starting point.

        For displaying images from C++ in QML you need to create a simple QQuickImageProvider.
        Editing is a whole different feature. How should the editing exactly happen?
        Do you want to resize each element individually?
        What element types (text, images, vector graphics, etc.)?

        This is by far not trivial to implement.

        You will need to map each element/info/... you get out of poppler to a corresponding QML item and vice versa.

        A Offline
        A Offline
        adibub
        wrote on 11 Jan 2019, 23:51 last edited by
        #3

        @raven-worx I was hoping to be able to "paint" som simple vector graphics on top of the pdf resizing each individually yes and then saving it for print. You are completely right it is not trivial at all to implement.

        Thanks for the info on integrating C++ with QML, will look into this the next days.

        1 Reply Last reply
        0

        1/3

        11 Jan 2019, 13:48

        • Login

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