Results 1 to 9 of 9

Thread: Pdf generating tool(3rd party api's) for Qt Creator

  1. #1
    Join Date
    Sep 2013
    Posts
    40
    Thanks
    6
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Pdf generating tool(3rd party api's) for Qt Creator

    Hi everyone,

    Is there any 3rd party api's for generating pdf in Qt Creator, same as iTextPdf (viz. used for manipulating PDF in java)?

    Pls reply ASAP.

    Regards,
    Rohit

  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: Pdf generating tool(3rd party api's) for Qt Creator

    If you mean generating PDF with Qt, then yes, QPrinter can directly output to PDF.
    If you indeed mean QtCreator I am afraid I don't understand the question.

    Cheers,
    _

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Pdf generating tool(3rd party api's) for Qt Creator

    If you need to manipulate the content of existing PDF files then Qt does not directly help.

    You can use any C-based PDF library, any C++ based library built with a compatible compiler, or any ActiveX based option (on Windows only of course). Take your pick.

  4. #4
    Join Date
    Sep 2013
    Posts
    40
    Thanks
    6
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Pdf generating tool(3rd party api's) for Qt Creator

    @anda_skoa : I don't know, does it make any difference (sorry if it does) ,basically i am new to this technology & i am facing certain problems with Qt pdf generation .
    I am able to generate PDF with Qprinter but there are many drawbacks of it as follows (faced by me):
    • New Page issue: Code has to be written for new page when page is getting overflowed.
    • Un-even Spacing between words & letters: Spacing between alphabets is coming making pdf look uncanny (weird).
    • Dynamic space (height/width) calculation: Dynamic space (height) calculation cannot be done.
    • Fixed cell height: If cell’s data is large it is not displayed in the cell.

    Pls, suggest any api's for PDF generation or help me to fix above issues.

    @ChrisW67 : Can u pls name any of them such that it is easy for me to google it, because i've already searched a whole lot & still no solution found.

    Regards,
    Rohit Kashyap.


    Added after 22 minutes:


    I was searching on net & found following api's :
    o Poppler
    o Hummus &
    o PoDoFo
    but i am not able to find any further solution on how to use them.
    Last edited by rohitkk; 20th November 2013 at 04:54.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Pdf generating tool(3rd party api's) for Qt Creator

    Poppler is a fairly complete GPL PDF implementation. Of course, Adobe offer libraries in this area.

    PDF is a page description format, not a desktop publishing engine or report generator. The PDF support in Qt is designed to output PDF as a printer. Pagination is handled by the software doing the printing not by some automagic mechanism that knows where to break content.

    If you re trying to write something like a word processor then you should look at QTextDocument which has some pagination abilities.
    If you want some sort of report generator then you could look at KDAB's KDReports.

  6. The following user says thank you to ChrisW67 for this useful post:

    rohitkk (20th November 2013)

  7. #6
    Join Date
    Sep 2013
    Posts
    40
    Thanks
    6
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Pdf generating tool(3rd party api's) for Qt Creator

    @ChrisW67 :Thank you for ur fast reply & i was searching for KDReports by KDAB , not much info on net was found. I've downloaded KDReports from https://customers.kdab.com/download.php & after using it in Qt it keeps on giving certain errors as there is not much documentation provided.
    If you have any sort have of info. pls post it.

    Regards,
    Rohit

  8. #7
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Pdf generating tool(3rd party api's) for Qt Creator

    Long time a go i write Miniscribus.. a smal clone of http://www.scribus.net/canvas/Scribus
    many tousend of download..
    Today i use docx or odt opendocument as template... in programm, but on xml subformat you can draw all items and color..
    https://code.google.com/p/fop-miniscribus/
    Qt can write pdf & ps postcript file... rtf docx odt and many others..




    Added after 31 minutes:


    Last week i write a converter from pdf to html i try on qpoppler on pdftohtml... and recompose as html..
    http://dconv-server.googlecode.com/s...ib/pdfhtml.cpp
    the result is nice but font rendering is not perfect..

    the best converter i found after is a 700kb javascript code.. lol...
    this small piece convert all font to openfont and after you render a first class result on browser without!!! Adobe Reader or plugins..
    https://github.com/mozilla/pdf.js
    http://andreasgal.com/2011/06/15/pdf-js/
    so you can extract complex html to draw a better result as poppler... :-)
    Last edited by patrik08; 20th November 2013 at 12:56.

  9. #8
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Pdf generating tool(3rd party api's) for Qt Creator

    Here i found other libs..
    I find by http://wiki.scribus.net/canvas/Build..._WPG_Importers
    http://podofo.sourceforge.net/about.html
    What is PoDoFo?

    PoDoFo is a library to work with the PDF file format. The name comes from the first letter of PDF (Portable Document Format). A few tools to work with PDF files are already included in the PoDoFo package.

    The PoDoFo library is a free, portable C++ library which includes classes to parse PDF files and modify their contents into memory. The changes can be written back to disk easily. The parser can also be used to extract information from a PDF file (for example the parser could be used in a PDF viewer). Besides parsing PoDoFo includes also very simple classes to create your own PDF files. All classes are documented so it is easy to start writing your own application using PoDoFo.

    PoDoFo is written in C++ and the code was sucessfully compiled under Unix, Mac OS X and Windows.

  10. #9
    Join Date
    Sep 2013
    Posts
    40
    Thanks
    6
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Pdf generating tool(3rd party api's) for Qt Creator

    Hi,
    Pls provide info. on how to set environment for KDReport.


    Added after 31 minutes:


    Quote Originally Posted by ChrisW67 View Post
    Poppler is a fairly complete GPL PDF implementation. Of course, Adobe offer libraries in this area.

    PDF is a page description format, not a desktop publishing engine or report generator. The PDF support in Qt is designed to output PDF as a printer. Pagination is handled by the software doing the printing not by some automagic mechanism that knows where to break content.

    If you re trying to write something like a word processor then you should look at QTextDocument which has some pagination abilities.
    If you want some sort of report generator then you could look at KDAB's KDReports.
    Hi,
    Can u pls provide information on how to integrate & use KDReports in Qt.

    Thanks in advance.
    Regards,
    Rohit Kashyap
    Last edited by rohitkk; 22nd November 2013 at 06:12.

Similar Threads

  1. Weird problem with tool chain in Qt Creator
    By Momergil in forum Qt Tools
    Replies: 0
    Last Post: 24th March 2013, 14:14
  2. Replies: 0
    Last Post: 9th November 2012, 11:28
  3. Replies: 1
    Last Post: 11th April 2012, 08:50
  4. Third Party tool for deploy Qt Application on Mac?
    By vishal.chauhan in forum Qt-based Software
    Replies: 6
    Last Post: 10th February 2009, 17:03

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.