This content has been marked as final. Show 11 replies
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...
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:
Maybe some of that will help.
Thank for you reply.
I'm doing some test but it's hard because each character have a different width.
I will keep trying.
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.
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.
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...
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.
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.
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.
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.
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?