Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Show Page as Portrait on Screen But Print as Landscape

Avatar

Former Community Member
Does anybody know how to make a page display as Portrait on the screen, but print as Landscape?



My form has pages 1 to 4 as Portrait and page 5 as Landscape per wishes of HR Dept. I have two Master Pages to handle this.



The problem is I had to set up page 5 as Landscape on the screen to get it to print as Landscape, but when the user gets to page 5, the other 4 pages shrink to accommodate the Landscape page and this looks bad.



I know this is possible because I received a PDF from Delta Dental Insurance Company that displays their Application Form as portrait, but it prints as Landscape.



Any Ideas?



Thanks, Ron
5 Replies

Avatar

Former Community Member
There is a command to change the page orientation at runtime. You must address the master page to do this. This example uses the default names given to your form and the master page:



xfa.template.form1.pageSet.Page1.medium.orientation = "landscape"



Try that on the preprint event and see if it works.

Avatar

Former Community Member
I tried your example on a test form with all default names, but could not get it to work. My test page was portrait orientation and I wanted it to print as landscape, but it still printed portrait.



I put this exact code in the preprint event and put a test display message to verify this event being called correctly.



Your example matches what is in the LCD scripting reference book, so it should work. Any ideas?



Thanks, Ron

Avatar

Former Community Member
I forgot to mention that you will have to force a layout to occur again. Add this command after the change of orientation command:



xfa.layout.relayout();



This forces the layout to happen again and the orientation should get interpretted.



I created a sample if you want to post your email I will send it to you.

Avatar

Former Community Member
Paul,



I looked at this again with the help of your sample. I found out that I had to save the form as a Dynamic PDF to get the Orientation and Relayout to work.



It works with all LCD Target Versions except 6.0.2, since LCD will not let you save a Target 6.0.2 PDF as Dynamic.



I need to look up the implications of saving my PDF forms as Dynamic instead of my usual Static. Don't know about this yet.



Another way to handle this problem might be to define the page as Landscape in LCD, but set the width to 8.5 inches. So then Adobe Reader will display the Landscape page the same width as the other Portrait pages, but will print the page as Landscape when the "Auto-Rotate and Center" box is checked.



Thanks, Ron

Avatar

Level 1

Hi guys,

I'm in a similar situation ; and faced to NO solution til now!

 

My Adobe is designed into "Landscape" mode... and label on Zebra ZT421 is on Portrait mode

  • By using a +/- SAP standard "device type" (YZB200 / 203 dpi), the label do the rotation (90°) ... but the BareCodes are not good (too longs).PascR_2-1686239392496.png

     

  • By using another SAP standard "device type" more oriented PDF (PDFUC), the BC are perfect ... but impossible to have the Label rotation : printed in landscape on Label PascR_3-1686239461483.pngPascR_4-1686239626984.png

     

    I precise that I tried to change the orientation of the "Master page" (only 1) PascR_5-1686239631217.png and nothing works : print is always done in "landscape mode" on the label in "Portrait mode" !!

     

So I wondering if there's a way to "force" the print of the label on Landscape mode by example.

And/or a ZPL commande ? or "jobProfile" to help ?

 

many thanks if you can help.

PascR.