Forum Discussion

AndreaPahor's avatar
AndreaPahor
Qrew Cadet
7 years ago

Print Form to Landscape

Can I format a QBase form to print to landscape instead of portrait?

I create some simple brochures in QBase . . . and use a 'print' button to print to pdf: 

"<a class='Vibrant Success' href='"&Dbid()&"?a=printr&rid="& [Record ID#]&"&dfid=10'>Print</a>"

Yet . . . although I can change my printer settings to print a landscape pdf . . .  data from my form still prints in portrait. 
  • Did you ever find a solution to this?

    ------------------------------
    Matt Hardy
    ------------------------------
    • JenniferMarque1's avatar
      JenniferMarque1
      Qrew Trainee

      There are several older threads re. printing forms in landscape orientation.  I was facing this exact same issue and wasn't finding any answers here.  So I did some further digging/general Googling, and here is what I found.

      Apparently (at least with Chrome), having "an @page size declaration in the print CSS will override (and hide) the orientation on the print dialog."

      This is from this thread on Stack Overflow.

      I took a look at the CSS for the print window that opens when you select to print a form.  Sure enough, there is an @page{size: 8.5in 11in;} declaration in the <style> section.  I'm not sure why they would put that in there; does it just default that way for the US?  What if you wanted to print on legal paper?

      However, the "solution" in the above referenced Stack Overflow thread, installing the Stylus extension, actually did work.  I just created a new style with @page{size: auto;} and applied it to Everything and it worked!

      That extension is for Chrome; not sure if there is something similar for other browsers.

      The only issue is that I'll need to install the extension for all users that need the ability to print landscape.  I may reach out to support to find out why they put that letter-size @page declaration in there at all.



      ------------------------------
      Jennifer Marquette
      ------------------------------