Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using existing pdf file?
Forum Updated to NodeBB v4.3 + New Features

Using existing pdf file?

Scheduled Pinned Locked Moved Unsolved General and Desktop
18 Posts 6 Posters 3.0k Views 4 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.
  • V VRonin
    25 Jan 2019, 08:38

    If you have Acrobat Pro (i.e. the paid version) you can create the base PDF and add form fields on it. Then you can use QXmlStreamWriter to create an XFDF file with the values that will fill the form

    M Offline
    M Offline
    Mucip
    wrote on 25 Jan 2019, 08:40 last edited by
    #7

    @VRonin ,
    Unfortunatelly no... :(
    Any other?
    What about poopler?... Is there anyone who use it?

    Regards,
    Mucip:)

    M 1 Reply Last reply 25 Jan 2019, 09:10
    0
    • M Mucip
      25 Jan 2019, 08:40

      @VRonin ,
      Unfortunatelly no... :(
      Any other?
      What about poopler?... Is there anyone who use it?

      Regards,
      Mucip:)

      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 25 Jan 2019, 09:10 last edited by
      #8

      @Mucip
      Hi
      Just as a note.
      you can cheat and use
      command line tool that can merge 2 pdfs.
      https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

      so you print your data to one pdf and use pdftk to merge with the
      template form pdf into a new pdf.

      M 1 Reply Last reply 25 Jan 2019, 09:43
      2
      • M mrjj
        25 Jan 2019, 09:10

        @Mucip
        Hi
        Just as a note.
        you can cheat and use
        command line tool that can merge 2 pdfs.
        https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

        so you print your data to one pdf and use pdftk to merge with the
        template form pdf into a new pdf.

        M Offline
        M Offline
        Mucip
        wrote on 25 Jan 2019, 09:43 last edited by
        #9

        Hi @mrjj ,
        I think using extra command line is not clean way to solve this... :(

        Regards,
        Mucip:)

        M 1 Reply Last reply 25 Jan 2019, 09:56
        0
        • M Mucip
          25 Jan 2019, 09:43

          Hi @mrjj ,
          I think using extra command line is not clean way to solve this... :(

          Regards,
          Mucip:)

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 25 Jan 2019, 09:56 last edited by
          #10

          @Mucip
          Hi
          Well it worked pretty flawless for years for me.
          pdftk is really high quality.
          But yes, it's not as smooth as having
          the feature directly in the app.
          It was just a suggestion as editing a pdf is
          hard to archive for free.

          Have you considered just use an SVG file as the template ?

          M 1 Reply Last reply 25 Jan 2019, 10:00
          1
          • M mrjj
            25 Jan 2019, 09:56

            @Mucip
            Hi
            Well it worked pretty flawless for years for me.
            pdftk is really high quality.
            But yes, it's not as smooth as having
            the feature directly in the app.
            It was just a suggestion as editing a pdf is
            hard to archive for free.

            Have you considered just use an SVG file as the template ?

            M Offline
            M Offline
            Mucip
            wrote on 25 Jan 2019, 10:00 last edited by
            #11

            Hi @mrjj ,
            Ofcourse. Why not? I may prepare some template with Inkscape. No problem...
            Well, How???..

            Regards,
            Nucip:)

            M 1 Reply Last reply 25 Jan 2019, 10:04
            0
            • M Mucip
              25 Jan 2019, 10:00

              Hi @mrjj ,
              Ofcourse. Why not? I may prepare some template with Inkscape. No problem...
              Well, How???..

              Regards,
              Nucip:)

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 25 Jan 2019, 10:04 last edited by mrjj
              #12

              @Mucip
              Hi
              Was thinking on inkscape :)
              You can get positions of SVG elements with
              http://doc.qt.io/qt-5/qsvgrenderer.html#boundsOnElement
              so its possible to load the SVG and find out where placeholders are and then
              first draw SVG template , then draw the text in place holders positions.
              and then save it all as pdf.
              SVG looks good in all resolutions.

              Please notice that Inkscape kinda flips the y coordinates, so google that as
              it fooled me a bit.

              M 1 Reply Last reply 25 Jan 2019, 10:12
              1
              • M mrjj
                25 Jan 2019, 10:04

                @Mucip
                Hi
                Was thinking on inkscape :)
                You can get positions of SVG elements with
                http://doc.qt.io/qt-5/qsvgrenderer.html#boundsOnElement
                so its possible to load the SVG and find out where placeholders are and then
                first draw SVG template , then draw the text in place holders positions.
                and then save it all as pdf.
                SVG looks good in all resolutions.

                Please notice that Inkscape kinda flips the y coordinates, so google that as
                it fooled me a bit.

                M Offline
                M Offline
                Mucip
                wrote on 25 Jan 2019, 10:12 last edited by
                #13

                Hi @mrjj ,
                How can I prepare some template with text input?
                As I understant from your post SVG elements need to be put on template and I don't know about this.
                I will check google how to work with SVG elements.

                By the way do you have sample SVG file or manual to do your suggestion?

                Regards,
                Mucip:)

                M 1 Reply Last reply 27 Jan 2019, 02:02
                0
                • M Offline
                  M Offline
                  Mucip
                  wrote on 25 Jan 2019, 11:20 last edited by
                  #14

                  Hi @bougti ,
                  I couldn't understand why I need this?...

                  Regards,
                  Mucip:)

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 25 Jan 2019, 22:18 last edited by
                    #15

                    @Mucip It was a spam post.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    M 1 Reply Last reply 25 Jan 2019, 22:21
                    1
                    • S SGaist
                      25 Jan 2019, 22:18

                      @Mucip It was a spam post.

                      M Offline
                      M Offline
                      Mucip
                      wrote on 25 Jan 2019, 22:21 last edited by
                      #16

                      Hi @SGaist
                      What a strange guys?! :(
                      I couldn't understand what is the benefit of this beheviour?

                      Regards,
                      Mucip:)

                      1 Reply Last reply
                      1
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 25 Jan 2019, 22:23 last edited by
                        #17

                        Trying to lure people going on their fishy website for who knows what.

                        Some are tricky to detect.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1
                        • M Mucip
                          25 Jan 2019, 10:12

                          Hi @mrjj ,
                          How can I prepare some template with text input?
                          As I understant from your post SVG elements need to be put on template and I don't know about this.
                          I will check google how to work with SVG elements.

                          By the way do you have sample SVG file or manual to do your suggestion?

                          Regards,
                          Mucip:)

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 27 Jan 2019, 02:02 last edited by
                          #18

                          @Mucip said in Using existing pdf file?:

                          • How can I prepare some template with text input?
                            Draw it using inkscape.
                            Each element of page has an ID. ( and you can change it to something more easy to read)
                            So place a rect, where you want the USER text to be put.
                            Set the ID of this rect to something that make sense. ( name of what text is for)
                            Then from Qt, you can use http://doc.qt.io/qt-5/qsvgrenderer.html#boundsOnElement
                            to find the place rect again and then draw the USER text there.
                            So first draw the SVG template, then draw USER text at the ID locations and
                            save it all as pdf.

                          • As I understant from your post SVG elements need to be put on template and I don't know about this.
                            Well the template is the SVG file and you just use a rect as place holder to where text goes.

                          1 Reply Last reply
                          2

                          16/18

                          25 Jan 2019, 22:21

                          • Login

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