You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by katya <ka...@dreamix.eu> on 2010/11/10 17:43:06 UTC

Change parts of text in Word files

Hi, 

I'm starting a new project and I need a library that reads and writes Word
files, so I started researching Apache POI. I have to upload the file on a
server, replace certain parts of it and then return it to the user with the
replaced text and preserved formatting. 

I tried to get the xml representation of the document with
document.getDocument().xmlText(), then replace what I need and finally
create a new file from this xml. But the formatting is not exactly the same
- the picture is gone, there is a problem with the numbering, the hyperlinks
are gone. 

Is there a simple way to just replace text in the same file? I don't need
another file.
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/Change-parts-of-text-in-Word-files-tp3258984p3258984.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: Change parts of text in Word files

Posted by David Fisher <df...@jmlafferty.com>.
Aspose is a commercial / non-open source product. Support costs money. Well over $1,000.

http://www.aspose.com/corporate/purchase/end-user-license-agreement.aspx

Apache POI is open source, we are volunteers, and we are here to help assuming that you ask questions in a clear way and willingly wait some time for a response. That help may be guidance to self help. Some people are ready for this and others are not.

On Nov 10, 2010, at 1:53 PM, Trollchik wrote:

> 
> Hi, better to use Aspose! i tried to use POI and there a lot of things which
> are not implemented yet! So i had a bif gemoroi with this POI libraray!!!!
> -- 
> View this message in context: http://apache-poi.1045710.n5.nabble.com/Change-parts-of-text-in-Word-files-tp3258984p3259512.html
> Sent from the POI - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 


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


Re: Change parts of text in Word files

Posted by Trollchik <an...@mail.ru>.
Hi, better to use Aspose! i tried to use POI and there a lot of things which
are not implemented yet! So i had a bif gemoroi with this POI libraray!!!!
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/Change-parts-of-text-in-Word-files-tp3258984p3259512.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: Change parts of text in Word files

Posted by Nick Burch <ni...@alfresco.com>.
On Wed, 10 Nov 2010, katya wrote:
> I tried to get the xml representation of the document with 
> document.getDocument().xmlText(), then replace what I need and finally 
> create a new file from this xml. But the formatting is not exactly the 
> same - the picture is gone, there is a problem with the numbering, the 
> hyperlinks are gone.

You can't work on it at that low a level without doing loads more work to 
maintain all the relationships. You'll probably want to just use the XWPF 
usermodel

Nick

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