You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Ritwik Kumar <ri...@kuliza.com> on 2008/01/02 13:19:15 UTC

To get Text With format..

Hello,

 

            Say a Textbox has some text in one format and some texts in
other (A textbox having more than one RichTextRun)

            And we need to extract all the Text in their original format and
add it to another slide..

 

            What is the simplest method to achieve this ??

 


Re: To Convert Back to PPT from XML

Posted by Nick Burch <ni...@torchbox.com>.
On Wed, 9 Jan 2008, Ritwik Kumar wrote:
> Presently in HSLF we have a Class PPTXMLDump which converts the
> Presentation to XML... well this is very handy when you need to store
> the Data of PPTs in an organized manner.

It was more designed for developer use than end users, as it is very
linked to the underlying structure, but if it works for you... :)

> But I think the functionality of the above class can more widely be used
> if we also have a method to convert back PPT from the generated XML
> file.

I don't think we have all the data we might need though. Since it was
developed with hslf hacking in mind, we don't bother to write everything
out, only the bits that are likely to matter when figuring out how the
file format works. So, it'd almost certainly be a lot of work to get it
into a state where it wrote everything out, then you'd need to read it all
back in and re-create all the records...

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


To Convert Back to PPT from XML

Posted by Ritwik Kumar <ri...@kuliza.com>.
Hello ,

	Presently in HSLF we have a Class PPTXMLDump which converts the
Presentation to XML... well this is very handy when you need to store the
Data of PPTs in an organized manner.

	But I think the functionality of the above class can more widely be
used if we also have a method to convert back PPT from the generated XML
file.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: To get Text With format..

Posted by Nick Burch <ni...@torchbox.com>.
On Wed, 2 Jan 2008, Nick Burch wrote:
> Letting you insert new richtextruns into an existing set would be fairly
> tricky. However, my initial hunch is that adding them onto the end
> wouldn't be too bad.

I've gone ahead and added this in svn. On a TextRun, you can now call
appendText(String), which will add your new text on as another
RichTextRun.

If you want to copy RichTextRuns from one TextRun to another, add the
text, then copy the stylings from the old RTR onto the new one

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: To get Text With format..

Posted by Nick Burch <ni...@torchbox.com>.
On Wed, 2 Jan 2008, Ritwik Kumar wrote:
> Say a Textbox has some text in one format and some texts in other (A 
> textbox having more than one RichTextRun)
>
> And we need to extract all the Text in their original format and add it 
> to another slide..

I don't believe this is currently supported

Letting you insert new richtextruns into an existing set would be fairly 
tricky. However, my initial hunch is that adding them onto the end 
wouldn't be too bad. The internal steps would be:
* expand out the raw text to hold the extra string
* add another entry onto the paragraph styles list and character styles
    list of the textrun's associated StyleTextPropAtom
* attach the TextPropCollection for paragraph and character styles from
    the richtextrun onto the StyleTextPropAtom

Yegor - do you think I've missed any steps? If not, shall we add it in?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org