Adding JPG convertion to JODConverter WebApp

561 views
Skip to first unread message

peterHammer

unread,
Feb 8, 2011, 2:53:51 PM2/8/11
to JODConverter
Hello everyone, I'm trying JODConverter as a Webapp and it works to
perfection.

But I would like to be able to transform JPG to PDF.

I had no luck manipulating the DocumentFormats.xml and
DocumentFormats.js.

The result is this:

Java.lang.IllegalArgumentException: unsupported input format: JPG

com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:
99)

com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:
88)

com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:
82)

com.artofsolving.jodconverter.web.DocumentConverterServlet.doPost(DocumentConverterServlet.java:
71)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Checking the source-code I got to see that it is some fault at
defining the family of the JPG type:

DocumentFormat.java:
public boolean isImportable() {
return family != null;
}
It all comes to the above method, so I assume that "family" is
"null".

Can anyone point me in how to allow this conversion?

Below is what I added to try to make it work.

Any help in this matter is more than welcome.

Thanks in advance.

Best regards,
Peter Hammer.

DocumentFormats.xml:
...
<document-format>
<name>JPG</name>
<mime-type>image/jpeg</mime-type>
<file-extension>jpg</file-extension>
<export-options>
<entry>
<family>Drawing</family>
<map>
<entry>
<string>FilterName</string>
<string>draw_jpg_Export</string>
</entry>
</map>
</entry>
</export-options>
<import-options/>
</document-format>
</document-formats>

DocumentFormats.js:
...
importFormatTable['jpg'] = 'Image';
importFormatTable['jpeg'] = 'Image';
...
exportFormatTable['Image'] = Array();
exportFormatTable['Image'][0] = new Option('Portable Document
Format (pdf)', 'pdf');

Shafiq F

unread,
Feb 20, 2011, 7:00:28 AM2/20/11
to JODConverter
Hi

I have a similar issue to this. I'm using jodconverter to convert a
variety of MS-Office documents into PDF, and I need to add image
conversion to this facility.

Is this possible to do at all? Has anyone done anything like this
before?

Kamal C

unread,
Sep 22, 2014, 1:11:46 AM9/22/14
to jodcon...@googlegroups.com
Hi team,

Iam also looking for Embedded Attachments of files inside word documents, please let me know how to achieve this functionality using JOD.

For conversion from variety of word documents to Pdf.

Thanks
Kamal
Reply all
Reply to author
Forward
0 new messages