Jump to content

Recommended Posts

I have many scripts that are generating a PDF using data from records in particular tables using several layouts to display all the data (lots of fields).  We've always done the scripts just plugging away from beginning to end, hard coding the finds and sorts needed, switching from layout to layout, setting the print parameters for each layout, continuing until finished.  My dream is to generalize/modularize these as much as possible.  I have a couple of questions based on things that look like potential issues. (I think I know how to pass find and sort parameters and which layout to use for each page I need to generate, so I'm good there.)

The first issue has to do with page setups when switching layouts.  Because some layouts are more crowded than others, they have to be set at different scales for printing.  Does using "Print" use the print setup (orientation and scale) saved with the layout, vs. using "Print Setup" and setting the scale in the script before running the "Print" step?  (I know, really elementary question, but I've never tested it, always have used the "Print Setup" step!) Otherwise, is there a way to pass this info, say, using variables?

Also, if you are creating a PDF, can you use "Append" on the first step, or will that create an error if the file has not yet been created?  Also something I've just never tested.

Many thanks in advance.

Share this post


Link to post
Share on other sites

Yes, you need to precede the Print step with Print Setup to restore the page settings you want.

I have never tried the Append option on the first PDF created so I don't know either. Let us know what you find out when you try it.

Share this post


Link to post
Share on other sites

Print options are not saved with layouts. You can specify multiple Print/Print Setup steps within a single script, though, so one way you might modularize is to send a parameter like 'landscape 100' or 'portrait 75' to a script:

Set Variable[ $param ; Get(ScriptParameter) ]
If[ $param = "landscape 100" ]
 . Print Setup ( ... )
Else If[ $param = "portrait 75" ]
 . Print Setup ( ... )
etc.

There's no great advantage over using individual scripts -- might be just as well to create a dozen print setup scripts, even if they're just a single line. Throw them in a folder, use a really obvious naming scheme and don't even worry about parameters.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.