11 Replies Latest reply on Feb 23, 2009 3:40 PM by jfb00

    RichTextEditor question

    jfb00 Level 3
      Hi All,
      I'm using RichTextEditor comp and I would like to match the text inside this component with a block of my document body. ( For this I'm using alivePDF)
      How can I setup a new page delimiter?
      If user type text more than an specific size it should roll the extra text to a new block.
      Is this possible? Any ideas?
      I can capture the change event of this comp but don't see anything about my challenge.
      Thanks in advance.

      JFB

        • 1. Re: RichTextEditor question
          jfb00 Level 3
          Hi All,
          Nobody can help with this challenge?
          So far i got the property to get the size of my text with RichTextEditor.measureText("This is a test").width.
          Does anyone know what is the equivalent of a width of a letter size paper in pdf?
          Any ideas.. help...
          Thanks

          JFB
          • 2. Re: RichTextEditor question
            Brent Lamborn Level 2
            Can you somehow determine how many characters in your RTE will make a single PDF page, then count the chars?

            Also remember the RTE has a textArea within it. You might be able to use the .textArea property of your RTE to get some information about your text such as:

            textArea.width
            textArea.height
            textArea.htmlText

            Maybe some of that will help.
            • 3. Re: RichTextEditor question
              jfb00 Level 3
              Thank for you reply.
              I'm doing some test but it's hard because each character have a different width.
              I will keep trying.
              Thanks

              JFB
              • 4. Re: RichTextEditor question
                Brent Lamborn Level 2
                II'm not at all familiar with alivePDF, but it almost sounds like you are going to need a method that gets called when the text changes, that creates a PDF using the alivePDF library, and measures everthing to see if it fits on one page. Maybe something from this class http://alivepdf.bytearray.org/alivepdf-asdoc/ using the Size property or something.

                Maybe you could call that method only when the text changes in the RTE, and only if it exceeds a certain length that gets close to what constitues a single PDF page. Something along those lines.
                • 5. Re: RichTextEditor question
                  jfb00 Level 3
                  Thanks Brent!
                  In AlivePDF I can only set a block with addMultiCell(width,height,Text) but the problem is if I have a lot text it will fit all in that block creating an issue putting one line on top of another one.
                  Maybe somebody else have more experience in alivePDF can help me with that.
                  That's why I have to calculate all before so I can figure out how many pages in alivePDF I need.
                  In my RTE I want to show a line to separate a new page. any idea how to do this?
                  I will keep trying with your suggestions.
                  Rgds

                  JFB
                  • 6. RichTextEditor question
                    Brent Lamborn Level 2
                    Once you know where the pagebreak needs to go, I'm guessing you could just add an html horizontal rule <hr> to the RichTextEditor's textArea.htmlText property, which would render a horizontal line where the pagebreak would occur. The hard part might be trying to figure out where to place it. The RTE is pretty well known to bloat the HTML with unnecessary tags, etc so placing it in that propery may prove to be tough. Or it could be real simple - you'd know after trying it once.

                    The reason this topic interests me is because I am doing something similar in our application. We have RTE that we are using to generate PDF's. What we did is not use the RTE for pagebreaks, and instead I basically have a VBox that the user can drag various elements onto, and have them appear on their page (one of the "elements" being a pagebreak). This gives them control over where the page break occurs - which is a little different than what you are doing. Anyway...
                    • 7. Re: RichTextEditor question
                      jfb00 Level 3
                      We can probably help each other Brent :)
                      My goal is the same, create a PDF file.
                      PDF file need to have an specific format so just for the Body center box I'm using RTE.
                      AlivePDF looks like very simple and easy to use but I need maybe help from an expert in this. I have worked the simple things and I can share the info if you like.
                      If you send me an email I can show you my link.
                      Rgds

                      JFB
                      • 8. Re: RichTextEditor question
                        jfb00 Level 3
                        What is the size of the VBox compare with the PDF file?
                        How do you handle that? maybe will give me an idea in how to do this.
                        Thanks

                        JFB
                        • 9. Re: RichTextEditor question
                          Brent Lamborn Level 2
                          My email is brent[at]brentlamborn.com . It's be cool to check out your app.

                          Lucky for me, all of our PDF creation has been outsourced through these guys: http://miles33.com/oasys.html (at a pretty penny I might add). We basically pass XML to their software running on a Sun box, and they hand us back a PDF which really rocks - it's fast accurate and easy. So I don't know much about the PDF stuff.

                          Anything with Flex I'd be glad to share ideas. It's really tough to find answers to Flex questions. Looking forward to your link.
                          • 10. RichTextEditor question
                            Hi

                            I've got exactly the same problem as you.
                            Have you already solved the problem to show a line to separate a new page in the RTE?
                            It would be nice if you could tell me your solution.

                            Chris
                            • 11. Re: RichTextEditor question
                              jfb00 Level 3
                              Hi Chris,
                              I'm still trying to fix this, I'm working in a different project but I will be back to this later. Let me know if you find somehting?
                              Thanks

                              Johnny