Jump to content
Sign in to follow this  
BobWeaver

Single record Multi-page Printing

Recommended Posts

When you have a multi-page layout for one record, the biggest problem that you will likely encounter is having the page break part way through a line of text, leaving a thin slice at the bottom of one page, and thin slice at the top of the next page. This is because FileMaker does NOT check to see if there is sufficient room on the page to print the next line. So, it could get cut off anywhere.

The things that you need to do to prevent this are not immediately obvious. So, I will try to explain them here.

Suppose that you want to create a print layout for a business letter which could be several pages long. For this discussion, we will assume that the body text of the letter is in a field called "BodyText," and it is the only field that actually crosses page boundaries. All other parts either appear completely on the first page or last page. This is the simplest case, but it can cover a lot of situations. And the technique used here can be extended to handle multiple fields crossing pages.

This is the theory behind what is happening when a field is set to slide/shrink. When the field shrinks, it always shrinks in increments of the the field's line spacing. If you make the size of the body part of the layout an exact multiple of the field's line spacing, then the page will always break in the same position relative to a line of text in that field. With the body size set up like this, you can then adjust the position of the field up or down so that the break occurs exactly between lines of text. When it's set properly, you will see in layout mode, the page breaks always appearing one or two pixels below the text baseline to allow for the descenders on the letters like g,j,p,q and y.

One thing that I highly recommend is to manually set all of the page margins to zero. This option is in the Layout Setup dialog. This will make it easier to adapt the layout to different printers. You just have to make sure that the items you place on the layout are positioned within the printable area of any printer that you expect to use.

Now, how to set the body size. The body size is whatever is left when you subtract the header and footer from the total page size. The easiest way to set things up is to have both a title header, and a regular header. You can also have a footer and/or a title footer if you want.

Set the header to whatever size you want. Stretch the body part to the maximum length that you want it to be; let's say five pages. Place the BodyText field in the body part tight against the top of the body part, and size it to fill all the pages of the body part. It's okay for the BodyText field to shrink, but it cannot be allowed to slide. So, it must either be tight up against the top of the body part, or tight up against some other object on the layout (on the first page of the body) that is NOT set to shrink/slide. This is extremely important! You can, however, leave some space at the bottom of the last page of the body part, if you want. Set the BodyText field to Slide/shrink up (based on all above objects) and reduce enclosing part.

Add your title header part (and footer and title footer if have them). Size them as necessary. Later, you will have to adjust both the title header and header a bit.

Put enough sample text in the BodyText field to fill the maximum number of pages on the layout, using a mix of upper case characters and characters with descenders. Then, do a test printout. The last line at the bottom of each page will likely be sliced off part way through the line. To fix this, there are two adjustments that you need to make. Adjusting the title header will affect where the text breaks at the bottom of the first page. If it breaks correctly, then the title header is okay. If not, make it a bit bigger or smaller, a pixel at a time, and do another test print. Keep at it until the text breaks properly between the first and second page. Make sure that the descenders are not shaved off.

The next adjustment controls how the text breaks on subsequent pages. That is done by adjusting the regular header. Adjust the size of the header and do test prints until the text breaks properly between pages 2 and 3 of the printout. Then, as a final adjustment, tweak the header size, as necessary, to ensure that the text breaks properly between the second last and last page. Once this is done, all pages will break properly no matter how much text you have in the BodyText field.

You can save some paper by checking your adjustments in preview mode first, and then printing only when it looks like everything is set correctly.

Once you are at this stage, you can add summary parts to the layout. The sizes of trailing summaries don't matter since they will always appear on the last page and won't affect page breaks. However, leading summaries must be sized as an exact multiple of the line spacing of the BodyText field. You can check this by setting up a sample record that will have a leading summary and doing a test print. Adjust the summary size until the text breaks properly between the second last and last pages using the same method as the header size adjustment described above.

Because everything depends on the line spacing of the BodyText field, it is important that it always remain constant. The user should not be allowed to change the font, font size, or style of the text entered into the BodyText field, or anything else that would affect the line spacing. Therefore, it may be wise to make the BodyText field a calculated field, so that any formatting the user enters will be stripped off. On the other hand, changing margins and tabs won't have any detrimental effect on the output.

On the last page under the BodyText field, you can place any additional fields that you want (such as the closing part of the letter), and set them to slide/shrink up and reduce enclosing part.

If you want to have more than one object in the body part that could possibly cross pages, make sure that they all have the same line spacing, whether they are fields or text.

If you want to include graphic objects in the body part, ensure that their height is an exact multiple of the shrinking fields' line spacing. If the graphic is in a position where it must slide, then you must also format it to "scale to fit" in the Graphic Format dialog. If you don't, the graphic's container will shrink a variable amount to fit the graphic, and the precise page breaks will go out the window. There is no guarantee that graphic will not get cut across a page break. So, if you must have them, try to design your layout so that they will be on the first page if possible. I really haven't tried to set up anything like this with graphic objects. So, you are on your own.

Good luck, and happy printing!

[ November 06, 2001: Message edited by: BobWeaver ]

Share this post


Link to post
Share on other sites

Thanks! I have been looking for a solution for this for a long time.

Course it'd be better if there was a filemaker solution for it, since this will break it the font or the size of even one line is changed. Or if you have to add something to a header or footer. Is there really no solution for this even in 5.5. I am still in 4.

Share this post


Link to post
Share on other sites

A very nice description on dealing with multi-page single record layouts, Bob.

The only thing I suggest is, instead of zeroing out the page margins, I suggest using ".5" inch margins all around. Testing printers of all kinds, from very low end inkjet printers to high end laser printers and even online copiers such as the Xerox DOCUTECH, the half inch margin works with everything I've tested and it will look the same on virtually every printer. Some printers use some strange printer fonts that do some strange things, but these are not usually mainstream printers.

Most Inkjet printers have anywhere from 3/8 to 1/2 inch non-printable area at the bottom of the page. If a print image is set to print in this area, it is either cut off or slides to a new page.

As long as everything is inside the half inch margins, this will make it much easier to ensure that the page will print on whatever printer is used.

[ November 30, 2001: Message edited by: dykstrl ]

Share this post


Link to post
Share on other sites

Zeroing the page margins is just my personal preference. I just like to see the whole page including the non-printable part when I'm setting up a layout. As you say, keeping everything a half inch from the edge will give you a layout that should safely print on any printer.

BTW, here's something I didn't mention in my original post. You may want to set the line spacing to custom, using pixel units rather than lines. Although I haven't encountered any specific problems with standard line spacing so far, I can imagine that there may be problems with some fonts that have a fractional line height.

[ December 01, 2001: Message edited by: BobWeaver ]

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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