Results 1 to 2 of 2

Thread: Add Bookmark in PDF

  1. #1
    Join Date
    May 2007
    Location
    Germany
    Posts
    89
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Add Bookmark in PDF

    Hello friends,

    simple question: How can I add a bookmark information to my pdf??

    Here is my Code:
    Qt Code:
    1. QPrinter printer;
    2. printer.setOrientation(QPrinter::Portrait);
    3. printer.setOutputFileName("Sendungen.pdf");
    4. printer.setOutputFormat(QPrinter::PdfFormat);
    5. if (db.open()){
    6. QSqlQuery query( "select Statement ");
    7. query.setForwardOnly(true);
    8. while(query.next()){
    9. QSqlRecord record = query.record();
    10. myimage.loadFromData(query.value(record.indexOf("imgData" ) ).toByteArray(),0);
    11. myimage.convertToFormat(QImage::Format_Mono);
    12. //p.setRenderHint(QPainter::Antialiasing, true);
    13. p.begin(&printer);
    14. p.drawImage(0, 0, myimage);
    15. printer.newPage();
    16. }
    17. p.end();
    18. }
    To copy to clipboard, switch view to plain text mode 

    There are many pictures in the pdf, and I search for a method to add a bookmark information per page. Is this possible??

  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: Add Bookmark in PDF

    I don't think this is possible with the current version of Qt. At least not when rendering an image. Maybe if you rendered a QTextDocument containing hyperlinks to images...

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.