Results 1 to 6 of 6

Thread: Help creating a PDF doc

  1. #1
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question Help creating a PDF doc

    Hi, I'm programing an application for the management (leveling and cut away the background) of digitalized images taken from the pages of old books. The last step of the processment is the creation of a PDF document with all the processed images (one image per page) to create the corresponding e-book (see the pics below). Well, I've tried to create the PDF document with the QPrinter class and "painting" the images on it using the QPainter class. The problem is that, doing it in this way, it doesn't include the original images and the resulting PDF doc is even larger than the group of images I would like to know if somebody knows a software (freeware if it's possible) that could comunicate with Qt and could create PDF docs from images, like I've already descripted. Thanks a lot.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Help creating a PDF doc

    Adobe Distiller maybe? If not, then ghostscript.

  3. #3
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Help creating a PDF doc

    Since the PDF appears to be fairly simple (one image per page), then you might consider directly generating the PDF. I don't know the PDF spec, but it can't be too hard to do this for such a simple document.

  4. #4
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Help creating a PDF doc

    Thanks wysota but Brandybuck (thanks too) has made me realized that maybe all what I need is just some libraries for the creation of PDF docs and for the attachment of images on them. The problem is that I don't know where to find them
    Another solution could be taking advantage of the fact that Qt is opensource and search for its sources where it compresses the images in the pdf docs. I'm nearly sure that it fixes a compression level. I would like to change it. That would do the trick, too. I've been reading QPrinter and QPainter but It's a little complex to find where it generates the PDF ( again)

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Help creating a PDF doc

    AFAIK Qt doesn't do any special compression, it just sticks images into the pdf. Optimisations are planned for future releases.

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

    Dark_Tower (9th December 2006)

  7. #6
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Help creating a PDF doc

    Hi again, finally seems that my suposition was true (which I'm happy ) and Qt seems to fix the compression level in the file "qprintengine_pdf.cpp" line 519 with a value of 95. Reading a bit the method "addImage" seems a bit "dirty" because, for example, if we create a QImage from a JPEG image, then, internally, the image is compressed again to jpeg So, why they don't create a method to include the original image, as I've said before? I hope that in the future would be possible... I also hope that this helps somebody else with this problem

Similar Threads

  1. Problem in creating thread in GUI application
    By jyoti kumar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2006, 12:05
  2. Creating a global array in my code???
    By therealjag in forum General Programming
    Replies: 5
    Last Post: 13th March 2006, 11:13
  3. uic not creating seperate .h and .cpp files
    By Kapil in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2006, 10:43
  4. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37
  5. Creating a "windowless" software
    By Yorma in forum Qt Programming
    Replies: 7
    Last Post: 9th January 2006, 15:21

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.