PyODConverter: getting ERROR! ErrorCodeIOException 2074

374 views
Skip to first unread message

Friendlyguy

unread,
Nov 1, 2009, 2:09:18 PM11/1/09
to JODConverter
Hello all,

I've been using this fantastic PyODConverter tool for converting
various document formats to PDF. Everything has been going well until
today when one particular document wouldn't convert and gave the
error:

ERROR! ErrorCodeIOException 2074

Now I understand this may be nothing to do with PyODConverter but I
thought I'd ask here first, because when I opened the file in
OpenOffice and did Export to pdf it created the pdf without any
problem.

This is on Windows. My versions are
OpenOffice 3.1 Build:9420
PyODConverter v1.0.0

Any advice or suggestions?

best wishes
Brian

Mirko Nasato

unread,
Nov 2, 2009, 7:29:27 AM11/2/09
to jodcon...@googlegroups.com
Hi Brian,

Difficult to say without knowing what that document is, but I've seen
that error occurring with .doc files that are not actually Word
documents but HTML.

Kind regards

Mirko

2009/11/1 Friendlyguy <brian....@gmail.com>:

Friendlyguy

unread,
Nov 2, 2009, 8:05:00 AM11/2/09
to JODConverter
Hi Mirko

many thanks for taking the time to reply. Yes the file was created
originally from HTML and output as RTF. Other RTF files created this
way have converted to PDF fine.

Would it be ok if I sent you the document to take a look at it? It
doesn't appear to be an OpenOffice issue as that program exports it
fine.

many thanks
Brian


On Nov 2, 1:29 pm, Mirko Nasato <mirko.nas...@gmail.com> wrote:
> Hi Brian,
>
> Difficult to say without knowing what that document is, but I've seen
> that error occurring with .doc files that are not actually Word
> documents but HTML.
>
> Kind regards
>
> Mirko
>
> 2009/11/1 Friendlyguy <brian.fen...@gmail.com>:

Mirko Nasato

unread,
Nov 2, 2009, 9:16:48 AM11/2/09
to jodcon...@googlegroups.com
Hi Brian,

2009/11/2 Friendlyguy <brian....@gmail.com>:


>
> Yes the file was created
> originally from HTML and output as RTF.
>

Not exactly what I've seen before, where I had a file named *.doc but
was in fact HTML and not Word.

>
> Would it be ok if I sent you the document to take a look at it? It
> doesn't appear to be an OpenOffice issue as that program exports it
> fine.
>

Yep send me the file and I'll have a look. There are cases where OOo
behaves differently in -headless mode though, so it may still be an
OOo issue.

Kind regards

Mirko

Friendlyguy

unread,
Nov 2, 2009, 10:25:04 AM11/2/09
to JODConverter
Hi Mirko

Sorry, it appears I have misled you - the file was generated by
another developer. It does contain HTML but sends the Word mime-type
in the headers.
So do you think HTML files masquerading as Word documents will never
convert?

If you still want to take a look, I've uploaded the troublesome file
to the Files section of the discussion group. It's called
"536010Acceptance of Final Report.doc".

thanks a lot
Brian


On Nov 2, 3:16 pm, Mirko Nasato <mirko.nas...@gmail.com> wrote:
> Hi Brian,
>
> 2009/11/2 Friendlyguy <brian.fen...@gmail.com>:

Mirko Nasato

unread,
Nov 2, 2009, 10:57:34 AM11/2/09
to jodcon...@googlegroups.com
Hi Brian,

Uhm, the same error occurs even after renaming the .doc to .html, so
the problem is not the wrong extension as I initially thought.

Looks like HTML documents need a different FilterName when exporting
to PDF. In fact if you replace "writer_pdf_Export" with
"writer_web_pdf_Export" in DocumentConverter.py it will work. (Other
formats will no longer work though - I'll release a proper fix later.)

Kind regards

Mirko

2009/11/2 Friendlyguy <brian....@gmail.com>:

Friendlyguy

unread,
Nov 2, 2009, 11:14:24 AM11/2/09
to JODConverter
Hi Mirko

Thanks so much for solving that. That would be fantastic if you could
release the proper fix.
I tried replacing "writer_pdf_Export" with "writer_web_pdf_Export" in
DocumentConverter.py, but it still wouldn't convert (no matter what
extension I put on the document).

all the best
Brian

