Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: modify odt file with perl OpenOffice::OODoc will corrupt the file

by kcott (Archbishop)
on Dec 17, 2015 at 08:03 UTC ( [id://1150594]=note: print w/replies, xml ) Need Help??


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
    I will submit a bug report in Active bugs for OpenOffice-OODoc, Thanks for your advice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1150594]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-25 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found