Skip navigation
MF321
Currently Being Moderated

Change paper type (A4) via JavaScript

Mar 26, 2012 6:45 AM

Hi all,

I want to change the paper type via Java Script to A4.

The hierarchy:

data  -->pageSet -->page1 (A4)

Image.png

Is this the right syntax, if I want ot switch the page1 to A4? ...and which "Event" should I use? --->initialize?

 

data::initialize - (JavaScript, both) 

xfa.data.pageSet.page1.medium.stock = "A4";

 
Replies
  • Currently Being Moderated
    Mar 28, 2012 9:02 AM   in reply to MF321

    Hi

     

    Are you trying to change the size on the fly for different values for instance.

     

    Or is this simply ensureing the page is formatted correctly when the document is opened?

     

    I could not get your code to work

     

    but this code appears to work OK

     

     

    xfa.form.form1.pageSet.pageArea.medium.stock = "A4";

     

    Hope this helps

     

    Graham Spaull

    DubDubDubDesigns.co.uk

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 29, 2012 8:33 AM   in reply to MF321

    Unfortunately, I dont believe you can change the medium at runtime through script. Unless it has been changed in version 10

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points