February 22, 20178 yr 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.
February 22, 20178 yr IMHO, the procedure to find out which room occupies which pages will be more complex than producing a separate report for each room - see:http://fmforums.com/topic/30553-index-page-or-table-of-contents/#comment-137919
February 22, 20178 yr Author 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.
Create an account or sign in to comment