Highlighted

Show Page as Portrait on Screen But Print as Landscape

Avatar

25-11-2008

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

Replies

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

26-11-2008

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.
Highlighted

Avatar

03-12-2008

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
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

03-12-2008

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.
Highlighted

Avatar

18-12-2008

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