Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Change paper type (A4) via JavaScript

Avatar

Level 2

Hi all,

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

The hierarchy:

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

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";

2 Replies

Avatar

Former Community Member

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

Avatar

Level 5

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