10 Replies Latest reply on Apr 25, 2014 1:53 AM by AlastairMcInnes

    Flowing text round image

    AlastairMcInnes

      Title

      Flowing text round image

      Post

           I am responsible for maintaining a database for a book publisher. I've been asked to create a layout for a single page information sheet which we'll use to summarise a book prior to publication.

           They want the cover image of the book shown in the top right of the page, with a small block of text underneath containing such things as the price, ISBN, dimensions, publishing date. This block is to be the same width as the image above it (about 4cm) and will always be more or less the same height as we're only going to use this layout for our own publications so we'll always have all the information it requires.

           What they want in the rest of the page (starting level with the top of the cover image) are the title, subtitle, author(s), summary, key features (in a bulleted list), description and author biography. Once below the level of the info-block under the cover image, they want the rest of the text to be the full width of the page and this is what is causing me problems.

           I tried using a merge field for the main text with a 5cm right indent for the first few paragraphs. This worked well but means we need to try to make sure that the short summary, title, subtitle, key features always take up much the same amount of vertical space - too much and there will be a big gap under the info-block; too little and the description will overwrite the info-block.

           Then I thought about using a web-viewer and creating a load of HTML to display the image right-aligned with the text flowing around it.

           This actually works OK in browse mode, except that I've no idea how to include the info-block under the image. That, though, is an HTML question, not a Filemaker one. What IS a filemaker problem, though, is that, even though I've set the Web-viewer control to not allow any interaction, there is still a vertical scroll bar in the control in browse mode (though you can't actually scroll with it). Also, when I switch to preview, the text is Squashed up - I mean the actual letters are shrunk so that the whole field fits within the web-viewer.

           Now, we're obviously going to have to make sure that the description's and so on are short enough to fit on a single page, but I'd really prefer the control just to lose any extra rather than distort what's there.

           From work on other, similar layouts, I know that the web-viewer control won't print the images anything like well enough, so my plan was to have an image control on the same layout with the web-viewer behind the image. This doesn't work in browse as the webviewer just comes to the front anyway, but it DOES seem to work in preview so I'm happy enough about that.

           Does anyone have any ideas about how this layout might be made to work? I've attached a jpg of a Word document showing roughly what we're after.

           Thanks,

           Alastair

      AI.jpg

        • 1. Re: Flowing text round image
          AlastairMcInnes

               I've attached a jpg of the layout made up with HTML as it appears when previewed or turned into a pdf. As you can see, the image is squashed up as well as the text, which is also less than ideal.

               Thanks again,

               Alastair

          • 2. Re: Flowing text round image
            FranGodfrey

                 If the elements - title, author, price, pages, description, author information - of this information page are in separate fields in your file then this should not be a problem, surely, as the fields can be placed on the layout as you require them to be printed? I have done something similar to this in the past.

                 Or have I misunderstood your situation?

            • 3. Re: Flowing text round image
              AlastairMcInnes

                   Hi, and thanks for the reply.

                   The elements are all in separate fields, yes. My problem is that we don't know how long any of them are so there's no way of knowing in advance which fields are to go where - some of them have to fit between the left margin and the image, whilst the rest have only to fit between the margins of the page.

                   Alastair

              • 4. Re: Flowing text round image
                mgores

                     While maybe not the most elegant idea, I would think you could concatenate all the text that goes around the image into one field.  Then have two separate display fields, one for the left of the image down to the bottom of the small block of text and the other for the full page width under that block.  Figure out how many possible characters are possible in the upper field and use a Left text; (number OfValues) on that concatenated field to form the two display fields.

                • 5. Re: Flowing text round image
                  mgores

                       I meant Left (text; numberOfCharacters)

                  • 6. Re: Flowing text round image
                    philmodjunk

                         While quite cumbersome, there's a scripted method that can determine exactly how many characters will "fit" in a given field. This could be used to "split" the data between the two text fields that Mark Gores describes. But you'll need to run the script again each time you edit data in one of the fields that supplies text to these two fields.

                         an alternative method might be to export your data as a merge file for use in MS Word where such a "text wrap" capability is a built in feature.

                    • 7. Re: Flowing text round image
                      AlastairMcInnes

                           Thanks, guys..

                           I thought about something like that but the problem is knowing how many characters will fit because of the proportionally-spaced font, though I did wonder about just going with an average.

                           Phil, are you saying there's a way of measuring the amount of text that can fit at run time and doing the split then?

                           That said, I am coming to the conclusion that Filemaker just isn't the tool for this and that an export to Excel and a mail merge in Word might be the easiest way to go.

                      • 8. Re: Flowing text round image
                        mgores

                        smiley

                             I am an engineer by trade, so while I appreciate the simple, elegant solutions, they are not always the first things I think of.

                        • 9. Re: Flowing text round image
                          philmodjunk
                               

                                    Phil, are you saying there's a way of measuring the amount of text that can fit at run time and doing the split then?

                               Yes, it's possible, but not easy. A mail merge may be a much simpler option.

                               The trick exploits the fact that GetLayoutObjectAttribute will return a different value for a field set to slide up if you use a script to check the height of that field while in preview mode. This requires setting up a special layout where you have a field--often a calculation field--that has the same text styles as the field from which you want to print, the same exact width, but which is tall enough to show one more row of text than the original field.

                               The script then loops to put a varying number of characters in this "test field" (which can be by varying a value used in a calculation field's left function), enters preview mode and checks to see if the field "slid up" to be the same size as the original field or less. If so, the text "fits" in the field. If not, it does not.

                               This is one of the ugliest Kludges that I know of in FileMaker, but I have been able to use it successfully  in cases where I needed it.

                          • 10. Re: Flowing text round image
                            AlastairMcInnes

                                 Mark, I, too, like simple solutions but if at all possible, I like to hide the underlying mechanisms from the users - if I provide a layout for their info sheets then I want them to be able to use it without needing to worry about which fields have got how much text in them and so on. The only limitation is that it should fit on a page, which seems basic enough to me. Making it all happen is my problem, as a software developer.

                                 Phil - sounds very complicated, though I think I can see how you'd make that work. I'm not sure I'm prepared to go quite that far, though. In this case, I think a nice scripted export to a mail merge is going to be the most elegant solution.

                                 Thanks, everyone, for the input - much appreciated.