Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-66788

QPdfEngine::drawHyperlink shouldn't use xprintf for url

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 5.11.0 Beta 1
    • GUI: Painting

    Description

      QPdfEngine::drawHyperlink uses xprintf to output encoded url to pdf.

      Problem is that xprintf works with fixed buffer and urls could be bigger, especially with a lot of non-latin1 encoding stuff. Use of xprintf here leads to incorrect pdf generated.

       

      line:

      d->xprintf("/Type /Action\n/S /URI\n/URI (%s)\n", url_esc.constData());
      

      should be replaced with:

      d->xprintf("/Type /Action\n/S /URI\n/URI (");
      d->stream->writeRawData(url_esc.constData(), url_esc.size());
      d->streampos += url_esc.size();
      d->xprintf(")\n");
      

      Attachments

        For Gerrit Dashboard: QTBUG-66788
        # Subject Branch Project Status CR V

        Activity

          People

            vgt Eirik Aavitsland
            dluk Dluk Dluk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes