soffice how to get information error - perl

I'm trying to convert docx and xlsx files to pdf.
I have cgi perl script on server it worked fine but now it doesnt.
I didnt do any change.
When I try:
system("export HOME=/tmp && soffice --headless --convert-to pdf --outdir pdf/LgfpQJtC 'pdf/LgfpQJtC/example.docx'");
print"$?";
I get:
19712
The file example exist and it's in right directory.
But pdf file wont create.
When I run the same command as root in command line it works fine.
I tried set full acces to directory and file but it didnt help.
Is there any way to get more information about error?
Thanks for any help.

Related

How to Open .txt file in LAMMPS

I am trying to run an in.file in lammps, but I keep getting an error saying it cannot open the .txt file. The last command that it stops at is: 'molecule ID file.txt file2.txt file3.txt'
The file it cannot open is file.txt, yet it is all spelled the same. Please help! Thank you!
I tried renaming the files but that did not work

Need help to write a basic Command Line code

I'm using Windows 10 if it matters and I'm trying to feed a file to the "oeminst" app that will convert this file from .EDR to .CCSS. According to the app's website its usage summary is this:
oeminst [-options] [inputfiles]
-v Verbose
-n Don't install, show where files would be installed
-c Don't install, save files to current directory
-S d Specify the install scope u = user (def.), l = local system]
infile Manufacturers setup.exe install file(s) or .dll(s) containing install files
infile.[edr|ccss|ccmx] EDR file(s) to translate and install or CCSS or CCMX files to install
If no file is provided, oeminst will look for the install CD.
more info can be found here https://www.argyllcms.com/doc/oeminst.html
So far I tried this code:
C:\Users\PC>oeminst infile. [C:\Users\PC\testfile.edr]
oeminst: Error - Unable to load file 'infile [C:\Users\PC\testfile]'
I'd appreciate if someone at least could tell me if I'm doing it right or not.
P.S. sorry for the messed up text. Not sure how to fix it. It looks good in editing mode.
Try this : oeminst infile.edr C:\Users\PC\testfile.edr
Nevermind, I got it.
C:\Users\PC>oeminst C:\Users\PC\testfile.edr

LibreOffice Command Line Convert CSV to DBF

