Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120351

Extend QPdfWriter function to add widget annotation fields to the PDF

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.5.3
    • None
    • All

    • All

    Description

      We are in need of creating a PDF that contains a dynamic input field for a viewer to add text after the PDF has been created. This is not possible to automatically create based on the UI definition, so I needed to add a function that can be used after the UI has been rendered. What I did was, create a UI with an empty QWidget item in it, render de UI with the QPdfWriter and then take the geometry coordinates from the widget and then use my added function to insert a PDF widget annotation field in the page. See the class PMyPdfWriter in the zip.

      I have added a function QPdfEngine::addDynamicField to the copied, and adjusted for building this project, copy from the Qt GUI sources and made it accessibel through the QPdfWriter class.

      This does work. The only other thing that needs to be changed to the Qt sources is that class QPdfEngine must be set as a friend to the QFont class (this change is not part of the attached ZIP).

      I would like to request a change to the QPdfWriter class and sub-classes to incorporate this function.

       

      Attachments

        1. DynPdfTest.zip
          53 kB
          Eelco van Dam
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            eelcopeacs Eelco van Dam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes