in reply to modify odt file with perl OpenOffice::OODoc will corrupt the file
G'day ieeedino,
Welcome to the Monastery.
I do use the OpenOffice application a lot but have never used OpenOffice::OODoc (so I just installed it).
My system: Apache OpenOffice 4.1.1; OpenOffice::OODoc 2.125; Perl 5.22.0; Mac OS X 10.10.3
To test, I fired up the OpenOffice application, started a new text document, typed "Just a test.", saved as pm_1150577_odt_corruption.odt, and closed. I opened and closed this a couple of times: no problems; none were expected.
I then ran this code:
#!/usr/bin/env perl use strict; use warnings; use autodie qw{:all}; use OpenOffice::OODoc; my $document = odfDocument(file => 'pm_1150577_odt_corruption.odt');
Again, via the application, I opened and closed the file a couple of times. All good.
I then added this line (to the end of the code shown above) and ran the script again:
$document->save;
No errors or warnings were emitted on the command line; however, when I then attempted to open the file from the application, I got a popup with a message which starts:
The file 'pm_1150577_odt_corruption.odt' is corrupt and therefore cannot be opened. ...
I can't see anything in "Active bugs for OpenOffice-OODoc" relating to file corruption. I suggest you raise a bug report.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: modify odt file with perl OpenOffice::OODoc will corrupt the file
by ieeedino (Novice) on Dec 17, 2015 at 09:11 UTC |