Jump to content
xochi

Split PDF into separate pages by SubSummary while in Preview Mode

Recommended Posts

I have a multi-page printout which is split with a page break for each sub summary part.  

 

Imagine for example a room inventory list where each room gets its own page.  I'd like to save these as separate PDF files, so each room has it's own file, e.g.

Room1Inventory.pdf

Room2Inventory.pdf

...

 

One way to do this is simply loop through the room numbers, and for each room do a Find / Sort / Preview Mode / Save as PDF.

 

But I'm curious if this can be done a different way - what if I already am in Preview mode with a report showing all rooms (where there's a sub summary page break).


Is there any way at this point to loop through in Preview mode and save each page into it's own PDF file?

 

I can almost get it working like this:

Find Record

Sort

Enter Preview Mode
Loop
  set variable $roomNumber = Rooms::RoomNumber
  set variable $startPage = Get(PageNumber) 
  set variable $endPage = $startPage + 1 
  set variable $file = "Room Number" & $roomNumber
  Save Records as PDF (output file=$file,  options/include specific page: from $startPage to $startPage+1
  go to next page, exit after last
End Loop

 

Two problems:

1. unfortunately, since I'm in Preview mode, Rooms::RoomNumber never changes, it's always showing the value on the first record in the found set, regardless of what page I'm on.

2. if the report is more than one page long for a given room, I need to figure out what $endPage should be.

 

 

 

Share this post


Link to post
Share on other sites

Thanks - it looks like that solution switches between Preview and Browse mode, which may be the only way to do it.

I ended up scripting something somewhat similar:  in Browse mode go record-by-record until I find that the RoomNumber has changed.  Then make a new window, Constrain the found set to that single room number, save as PDF then close the window.   

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.