QWebEnginePage print pdf in Landscape

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

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

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

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

    @page {
                size: 8.27in 11.69in;
                margin: 0.86in;

Log in to reply