poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Calimero <calimero.de....@gmail.com>
Subject Re: Bug inserting text in Word file
Date Tue, 02 Dec 2008 15:38:33 GMT

Well,

the thing is that users upload word files and application needs to add some
information at beginning of the document).

Does it means that i don't have any alternative ? In the way i put a form in
word file to fill in it and so on maybe maintain information structure, can
it be done ? and how ?

Thx so much !


Anthony Andrews wrote:
> 
> I am assuming that you have created a file using Word then opened it and
> re-saved it using POI and are wondering why the file sizes are different.
> 
> If that is the case then you should not be surprised because it is quite
> lilely that the structure of the files will be slightly different. The two
> applications whilst creating files that both can read may go about the
> process slightly differently - Word for example may exclude certain
> information because it can make assumptions about issing/excluded
> information when reading that same file. POI cannot because - at least
> until recently - the full details of the file structure were not public
> and outside of Microsoft no one really knows how Word parses the files it
> creates.
> 
> --- On Tue, 12/2/08, Calimero <calimero.de.bcn@gmail.com> wrote:
> From: Calimero <calimero.de.bcn@gmail.com>
> Subject: Re: Bug inserting text in Word file
> To: user@poi.apache.org
> Date: Tuesday, December 2, 2008, 3:27 AM
> 
> Well,
> 
> it can delete cells of table, doesn't open in MSOffice. I noted that
> inserting text number of bytes have changed.
> 
> Any idea ?
> 
> 
> Ulf Dittmer-2 wrote:
>> 
>> What do you mean by "document is altered"? Inserting
>> text is altering the document, isn't it?
>> 
>> Also, you aren't really ignoring the exception, right?
>> 
>> Ulf
>> 
>> --- Calimero <calimero.de.bcn@gmail.com> wrote:
>> 
>>> 
>>> Hi,
>>> 
>>> i try to insert text in Word file like that.
>>> Document is altered when it
>>> contains tables / images or graphics :
>>> 
>>> try {
>>>     HWPFDocument doc = new HWPFDocument(is);        
>>>    
>>>     Range range = doc.getRange();
>>>     range.insertBefore("Hello world");
>>>     doc.write(outputStream);
>>> } catch(Exception e){}
>> 
>> 
>> 
>>       
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/HELP-PLEASE-%3A-Bug-inserting-text-in-Word-file-tp20789913p20790326.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
> 
> 
> 
> 
>       
> 

-- 
View this message in context: http://www.nabble.com/HELP-PLEASE-%3A-Bug-inserting-text-in-Word-file-tp20789913p20794180.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


Mime
View raw message