B4J Question jShell Question

Harris

Expert
Licensed User
Longtime User
I have been experimenting with a third party jar for converting my .RTF files to .PDF...
It is working, but leaves me puzzled.

Here is where I got the jar and instructions:

Here is my code to execute the jar:
B4X:
    Dim sh As Shell
    sh.Initialize("sh","java", Array As String("-jar", "vPDFcCL.jar", fn2&"/"&fn1, fn1.Replace(".rtf",".pdf") ))
    sh.WorkingDirectory = File.DirApp
    sh.Run(10000)

' the array params: "-jar" _(obvious), "vPDFcCL.jar" _(the jar to call),   fn2&"/"&fn1 _(the path and file name of .RTF),  fn1.Replace(".rtf",".pdf") _(the output PDF file converted)

My issue is that I MUST include the 2 jar files (vPDFcCL.jar and itext.jar) in the Objects ( sh.WorkingDirectory = File.DirApp ) for it to work.

I tried in Main - but shell was unable to locate them...
#AdditionalJar: vPDFcCL.jar
#AdditionalJar: itext-2.0.2.jar

Is there a better way?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
I tried in Main - but shell was unable to locate them...
#AdditionalJar: vPDFcCL.jar
#AdditionalJar: itext-2.0.2.jar

Is there a better way?
copy them into files folder and on appstart you can copy them to File.DirApp.
 
Upvote 0
Top