Save Records as PDF

Looking for advice on ensuring “Save Records as PDF” produces an 8.5 x 11 output.

Setting page sizes and printing parameters in FileMaker is very frustrating. For example, the Claris documentation for the “Print Setup” script step states:

“With dialog specifies whether to display the Print Setup dialog box when the script step is performed. If you set With dialog to Off, the output from this script step is sent to the last specified printer and not the printer specified in this script step.”

Not sure I understand the logic in that.

Also, the documentation is unclear whether setting the page size in File > Print Setup applies to an individual layout or the entire file.

I’m trying to print a particular layout to a pdf with intermittent failures. I need an 8.5 x 11 page, but FMP occasionally produces a 2 x 2 output.

If I send the output to the printer, and then create the pdf, everything works fine, because of the “last specified printer” info above.

However, if I exclude the “Print” step and just use “Save Records as PDF”, I get a 2x 2 output.

I guess the solution is to create two subscripts to set the page size and print, but this seems like kludging a fix for something Claris should have fixed decades ago.

Well, save as PDF doesn't use the print engine, but it takes the paper setting from it.

That is why we have functions in MBS FileMaker Plugin to automate page setup dialog and setup the paper size by script.

I created a sub-script that runs the Print Setup script step. That seemed to fix my problem, but I don’t understand why.

It sounds like you've found your solution. Just to emphasize, I always use a Print Setup step prior to Save Records as PDF step. This ensures that the PDF page is defined. This can be with dialog [Off] so long as the proper paper size is defined in the script step. It needn't be a subscript – it can just be a step above the PDF step. One would also normally set a $path variable or plan for some other way to define the path to which the PDF saved.

@daleallyn That’s exactly what I was doing, and resulted in a 2 x 2 inch output.

That’s interesting, @steverichter. I do a LOT of PDFs in my solutions (lab reports and such) and have never experienced this using the method I mentioned. I’m away from my office, so can’t easily post an example script to compare. I recognize that you’ve solved your issue, but it seems that something is a bit different causing the quirk.

If I have time tomorrow (it’s 7:30 PM here) I’ll post an example for the sake of conversation. :slight_smile:

1 Like

@tonywhitelive posted a “best practices” print tutorial that suggested the sub-scripts.

I saw that. I do use subscripts when they contribute to DRY development practices, but there are times when I prefer to avoid them for other reasons. E.g. sometimes it adds complexity with debugging in a rapid development environment.

Regardless of preference/practice, it seems odd that just changing to a subscript resolves the page/print setup details. If it were mine I’d be curious about what’s happening.

Agree it’s a curious situation. When I have time, I’ll investigate further. I appreciate your comments.

Thanks for the mention. Here is the link

1 Like