Upgrading from 2.2 to 3.0

242 views
Skip to first unread message

Shervin Asgari

unread,
Mar 4, 2010, 9:12:41 AM3/4/10
to jodcon...@googlegroups.com
Hi.

I have been trying to upgrade from 2.2 to 3.0 and have 1,5 problems :-)
I will come back to the half later.

The first problem is that I haven't found a way to create PDF/A.
I am trying to convert the code:

final String PDF_APP= "application/pdf";
final String PORTABEL_FORMAT = "Portable Document Format";

DocumentFormat customPdfFormat = new DocumentFormat(PORTABEL_FORMAT, PDF_APP, "pdf");
customPdfFormat.setExportFilter(DocumentFamily.TEXT, "writer_pdf_Export");
Map<String, Integer> pdfOptions = new HashMap<String, Integer>();
pdfOptions.put("SelectPdfVersion", this.PDFX1A2001); //1
customPdfFormat.setExportOption(DocumentFamily.TEXT, "FilterData", pdfOptions);


To support the new API, but I am lost as to where to put this FilterData.
Any hints?


The half problem I have is a bit more complicated. I want to use the new features in 3.0 with pipes, however I cannot make it work.
I am guessing its because I have difficulty setting java.library.path because I am using ant and I don't know how to set -Djava.library.path using ant.
Any ideas?


Mirko Nasato

unread,
Mar 7, 2010, 8:20:31 AM3/7/10
to JODConverter
In 3.0 the code would look like this

DocumentFormat format = new DocumentFormat("PDF/A", "pdf",
"application/pdf");
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("FilterName", "writer_pdf_Export");
Map<String, Object> filterData = new HashMap<String, Object>();
filterData.put("SelectPdfVersion", 1);
properties.put("FilterData", filterData);
format.setStoreProperties(DocumentFamily.TEXT, properties);

As for setting java.library.path please provide more details on how
you're using ant.

Kind regards

Mirko

On Mar 4, 3:12 pm, Shervin Asgari <shervin.asg...@gmail.com> wrote:
> Hi.
>
> I have been trying to upgrade from 2.2 to 3.0 and have 1,5 problems :-)
> I will come back to the half later.
>
> The first problem is that I haven't found a way to create PDF/A.
> I am trying to convert the code:
>

> *final String PDF_APP= "application/pdf";


> final String PORTABEL_FORMAT = "Portable Document Format";
>
> DocumentFormat customPdfFormat = new DocumentFormat(PORTABEL_FORMAT,
> PDF_APP, "pdf");
> customPdfFormat.setExportFilter(DocumentFamily.TEXT, "writer_pdf_Export");
> Map<String, Integer> pdfOptions = new HashMap<String, Integer>();
> pdfOptions.put("SelectPdfVersion", this.PDFX1A2001); //1
> customPdfFormat.setExportOption(DocumentFamily.TEXT, "FilterData",

> pdfOptions);*


>
> To support the new API, but I am lost as to where to put this FilterData.
> Any hints?
>
> The half problem I have is a bit more complicated. I want to use the new
> features in 3.0 with pipes, however I cannot make it work.
> I am guessing its because I have difficulty setting java.library.path
> because I am using ant and I don't know how to set -Djava.library.path using
> ant.

> **Any ideas?

Shervin

unread,
Mar 8, 2010, 8:17:25 AM3/8/10
to JODConverter
Thank for the tip.

When it comes to my ant build file. Its a pretty standard build file
generated from seam-gen.

I could post it, but not sure what you are looking for.
We are using ant to compile and pack an EAR and deploy it to our App
Server.

Something like:
<target name="compile" depends="init" description="Compile the Java
source code" unless="eclipse.running">
<javac classpathref="build.classpath" destdir="${jar.dir}" debug="$
{javac.debug}" deprecation="${javac.deprecation}" nowarn="on">
<src path="${src.model.dir}" />
<src path="${src.action.dir}" />
</javac>
</target>

But I guess the most relevant is our jar target
<target name="jar" depends="compile,copyclasses" description="Build
the distribution .jar file">
<copy todir="${jar.dir}">
<fileset dir="${basedir}/resources">
<include name="seam.properties" />
<include name="*.drl" />
</fileset>
</copy>
<copy todir="${jar.dir}/META-INF">
<fileset dir="${basedir}/resources/META-INF">
<include name="ejb-jar.xml" />
<include name="orm.xml" />
</fileset>
</copy>
</target>

Then we have an explode that packs everything in ear and deploys it.

Shervin

Mirko Nasato

unread,
Mar 8, 2010, 4:02:00 PM3/8/10
to JODConverter
No much point in setting java.library.path in that ant build file
then. You'd need to set java.library.path as a VM argument when
starting the app server.

Kind regards

Mirko

Shervin

unread,
Mar 10, 2010, 4:59:57 PM3/10/10
to JODConverter
Aaaah, yes that would probably be the correct thing to do.
Maybe I can do it in the startup script.

How do you do it?

Best regards
Shervin

Mirko Nasato

unread,
Mar 12, 2010, 3:56:41 PM3/12/10
to JODConverter
Yes you usually set it in the startup script.

http://stackoverflow.com/search?q=set+java.library.path

Kind regards

Mirko

Puneeth GL

unread,
Jan 20, 2015, 2:04:19 AM1/20/15
to jodcon...@googlegroups.com
Hi,

I am trying to convert password protected odt file to pdf using jod converter. 

I found the code to provide the password. that is

    DocumentFormat odtWithPassword = new DocumentFormat(odt.getName(), odt.getFamily(), odt.getMimeType(), odt.getFileExtension());
    odtWithPassword.setImportOption("Password", "secret");

But setImportOption("Password","secret"); method is not available in JOD 3.0, Please help me how to Convert password protected docx file to pdf.

I am trying alot but i am not getting solution how to convert password protected file using jod converter with open office api(JAVA).
Reply all
Reply to author
Forward
0 new messages