Get Possible Conversion Using JODConverter.

1,347 views
Skip to first unread message

alf sender

unread,
Oct 9, 2012, 3:10:00 AM10/9/12
to jodcon...@googlegroups.com
Hi All,

I am trying to use JODConverter for document conversion.
I am able to convert DOC to PDF using JODConverter. 
But now i need to check which conversion can be done, means if i select "test.doc" file then it should return possible conversion format like pdf, image, etc .

so all possible conversion available for doc format, so that what ever type user selects document will get converted to that type.

I am using JODConverter 2.2.2, I have tried to find any method which returns possible conversion format, but i didn't find any.

For above requirement if you have any other approach, please suggest that also.

Thank you.

Regards,
alfseder

Phyo Thinza

unread,
Oct 9, 2012, 4:32:55 AM10/9/12
to jodcon...@googlegroups.com
hi

friend,

I have used jodconverter-core-3.0-beta-4.jar.
The purpose is to convert any office file to pdf.
But it is not sure that jodconverter can convert office file to image or other file type.

I think it will be OK to convert office file to pdf file.If you use this, you will need to install openoffice and start this service.......

I have a sample example ..........
please refer it.....you will also need some jar file to implement


/***
parameter: inputFile ------ source file
                outputFile-------destination file which want to convert

***/
public void convertFile(File inputFile, File outputFile) throws Exception{

OfficeManager  officeManager = new DefaultOfficeManagerConfiguration().buildOfficeManager();
OfficeDocumentConverter documentConverter = new OfficeDocumentConverter(officeManager);

try {
officeManager.start(); //starting soffice manager
 String pageRange = "1-1"; // converting page count 1-1  to convert only first page
          DocumentFormat documentFormat =getDocumentFormat(pageRange);
          long start = System.currentTimeMillis();
 
          documentConverter.convert(inputFile, outputFile,documentFormat);
          long end = System.currentTimeMillis();
         double duration = (end - start) / 1000d;
         System.out.println("Conversion took: " + duration + "seconds.");
System.out.println("Convert complete!");
        } catch (Exception exception) {
       
            System.out.println(String.format("failed conversion: %s [%db] to %s; %s; input file: %s", inputFile.getName(), inputFile.length(), outputFile.getName(), exception, inputFile.getName()));
        throw new Exception("conversion failed", exception);
       
        } finally {
      officeManager.stop();//stopping soffice manager
       officeManagerHandler=null;
       
        }

}

////if you want to convert this pdf to image , you will use some code of converting pdf to image.....

--
You received this message because you are subscribed to the Google Groups "JODConverter" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jodconverter/-/2B9c4KtvtO4J.
To post to this group, send email to jodcon...@googlegroups.com.
To unsubscribe from this group, send email to jodconverter...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jodconverter?hl=en.

alf sender

unread,
Oct 9, 2012, 5:18:24 AM10/9/12
to jodcon...@googlegroups.com
Hi Friend,

Thank you for your reply.

I am able to convert doc to pdf as you said. But my question is before doing conversion, i need all possible format to which conversion can be done.

For example I have "Test.doc", before doing i need a drop down with all possible conversion format, so that user can select any one format from that drop down. After that conversion will happen and "Test.doc" will be converted to selected format.


Thank You.

Phyo Thinza

unread,
Oct 9, 2012, 6:55:46 AM10/9/12
to jodcon...@googlegroups.com
OK friend , I understand your idea. But I have been used jodconverter to convert only pdf format. I don't know well  jod can convert or not to any file type. When I know well, I will reply again to you......

--
You received this message because you are subscribed to the Google Groups "JODConverter" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jodconverter/-/0lkiMwM-AREJ.

Surupa Ray

unread,
Oct 9, 2012, 3:14:47 AM10/9/12
to jodcon...@googlegroups.com
Hi alfseder,

You can use Unoconv or loimpress also.
Unoconv is awesome.(My personal opinion)

Thanks,
Surupa

--
You received this message because you are subscribed to the Google Groups "JODConverter" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jodconverter/-/2B9c4KtvtO4J.

alf sender

unread,
Oct 10, 2012, 6:19:43 AM10/10/12
to jodcon...@googlegroups.com
Hi Friends,

Thank you for your reply.

One problem which I am facing while converting doc/docx to pdf using jodconverter is, if doc file contains any chat, that portion in pdf comes as a blank.

I tried for some documents which are combination of Image and charts, but in all case only image which i have added is coming but not the chart, in place of chart it will give blank space.        

please of possible test it at your and inform me of the same.

Regards,

Ratul Sarkar

unread,
Dec 9, 2013, 5:11:05 AM12/9/13
to jodcon...@googlegroups.com
Hi,

I am using jod 3.2.1;
My prob is that my while i am converting ant doc/docx to pdf, sometimes in some docs, the tables are not coming properly. 

what to do???? 

Amir Hossein Sharifzadeh

unread,
Dec 9, 2013, 5:13:03 AM12/9/13
to jodconverter
Have you tried Open Office 4?


--
You received this message because you are subscribed to the Google Groups "JODConverter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jodconverter...@googlegroups.com.

To post to this group, send email to jodcon...@googlegroups.com.

Ratul Sarkar

unread,
Dec 9, 2013, 5:22:27 AM12/9/13
to jodcon...@googlegroups.com
Yes...

I am attaching two files.. plz help about this... 


TABLE OF CONTENTS.docx
TABLE OF CONTENTS.docx.pdf

Kamal C

unread,
Jun 20, 2014, 4:27:37 AM6/20/14
to jodcon...@googlegroups.com
Hi Team,

Iam looking for docx to pdf conversion using JODConverter 3.0 API but no luck still in vain, anyone have code to share please do the needfull.

Currently iam able to convert using open office 4.1.0 and microsoft for docx to pdf using JODConverter 3.0 API but not able to view it in Adobe Reader, it says document is corrupt or not supported :(.

Thanks
Kamal
Reply all
Reply to author
Forward
0 new messages