Template that pulls in a Dynamic Background (PDF, TIFF, or JPG).
Starting with pdf files first.
Trying to change the media based on the size and orientation (using the height and width) of the pdf file.
By default I set the media to TRAY1_LTR and created a script.
With a landscape letter sized pdf file the script in debug indicates that TRAY1_LTR_L is set, the preview display still shows TRAY1_LTR instead.
I was expecting to see the media to switch in preview,
Also checked in proof print > pdf file.
I am trying to do about the same thing, and can’t get it to work. I am get a parameter from workflow and just doing an if/else statement on it via a script and it doesn’t seem to work…
Can you let me know please in which unit of length (for example: centimetres (cm) or inches (in)) the width and height Media settings are? Because I assume that the width and height values in your Control Script are in inches and that the width and height values in your Media settings are in another unit of length. Can you please confirm if this is correct? If so, then I would like to suggest to change the following two lines of JavaScript code from:
Just letting you know a support ticket was opened for this so I had the template available to me. I can confirm adding pt as the unit of measure fixes the section size issue. Also, one more fix that will be required is in the evaluation of the PDF size returned. the width and height values will have pt in them(use logger.info to see what gets returned), yet the IF statement evaluates integer values. The width and height returned will have to be stripped of the “pt” to allow numerical evaluation/comparison. Also, the setMedia evaluation has a mix of string and integer values, make sure to not wrap the numbers in double quotes.