I am working on a workflow where I need to be able to batch convert CSV files into DBF files. The data in the CSV files can all be output as TEXT fields and then saved as a DBF. I have tried to get any output possible using the command line in both Mac OS and Windows 7. While I was a little more successful in Windows, I was not able to get any conversion.
"C:\Program Files (x86)\LibreOffice 5\program\scalc.exe" --convert-to dbf --
infilter="csv:44,34,76,1,1/2/2/2/3/2/4/2/5/2/6/2/7/2/8/2/9/2/10/2/11/2/12/2/13/2/14/2/15/2/16/2/17/2/18/2/19/2/20/2/21/2/22/2/23/2/24/2/25/2/26/2/27/2/28/2/29/2/30/2/31/2/32/2
/33/2/34/2/35/2/36/2/37/2/38/2/39/2/40/2/41/2/42/2/43/2/44/2/45/2/46/2/47/2/48/2/49/2/50/2/51/2/52/2/53/2/54/2/55/2/56/2/57/2/58/2/59/2/60/2/61/2/62/2/63/2/64/2/65/2/66/2/67/2
/68/2/69/2/70/2/71/2,0,false,false" C:\Users\jdavidson\Desktop\DBFCONVERT\*.csv --outdir C:\Users\jdavidson\desktop\complete
So, I needed to have an --infilter on the command line to be able to do the conversion, but now it will only process 1 file and not batch file when using *.csv So, my next hurdle is to get over that.
The below helps to explain --infilters in more detail:
https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options#Filter_Options_for_Lotus.2C_dBase_and_DIF_Filters
Any easier way to find the filter sequence you need is by following the below listed steps:
Open the CSV Manually using LibreOffice and Specify Every Detail in the import Wizard
Run the below macro and it will show you the filter options in an input box, so you can copy the string in to your own code
Sub showFilterOptions
Dim args(),i%
args() = thisComponent.getArgs
for i = 0 to uBound(Args())
if args(i).Name = "FilterOptions" then inputbox "","",args(i).value
next
End Sub
Credit to code: https://forum.openoffice.org/en/forum/viewtopic.php?f=44&t=14018
The parameters need to be reversed. From https://ask.libreoffice.org/en/question/2641/convert-to-command-line-parameter/:
soffice --headless --convert-to <TargetFileExtension>:<NameOfFilter> file_to_convert.xxx
Using the old windows command prompt:
"C:\Program Files (x86)\LibreOffice 5\program\scalc.exe" --headless --convert-to dbf C:\Users\jdavidson\Desktop\DBFCONVERT\test.csv
This will create test.dbf in the current directory, which is perhaps C:\Users\jdavidson or, if running as administrator, C:\Windows\system32. To print the working directory, enter pwd, and then dir to see the file.
In powershell, add "& " in front to execute LibreOffice. Then enter gci or ls to see the file.
Be sure that a LibreOffice process is not already running in the background.
I was able to get this to work using the below code:
"C:\Program Files (x86)\LibreOffice 5\program\scalc.exe" --convert-to DBF --infilter="csv:44,34,76,1,1/2/2/2/3/2/4/2/5/2/6/2/7/2/8/2/9/2/10/2/11/2/12/2/13/2/14/2/15/2/16/2/17/2/18/2/19/2/20/2/21/2/22/2/23/2/24/2/25/2/26/2/27/2/28/2/29/2/30/2/31/2/32/2/33/2/34/2/35/2/36/2/37/2/38/2/39/2/40/2/41/2/42/2/43/2/44/2/45/2/46/2/47/2/48/2/49/2/50/2/51/2/52/2/53/2/54/2/55/2/56/2/57/2/58/2/59/2/60/2/61/2/62/2/63/2/64/2/65/2/66/2/67/2/68/2/69/2/70/2/71/2/72/2/73/2/74/2/75/2/76/2/77/2/78/2/79/2/80/2/81/2/82/2/83/2/84/2/85/2/86/2/87/2/88/2/89/2/90/2/91/2/92/2/93/2/94/2/95/2/96/2/97/2/98/2/99/2/100/2/101/2/102/2/103/2/104/2/105/2/106/2/107/2/108/2/109/2/110/2/111/2/112/2/113/2/114/2/115/2/116/2/117/2/118/2/119/2/120/2/121/2/122/2/123/2/124/2/125/2/126/2/127/2/128/2/129/2/130/2/131/2/132/2/133/2/134/2/135/2/136/2,0,false,false" C:\Users\jdavidson\Desktop\DBFCONVERT\57826001_JQSAMPLE.csv --outdir C:\Users\jdavidson\desktop\complete
Please note, that I needed to use DBF and include an --infilter parameter field
There are two websites in my original posting that shows helpful scripts and infilter information to help other users

Can we give two files as input while using JasperStarter

I am using JasperStarter to create pdf from several jrprint files and then print it using JasperStarter functtions.
I want to create one single pdf file with all the .jrprint files.
If I give command like:
jasperstarter pr a.jprint b.jprint -f pdf -o rep
It does not recognise the files after the first input file.
Can we create one single output file with many input jasper/jrprint files?
Please help.
Thanks,
Oshin
Looking at the documentation, this is not possible:
The command process (pr)
The command process is for processing a report.
In direct comparison to the command for compiling:
The command compile (cp)
The command compile is for compiling one report or all reports in a directory.

"No such file or directory" when executing Perl script

I have a 3D modal for cup.obj. I need to convert to .h file so I downloaded this http://heikobehrens.net/2009/08/27/obj2opengl/ And put cup.obj file to this folder. Then I run from terminal obj2opengl.pl cup.obj I didn't get .h file.
Ranganatha-GVs-Mac-mini:~ ranganathagv$ ./obj2opengl.pl cup.obj
-bash: ./obj2opengl.pl: No such file or directory
Ranganatha-GVs-Mac-mini:~ ranganathagv$
The obj2opengl.pl script probably hasn't the right permission set in order to be executable using the ./ syntax.
Two choices here, you can either:
Change the permission on the script using chmod +x obj2opengl.pl, and using ./obj2opengl.pl cup.obj should work from there on, or
Run the script using perl obj2opengl.pl cup.obj.
Hope this helps!