Results 1 to 12 of 12

Thread: Print a document

  1. #1
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Print a document

    Hiii everyOne,

    Is there a way in QML to print a document directly without passing by C++?

    Cheers,

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    Assuming you mean QtQuick, that will probably depend on what the component can do that you use to display/edit the document.

    Most components can not print themselves as far as I know.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    Thanks,
    I have a template that contains static data (first name, family name, age, ...) and I have a userInterface that contains some TextInput

    I want when I enter the data (TextInput) and click on the print button ------> print the data on the template

    Someone can help me ?

    Cheers,

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    And you have a component that handles the template and replacing placeholders with the data you provide at runtime?

    Cheers,
    _

  5. #5
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    No I don't have, and I don't know how do it
    I started doing some documentations

    Do you have some documentations that can help me and focus on my problem

    Cheers

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    Well, you said you have a template.

    So what does that template look like?

    Cheers,
    _

  7. #7
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    It's just a pdf file that contains :
    First name :
    Family name :
    age :
    ...

    I want to print the data from TextInput in its place ( First name : name from TextInput - age : age from TextInput - etc ...)

    Cheers,

  8. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    Then printing is really the least of your concerns, getting your values into the template will be the first and more important step.

    You will either end up with some library that can parse and render PDF and is very likely capable of printing it, or you end up with a newly generated PDF that you then open in PDF viewer for printing.

    Cheers,
    _

  9. The following user says thank you to anda_skoa for this useful post:

    Binary01 (19th February 2016)

  10. #9
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    I have to learn many things

    Quote Originally Posted by anda_skoa View Post
    Then printing is really the least of your concerns, getting your values into the template will be the first and more important step.
    _
    Yes, You're right,
    STEP 1 : so how can I put values into the template ?
    STEP 2 : Printing

    Have u any documentation that can help me ?

    What is your opinion about this link : https://github.com/tanelipe/QmlPrinter

    Cheers,

  11. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    Quote Originally Posted by Binary01 View Post
    STEP 1 : so how can I put values into the template ?
    No idea, you'll have to research PDF processing libraries.

    Quote Originally Posted by Binary01 View Post
    What is your opinion about this link : https://github.com/tanelipe/QmlPrinter
    Doesn't look relevant to your problem.

    Cheers,
    _

  12. The following user says thank you to anda_skoa for this useful post:

    Binary01 (19th February 2016)

  13. #11
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    I need some orientation...

    I have not found enough documentation on internet
    If someone has already worked in this topic, plz I need his help : Documentations, Examples, ...

    Cheers,

  14. #12
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Print a document

    Hiii,

    How can I Open/View a PDF in an application QML ?

    I found this 2 ways :
    1- With Pdfjs ---> using WebView{ ... }
    2- With Poppler

    If someOne has an idea concerning this 2 ways

    Procedure of installing Poppler/Pdfjs ?
    config: Qt 5.1.0 VS 2012

    Cheers,

Similar Threads

  1. Print QScrollarea to multipage document
    By tereks in forum Qt Programming
    Replies: 0
    Last Post: 6th June 2014, 06:57
  2. Need advices for build and print document.
    By cydside in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2011, 21:29
  3. Cancelling Long-running Print/Print Preview
    By ChrisW67 in forum Newbie
    Replies: 4
    Last Post: 17th June 2009, 00:05
  4. Help document
    By weixj2003ld in forum Qt Programming
    Replies: 5
    Last Post: 17th May 2009, 13:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.