Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEnginePage print pdf in Landscape
Forum Updated to NodeBB v4.3 + New Features

QWebEnginePage print pdf in Landscape

Scheduled Pinned Locked Moved Solved QtWebEngine
2 Posts 1 Posters 489 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.
  • mmjvoxM Offline
    mmjvoxM Offline
    mmjvox
    wrote on last edited by
    #1

    I'm trying to save a pdf file from QWebEnginePage in Landscape ,

     QWebEnginePage *m_page;
    
     m_page->setHtml(m_inputPath);
    
    m_page->printToPdf(m_outputPath, QPageLayout( QPageSize(QPageSize::A4) ,
                                                       QPageLayout::Landscape,
                                                      QMarginsF()) );
    
    
    

    but Landscape mode not working and print always in Portrait.
    What wrong?

    1 Reply Last reply
    0
    • mmjvoxM Offline
      mmjvoxM Offline
      mmjvox
      wrote on last edited by
      #2

      I made a little mistake.
      This CSS code in my html file caused this problem.

      @page {
                  size: 8.27in 11.69in;
                  margin: 0.86in;
              }
      
      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