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. QPdfView doesn't render PDF file correctly.
Forum Updated to NodeBB v4.3 + New Features

QPdfView doesn't render PDF file correctly.

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 620 Views 2 Watching
  • 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.
  • H Offline
    H Offline
    hank17_0
    wrote on last edited by
    #1

    I'm working on an application which used to display a pdf file.

    #include <QPdfView>
    #include <QPdfDocument>
    #include <QDebug>
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    
        QPdfDocument *document = new QPdfDocument;
    
        document->load("E:/multipage.pdf");
    
        QPdfView* view = new QPdfView;
        view->setDocument(document);
    
        view->setPageMode(QPdfView::MultiPage);
    
        view->show();
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    

    It can display the pdf file, but the widget annotation was not rendered.
    1.jpeg
    above picture is the pdf opened by adobe reader. The stamp is an widget annotation.

    2.jpeg
    when I open the same file with qt code. The widget annotation was not rendered.Only the text is rendered.

    What should I do to make it right?

    Here is the pdf structure.3.jpeg

    Thanks for your help.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      I dont think stamping and extensions as such are supported.

      Try online site like
      https://smallpdf.com/pdf-reader

      and see if that show is.

      H 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        I dont think stamping and extensions as such are supported.

        Try online site like
        https://smallpdf.com/pdf-reader

        and see if that show is.

        H Offline
        H Offline
        hank17_0
        wrote on last edited by
        #3

        @mrjj Thanks for you reply. It works fine on your site.
        4.jpeg

        1 Reply Last reply
        1

        • Login

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