On Nov 2, 4:57 pm, Mirko Nasato <mirko.nas...@gmail.com> wrote:
> Hi Brian,
>
> Uhm, the same error occurs even after renaming the .doc to .html, so
> the problem is not the wrong extension as I initially thought.
>
> Looks like HTML documents need a different FilterName when exporting
> to PDF. In fact if you replace "writer_pdf_Export" with
> "writer_web_pdf_Export" in DocumentConverter.py it will work. (Other
> formats will no longer work though - I'll release a proper fix later.)
>
> Kind regards
>
> Mirko
>
> 2009/11/2 Friendlyguy <brian.fen...@gmail.com>:

Mirko Nasato

unread,
Nov 2, 2009, 2:15:54 PM11/2/09
to jodcon...@googlegroups.com
Hi Brian,

2009/11/2 Friendlyguy <brian....@gmail.com>:
>


> Thanks so much for solving that. That would be fantastic if you could
> release the proper fix.
> I tried replacing "writer_pdf_Export" with "writer_web_pdf_Export" in
> DocumentConverter.py, but it still wouldn't convert (no matter what
> extension I put on the document).
>

Well then we need to understand why it doesn't work on your machine,
'cause the "proper" fix won't make any difference in that respect.

Kind regards

Mirko

Friendlyguy

unread,
Nov 2, 2009, 2:44:01 PM11/2/09
to JODConverter
Hi Mirko,

Yes you're right of course. Do you have any suggestions to help me?
Here is what I get when I try the conversion with your suggested
change:

C:\temp\pdf>"c:\Program Files\OpenOffice.org 3\program\python.exe" c:
\aolserver\
bin\DocumentConverter.py 536010Acceptance_of_Final_Report.doc
brian.pdf
Traceback (most recent call last):
File "c:\aolserver\bin\DocumentConverter.py", line 144, in <module>
converter.convert(argv[1], argv[2])
File "c:\aolserver\bin\DocumentConverter.py", line 83, in convert
filterName = self._filterName(document, outputExt)
File "c:\aolserver\bin\DocumentConverter.py", line 91, in
_filterName
family = self._detectFamily(document)
File "c:\aolserver\bin\DocumentConverter.py", line 102, in
_detectFamily
if document.supportsService
("com.sun.star.text.GenericTextDocument"):
AttributeError: 'NoneType' object has no attribute 'supportsService'

many thanks again for your time,
Brian

On Nov 2, 8:15 pm, Mirko Nasato <mirko.nas...@gmail.com> wrote:
> Hi Brian,
>
> 2009/11/2 Friendlyguy <brian.fen...@gmail.com>:
>

Mirko Nasato

unread,
Nov 2, 2009, 3:09:41 PM11/2/09
to jodcon...@googlegroups.com
That's strange, it's saying that 'document' is None but that has
nothing to do with the change we made. Are you sure all you did was to
replace "writer_pdf_Export" with "writer_web_pdf_Export"?

Kind regards

Mirko

2009/11/2 Friendlyguy <brian....@gmail.com>:

Friendlyguy

unread,
Nov 2, 2009, 3:31:05 PM11/2/09
to JODConverter
Mirko,
please accept my apologies for wasting your time. I just double-
checked everything and you are correct - the "writer_web_pdf_Export"
change does, in fact, successfully convert the file to PDF. I had
accidentally blanked the file when transferring it across, and hadn't
noticed it was empty until I just now re-opened it in a text editor.

many thanks for the solution
Brian



On Nov 2, 9:09 pm, Mirko Nasato <mirko.nas...@gmail.com> wrote:
> That's strange, it's saying that 'document' is None but that has
> nothing to do with the change we made. Are you sure all you did was to
> replace "writer_pdf_Export" with "writer_web_pdf_Export"?
>
> Kind regards
>
> Mirko
>
> 2009/11/2 Friendlyguy <brian.fen...@gmail.com>:

Mirko Nasato

unread,
Nov 2, 2009, 4:15:54 PM11/2/09
to jodcon...@googlegroups.com
Good to hear that it's working now.

Kind regards

Mirko

2009/11/2 Friendlyguy <brian....@gmail.com>:

Friendlyguy

unread,
Nov 2, 2009, 4:40:53 PM11/2/09
to JODConverter
Hi Mirko,

Do you have a fix for the issue that other formats no longer work when
I replace "writer_pdf_Export" with "writer_web_pdf_Export"?
Is that hard to fix?

thanks
Brian
PS I also have a question about CSV files, but I'll open a new
discussion about that.


On Nov 2, 10:15 pm, Mirko Nasato <mirko.nas...@gmail.com> wrote:
> Good to hear that it's working now.
>
> Kind regards
>
> Mirko
>
> 2009/11/2 Friendlyguy <brian.fen...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages