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. Bookmark Issue when converting HTML to PDF

Bookmark Issue when converting HTML to PDF

Scheduled Pinned Locked Moved Unsolved General and Desktop
pdfhtmlbookmarksqprinter
4 Posts 3 Posters 742 Views
  • 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.
  • M Offline
    M Offline
    Majed.Y
    wrote on last edited by
    #1

    I am converting an html script to a pdf using QPrinter and QTextDocument, but can't seem to get any bookmarks to work in the pdf file that is created. I am aware that only a subset of HTML is supported and have followed the documentation in order to produce an html doc suitable for conversion to pdf using QPrinter and everything works fine except bookmarks which appear to just get ignored, even though the documentation gives the impression that anchors and links are supported. While I have both links to external docs and bookmarks in the html working, only the links to objects outside of the doc using href appear to work in the pdf.

    Implementing the bookmark as followed:
    <div id="bookmark"> </div> (also tried using name instead of id)
    -- somewhere else in the code --
    <a href="#bookmark"> name of bookmark </a>

    Is there something wrong with the way I have used the a tag? or does anyone know of another way of adding a bookmark in a document when converting from html to pdf?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alijutt
      Banned
      wrote on last edited by
      #2
      This post is deleted!
      M 1 Reply Last reply
      0
      • A Alijutt

        This post is deleted!

        M Offline
        M Offline
        Majed.Y
        wrote on last edited by
        #3

        @Alijutt Thanks, but unfortunately I need to be able to convert html docs to pdf programmatically in an application

        batistaB 1 Reply Last reply
        0
        • M Majed.Y

          @Alijutt Thanks, but unfortunately I need to be able to convert html docs to pdf programmatically in an application

          batistaB Offline
          batistaB Offline
          batista
          wrote on last edited by
          #4

          @Majed-Y
          That's can do what you want....
          [link text](link url)https://github.com/qpdf/qpdf

          1 Reply Last reply
          0

          • Login

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