11 Replies Latest reply on Oct 14, 2007 8:41 AM by kglad

    text boxes to print

    Level 7
      I have a screen with about 10 scrolling textboxes on it, which allows people
      to type in bits of text.

      I then want to print what they have typed as one long document, so no longer
      as the 10 boxes but more as paragraphs of text.

      I just can't quite understand what to do. I have looked at the printjob
      class, but can't quite understand how to transfer all of this data, which
      could be several pages, into one printjob

      Could any one help, or refer me to some tutorial?

      Thanks


        • 1. Re: text boxes to print
          kglad Adobe Community Professional & MVP
          create a dynamic movieclip and create a dynamic textfield as a child of the movieclip. assign the text property of that textfield to be the text properties of you 10 textfields. add that movieclip to the printjob.
          • 2. Re: text boxes to print
            Level 7
            Thanks for the reply, but because it is text entry, I do not know how much
            text they will write, and therefore how big the textfield needs to be, and
            also how to determine how many pages will need to be printed.

            Could you give me any more pointers please?

            Thanks

            "kglad" <webforumsuser@macromedia.com> wrote in message
            news:fel92t$i8g$1@forums.macromedia.com...
            > create a dynamic movieclip and create a dynamic textfield as a child of
            > the
            > movieclip. assign the text property of that textfield to be the text
            > properties of you 10 textfields. add that movieclip to the printjob.
            >


            • 3. Re: text boxes to print
              kglad Adobe Community Professional & MVP
              when you're ready to print:

              1 create your printjob, start it and then access the pageHeigth and pageWidth properties.

              2. create you movieclip and create your dynamic textfield (as a child of the movieclip)

              3. assign your textfield's multiline property to be true, its autoSize property to true and assign its width to be pageWidth.

              4. start assigning the text from the input textfields to your newly created dynamic textfield. as you do this, your dynamic textfield's_height property will increase. if it exceeds pageHeight, you'll need to assign a line break and create a 2nd movieclip and another dynamic textfield. (you are going to be printing more than 1 page of text.) ie, return to step 1 and repeat steps 1 to 4 until all your input text has been assigned these dynamic textfields.

              5. add the created movieclips to your printjob

              6. send the printjob to the printer.

              7. you're done.
              • 4. Re: text boxes to print
                Level 7
                That's great, I'll give it a try, many thanks

                "kglad" <webforumsuser@macromedia.com> wrote in message
                news:felium$l0$1@forums.macromedia.com...
                > when you're ready to print:
                >
                > 1 create your printjob, start it and then access the pageHeigth and
                > pageWidth
                > properties.
                >
                > 2. create you movieclip and create your dynamic textfield (as a child of
                > the
                > movieclip)
                >
                > 3. assign your textfield's multiline property to be true, its autoSize
                > property to true and assign its width to be pageWidth.
                >
                > 4. start assigning the text from the input textfields to your newly
                > created
                > dynamic textfield. as you do this, your dynamic textfield's_height
                > property
                > will increase. if it exceeds pageHeight, you'll need to assign a line
                > break
                > and create a 2nd movieclip and another dynamic textfield. (you are going
                > to be
                > printing more than 1 page of text.) ie, return to step 1 and repeat steps
                > 1 to
                > 4 until all your input text has been assigned these dynamic textfields.
                >
                > 5. add the created movieclips to your printjob
                >
                > 6. send the printjob to the printer.
                >
                > 7. you're done.
                >


                • 5. Re: text boxes to print
                  kglad Adobe Community Professional & MVP
                  you're welcome.
                  • 6. Re: text boxes to print
                    Level 7
                    You gave me some very useful pointers and I'm nearly there!

                    A couple of problems though.

                    How do I add borders around the printed text? It seems that if I offset my
                    text field from the parent movieclip it still prints top left of the page. I
                    got around this by adding a small whit box at (0,0) of the parent movieclip
                    to "trick" it into using my margins. Is this really the correct way?

                    The other problem, if I have a huge block of text, several pages long, how
                    do I go about deciding where the page breaks are, and how do I split the
                    text?

                    Thanks again

                    "kglad" <webforumsuser@macromedia.com> wrote in message
                    news:felmtj$5e0$1@forums.macromedia.com...
                    > you're welcome.


                    • 7. Re: text boxes to print
                      kglad Adobe Community Professional & MVP
                      first, you already have margins that you can calculate by using paperHeight-pageHeight and paperWidth-pageWidth. second, to increase those margins to your exact specification, position the textfield exactly where you want. because textfields have some padding that depends upon your font type and size, you will need to experiment if every millimeter is critical.

                      where to break text, so it's not in the middle of a word and, in fact, it's at the end of a complete line, can be done using the flash string methods.
                      • 8. Re: text boxes to print
                        Level 7
                        Thanks for the reply.

                        From what I understand, paperheight gives the number of pixels and
                        pageheight gives the printable number of pixels on that page, which may vary
                        from printer to printer.

                        I want to be able to add custom borders. So I make my movie clip mPAGE1
                        located at (0,0). If I add a text field then it prints top left of the page,
                        allowing the border that is inherent to the printer. I then move the text
                        field to (50,50) WITHIN the mPAGE1 movieclip, but it still prints top left.
                        What gives?

                        If I add a small box at (0,0) in the mPAGE1 movieclip, then the text is
                        shifted to (50,50)

                        Is this a bug?





                        "kglad" <webforumsuser@macromedia.com> wrote in message
                        news:feqjt6$15g$1@forums.macromedia.com...
                        > first, you already have margins that you can calculate by using
                        > paperHeight-pageHeight and paperWidth-pageWidth. second, to increase
                        > those
                        > margins to your exact specification, position the textfield exactly where
                        > you
                        > want. because textfields have some padding that depends upon your font
                        > type
                        > and size, you will need to experiment if every millimeter is critical.
                        >
                        > where to break text, so it's not in the middle of a word and, in fact,
                        > it's at
                        > the end of a complete line, can be done using the flash string methods.
                        >


                        • 9. Re: text boxes to print
                          kglad Adobe Community Professional & MVP
                          use the printArea object to specify that you want to print that whitespace.
                          • 10. Re: text boxes to print
                            Level 7
                            Ah yes I see, thanks for that

                            "kglad" <webforumsuser@macromedia.com> wrote in message
                            news:fetbml$5bp$1@forums.macromedia.com...
                            > use the printArea object to specify that you want to print that
                            > whitespace.


                            • 11. Re: text boxes to print
                              kglad Adobe Community Professional & MVP
                              you're welcome.