Jump to content

Save as individual PDFs (script)

Recommended Posts

  • Newbies

I'm a little embarrassed by this question because it should be simple. I'm hoping someone can help me learn to save records as a PDF (448 records, 171 unique names and I want 171 individual pdfs.  I've gone through tutorials but I can't get past the first page of 171.  Ughhh).  I 'm like most people and working from home and hoping to save someone else a lot of work by printing the whole PDF (171 pages) and needing to scan each page.


The PDF is correct for the first record and that's it.  The script keeps running but no other PDFs are created.

Many thanks to anyone who responds with assistance!


Here's my script:

1. go to layout...

2. show all records

3. sort records

4. enter preview

5. set variable [$path; value:"filewin:/C:/users/tom/desktop/(name of folder)"&(database name and field -unique name)

6. Loop

7. save records as PDF [Restore; with dialog:off;"$path",records being browsed;create directories:off]

8. Go to Record/Request/Page [Next, Exit after last:On]

9. End Loop

Link to post
Share on other sites

The logic that you need to apply here is:

  1. Establish a found set (perform a find or show all records);
  2. Sort the records by the break field;
  3. Loop:
  4. Open a new window;
  5. Omit all records except the first group;
  6. Save the current found set as PDF;
  7. Close the current window;
  8. Omit the records of the first group;
  9. Exit loop if the found set is empty;
  10. End Loop

You will need to define a summary field that counts the records, so that you can use the GetSummary() function to count the records in the first group. Or use the Constrain Found Set script step for steps #5 and #8.

If you can be sure that each group will fit on a single page PDF, it can be a bit simpler. There is an option to limit the number of the pages of the PDF. So you can just save the found set in the original window, omit the first group, and so on (provided your layout has a page break after each group).


Edited by comment
Link to post
Share on other sites
  • Newbies

Thanks much for your time and help.  I'll try to work through it.  The layout is all set with a break field and the pages look perfect in preview mode.  171 using unique name field as break and all records are found.  I haven't tried what you suggest but will try to model it today.

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
  • Create New...

Important Information

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