PyODConverter, how to set FilterData options ?

394 views
Skip to first unread message

Séb

unread,
Jan 13, 2010, 10:46:25 AM1/13/10
to JODConverter
Hi,
i want use PyODConverter to convert document into PDF/A-1 document.

I think i muste edit this section :

EXPORT_FILTER_MAP = {
"pdf": {
FAMILY_TEXT: { "FilterName": "writer_pdf_Export" },
FAMILY_WEB: { "FilterName": "writer_web_pdf_Export" },
FAMILY_SPREADSHEET: { "FilterName": "calc_pdf_Export" },
FAMILY_PRESENTATION: { "FilterName": "impress_pdf_Export" },
FAMILY_DRAWING: { "FilterName": "draw_pdf_Export" }
},
[...]

But i don't know how to setup the SelectPdfVersion to 1 for the pdf
export format.

I will try something like that :
EXPORT_FILTER_MAP = {
"pdf": {
FAMILY_TEXT: { "FilterName": "writer_pdf_Export",
"FilterData": { "SelectPdfVersion": "1"} },
FAMILY_WEB: { "FilterName": "writer_web_pdf_Export",
"FilterData": { "SelectPdfVersion": "1"} },
FAMILY_SPREADSHEET: { "FilterName": "calc_pdf_Export",
"FilterData": { "SelectPdfVersion": "1"} },
FAMILY_PRESENTATION: { "FilterName": "impress_pdf_Export",
"FilterData": { "SelectPdfVersion": "1"} },
FAMILY_DRAWING: { "FilterName": "draw_pdf_Export" ,
"FilterData": { "SelectPdfVersion": "1"} }
},
[...]

But it give me that error :
Traceback (most recent call last):
File "DocumentConverter.py", line 224, in <module>
converter.convert(argv[1], argv[2])
File "DocumentConverter.py", line 156, in convert
document.storeToURL(outputUrl, self._toProperties
(storeProperties))
File "DocumentConverter.py", line 207, in _toProperties
prop.Value = dict[key]
File "/usr/lib/python2.6/dist-packages/uno.py", line 326, in
_uno_struct__setattr__
return __builtin__.setattr(self.__dict__["value"],name,value)
uno.RuntimeException: <type 'exceptions.AttributeError'>: 'dict'
object has no attribute 'getTypes', traceback follows
no traceback available

So, i don't know what to do now ....

Thanks for your help !

Mirko Nasato

unread,
Jan 13, 2010, 2:44:50 PM1/13/10
to JODConverter
Looks like a bug in _toProperties() that doesn't support nested dicts.
Will fix it when I have time.

Kind regards

Mirko

Séb

unread,
Jan 14, 2010, 6:33:01 AM1/14/10
to JODConverter
Thanks for your reply,
but, can i use jobconverter instead of PyODConverter to convert file
to PDF/A1 format ?
(using command line)

If the answer is yes, what does i must change into the conf/document-
formats.js to make PDF/A1 default export format ?

Really thanks for your help, i have trie many things that doesn't
work....

Mirko Nasato

unread,
Jan 15, 2010, 11:24:24 AM1/15/10
to JODConverter
Similarly to what you've tried for the Python version, you need to
change e.g.

"TEXT": { "FilterName": "writer_pdf_Export" },

to

"TEXT": {


"FilterName": "writer_pdf_Export",
"FilterData": { "SelectPdfVersion": 1 }
}

(Repeat for other document types.)

Kind regards

Mirko

Séb

unread,
Jan 16, 2010, 3:23:11 AM1/16/10
to JODConverter
Thanks for you reply Mirko Nasato,
i don't know why that doesn't work on my server, but my output is ever
in 1.4 pdf version .....
And i haven't got any error during execution of the jodconverter
command, i'm using openoffice 3.2 on Ubuntu 8.04

It's really boring when something doesn't work only on your
computer :'(

Mirko Nasato

unread,
Jan 16, 2010, 6:10:25 AM1/16/10
to JODConverter
Make sure you write "SelectPdfVersion": 1, not "SelectPdfVersion":
"1". I.e. the value is a int, not a string.

(A PDF/A-1 document is always a PDF 1.4 document anyway. PDF/A-1 is a
subset of PDF 1.4.)

Kind regards

Mirko

Séb

unread,
Jan 17, 2010, 2:59:22 AM1/17/10
to JODConverter
Hum, i have make no error at this level (the selectPdfVersion is
declared as an INT).
This this the complete part of the conf/document-formats.js (the first
section)

//
// JODConverter Document Formats Configuration
//
[
{
"name": "Portable Document Format",
"extension": "pdf",
"mediaType": "application/pdf",
"storePropertiesByFamily": {
"DRAWING": {"FilterName": "draw_pdf_Export"},
"SPREADSHEET": {"FilterName": "calc_pdf_Export"},
"PRESENTATION": {"FilterName": "impress_pdf_Export"},


"TEXT": {"FilterName": "writer_pdf_Export","FilterData":
{ "SelectPdfVersion": 1 } }
}
}

As you can see, i have just add this -----> ,"FilterData":
{ "SelectPdfVersion": 1 } <------- for the TEXT family (and when i try
to convert an odt file, that just product an PDF-1.4 version)

I know PDF/A1 it's just a subset of PDF 1.4, but on Evince, a file
converted with OOo (and PDF/A option selected) is correctly recognized
as a PDF/A1, but a pdf converted with JodConverter isn't.

I want this format for include document on my electronic document
manager, that's necessary but apparently not easy :-)

Mirko Nasato

unread,
Jan 17, 2010, 2:14:58 PM1/17/10
to JODConverter
Works for me. Are you passing the customised registry file with the --
registry switch?

Kind regards

Mirko

Séb

unread,
Jan 20, 2010, 7:23:37 AM1/20/10
to JODConverter
Huuuum.... no ?
I have just edit the conf/document-formats.js an use this command
line :

java -jar jodconverter-2.2.2/lib/jodconverter-cli-2.2.2.jar
monFichier.odt monFichier.pdf

You say i need to use a suplementary option " -- registry" to take my
modification in "consideration" ?

But how can i do that, i haven't found any tutos on google using this
option ??? :-(

In ever case, really thanks for your support ;-)

Séb

unread,
Jan 20, 2010, 7:35:09 AM1/20/10
to JODConverter
YES !!!

A great "thanks you" for your support Mirko,
i have try to add :
--registry jodconverter-core-3.0-beta-3/conf/document-formats.js

at the end of my command, and the file producted by your soft is a
great PDF/A-1 type !

I hope this thread can help other user to found how to done PDF/A-1
conversion.

A great thanks again !

Reply all
Reply to author
Forward
0 new messages