LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-18-2003, 05:20 AM   #1
bartgymnast
Member
 
Registered: Feb 2003
Location: Almere, Netherlands
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368

Rep: Reputation: 165Reputation: 165
pdf converter program


hello I work in a company were we use alot of PDF files
we are using RH 7.3 and RH 8.0 together with OpenOffice and a own software package.
Now I wonder is there a program that can convert like 300 sxw files to pdf files just with a small time of actions to do.

because now I need to convert them 1 by 1

please help
 
Old 02-18-2003, 07:30 AM   #2
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
why don't you make a script?
-> lets say the program that converts pdf's is called convertpdf

#!/bin/bash
convertpdf file1
convertpdf file2
convertpdf file3

chmod +x it and run.
It's not so elegant (far from), but it'll do the job untill you find a program that you want
 
Old 02-18-2003, 08:33 AM   #3
bartgymnast
Member
 
Registered: Feb 2003
Location: Almere, Netherlands
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368

Original Poster
Rep: Reputation: 165Reputation: 165
well 1 problem, do you know a command line to convert sxw files to pdf

converting (this printing) sxw in OpenOffice takes alot of time
 
Old 02-19-2003, 08:24 AM   #4
bartgymnast
Member
 
Registered: Feb 2003
Location: Almere, Netherlands
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368

Original Poster
Rep: Reputation: 165Reputation: 165
bump

because i need help
 
Old 02-19-2003, 05:38 PM   #5
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Since .sxw and other OpenOffice formats are kind of specific to OpenOffice, I don't know of any easy way to batch-convert them to anything else.

There is the Document Converter (under the File->Autopilot menu in OO) that will convert other formats to OpenOffice format. I don't know if it'll go the other way, though.

There are some command-line utilities, such as ps2pdf and dvi2pdf, which are also capable of producing pdf output.

Perhaps GhostScript will do something like this?

Just some guesses I hope it helps.
 
Old 03-29-2003, 05:06 PM   #6
tktim
Member
 
Registered: Mar 2003
Location: USA-Los Angeles, California
Distribution: Fedora 15
Posts: 119

Rep: Reputation: 16
Does this help: Print files to PS format. Is it any faster to save them as PS file, then do the iceman47 script thing?

Quote:
Nearly any software in Linux that has the ability to print also has the option to print to file. The first step is to print to a .PS or .EPS file.

The second step is to make sure you have GhostScript installed. It has a number of functions, one of which is to turn .PS or .EPS to .PDF.

Then, from a command-line, all you need to do is ps2pdf filename.ps , and it will create a .PDF with the same filename.

If you want to see one I've done... << CLICK HERE >>

There are a bunch of such commands... ps2ascii, ps2pdf, ps2pdf13, ps2pdfwr, ps2epsi, ps2pdf12, ps2pdf13, ps2pdf14 (the last three are for compatibility with older versions of Adobe Acrobat Reader), ps2ps, pdf2dsc, pdf2ps (to go from .PDF to .PS).

__________________
TTFN,

Ranger Nemo
 
Old 07-04-2003, 04:50 AM   #7
Juppie
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat
Posts: 1

Rep: Reputation: 0
Building an PDF file is not that difficult, it can easily be done in a minute.
In OpenOffice is already an function build in, PDF converter.
But you have to alter your print preferences.
I will try to explain it in a very simple way.
Go to File -> Printer Settings. You will get an pop-up to choose an printer, then you have to choose PDF converter. And press 'ok'
If you want an pdf file you just press Ctrl-P.
I hope that my post will usefull for you.
 
Old 09-25-2003, 09:03 PM   #8
wirawan0
Member
 
Registered: Aug 2003
Location: Virginia, USA
Distribution: Mandrake 9.1, SuSE 9.2, Ubuntu 7.04-10.04, Sabayon 5, Debian 6
Posts: 64

Rep: Reputation: 18
Post Use batch conversion!

Hi bartgymnast,

Do you still need this help? Probably it's good for reference for anyone else.

It's not trivial to do such a batch printing, but still possible, and worth the trouble for printing 300 files at once!

First, I scoured the openoffice website for command-line options. Here it is:

http://www.openoffice.org/files/docu...ets=1w1sjze2h3

What version of Open Office (OO) that you use? I assume version 1.0.x or 1.1.x. Hopefully they are compatible in the command line options. Let me assume that you use version 1.0.x.

First, follow the earlier suggestion to set up the PDF-convertor printer.

To do this, close all openoffice windows, and open the printer admin program (spadmin). On some systems (notably those that bundle OpenOffice into their Linux distros), this program is not readily accesible by typing spadmin on the shell. Either they provide it somewhere, or find it manually. Use, e.g. rpm -ql OpenOffice.org | grep spadmin if you can't find it.

On my distro (Mandrake 9.1), it's found in:

/usr/lib/openoffice/program/spadmin.

Let's say you've set up the PDF printer with the name "PDF converter".

My suggestion: set the "PDF target directory" to a fixed directory (let's say, /home/myself/Print), so that the printed files go there, not spread everywhere. But you can keep it blank, in which case all the printed files go to your home directory. To set this option, on spadmin window select the "PDF converter" printer, click "Properties". The "PDF target directory" is right on the bottom of the dialog box.

Now that you've set everything up, close spadmin. And make sure that the directory /home/myself/Print does exist (or create it).

Go to the directory containing the .sxw files. Then type this on your shell:

oowriter -pt "PDF converter" *.sxw

(On Red Hat sometimes the program is called ooowriter -- with three o's, IIRC; on generic distribution, it's called swriter. Please check that.) Don't forget to quite the PDF converter on the shell command above, as we have a whitespace in the printer name.

Voila... all the documents are printed after a little while. Check the

/home/myself/Print

directory. I don't remember how the printed files get their names. On my little experiment, it got it from the source files (e.g. file1.sxw.pdf, file2.sxw.pdf, and so on). But somehow I remember that it gave me another name, i.e. the title of the document in its summary box, or what. Anyway, hopefully this helps you (or anyone else in the future ---- :-)
 
Old 11-16-2003, 01:40 PM   #9
RICronkhite
LQ Newbie
 
Registered: Mar 2003
Location: Eastern U.S.
Posts: 8

Rep: Reputation: 0
Batch converter

Here is one I wrote for DOS to convert faxes. I hope it helps


@echo=off
cls
set U=1
set T=0
set H=0
:loop
if not exist FAX--%H%%T%%U%.pcx goto done
type FAXBATCH.txt
@echo=on
rem WE ARE NOW CONVERTING FAX--%H%%T%%U%.PCX to FAX.%H%%T%%U% .................................................................................................... .................................................................
@echo off
if exist FAX--%H%%T%%U%.pcx convert FAX--%H%%T%%U%.PCX FAX.%H%%T%%U%
IF %H%%T%%U% == 999 GOTO done
del FAX--%H%%T%%U%.PCX
call number %U%
SET U=%ANS%
IF NOT %U% == 0 GOTO LOOP
call number %T%
set T=%ANS%
if not %T% == 0 GOTO LOOP
call number %H%

_______________________________________
FAXBATCH is FREEWARE.

FAXBATCH is a batch program designed to convert a number of files in one
format such as PCX to another such as your FAX format. This is very
convenient for the WordStar FAX utility. Of course it can be modified
to be used for any other .EXE or .COM files which you would like
execute on consecutively numbered files.


Instructions for FAXBATCH:


1. Rename your .exe or .com file to be used on multiple
files to convert.exe or convert.com.

REN YOURS.EXE CONVERT.EXE
REN YOURS.COM CONVERT.COM

2. Place the FAXBATCH files (number.bat, FAXBATCH.txt, and FAXBATCH.bat)
and the files to be converted in the same directory.

3. Make your filenames comply to the format below.


FAXBATCH file format:


FAX--001.pcx will convert to fax.001
FAX--002.pcx will convert to fax.002
etc.

4. type FAXBATCH

Note: FAXBATCH will delete the original .pcx files that it converts.


Modifications of FAXBATCH for use with other .exe and .com files:


1. Find all references to FAX--%H%%T%%U%.pcx in the autofax.bat file
with an editor and replace the extension to the one desired.

Example:

FAX--%H%T%%U%.pcx to FAX--%H%%T%%U%.drw
etc.


2. Change all references in autofax.bat to fax.%H%%T%%U%
to "Your 8 character filename".%H%%T%%U%

3. Run as above.

______________________________________

FAXBATCH.TXT file is as follows:

________________________________
| |
| FAXBATCH CONVERSION UTILITY |
| |
| FREEWARE |
| |________________________________|
 
Old 11-16-2003, 07:25 PM   #10
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
Re: Batch converter

Quote:
Originally posted by RICronkhite
Here is one I wrote for DOS to convert faxes. I hope it helps
No
 
Old 03-24-2004, 02:31 PM   #11
JohnSimone
LQ Newbie
 
Registered: Mar 2004
Posts: 2

Rep: Reputation: 0
convert DOC/XLS to PDF or TXT/CSV

I desperately need a solution to convert DOC/XLS files to either PDF or TXT/CSV (respectively) on a Unix/Linux command line as part of a solution I am developing for my client.

Can this be done with StarOffice or OpenOffice? Does anyone know of any open source command line utilities out there capable of converting DOC or XLS?

Any help at all would undyingly appreciated (you'll make my Christmas card list).

Thanks in advance.

Kind Regards,
John
 
Old 03-24-2004, 07:13 PM   #12
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Re: convert DOC/XLS to PDF or TXT/CSV

Quote:
Originally posted by JohnSimone
I desperately need a solution to convert DOC/XLS files to either PDF or TXT/CSV (respectively) on a Unix/Linux command line as part of a solution I am developing for my client.
Check out this thread describing how to use OpenOffice to convert Word docs into PDF from the command-line. There's also some discussion of XLS to CSV.
 
Old 03-24-2004, 08:57 PM   #13
JohnSimone
LQ Newbie
 
Registered: Mar 2004
Posts: 2

Rep: Reputation: 0
Convert / Extract Word documents (doc) and Excel spreadsheets (xls) to text (txt) csv

Just some info for those in need (it took me an entire day to figure this one out). A fairly clean solution for converting/extracting text and CSV data from Word documents and Excel spreadsheets (respectively) is to use:

catdoc & xls2cvs
http://www.45.free.net/~vitus/ice/catdoc/

You can just drop to the command line, convert the file to text on the command line, capture the output in an array and use it as you wish. For example:

PHP Code:
// Establish our document file name
$doc_file_name "/foo/bar/Test Document.doc";
// Create our command
$convert_command "catdoc '$doc_file_name'";
// Execute our command
exec("$convert_command"$exec_result_array$exec_result_status); 
Also for those of you hosting on Windows, there's always:

ShareOffice PHP
http://badblue.com/helpphpo.htm

Hope this helps someone.

Rock on,
John
 
Old 04-02-2004, 03:12 PM   #14
Goatdemon
Member
 
Registered: May 2002
Location: The good 'ol USofA
Distribution: ArchLinux - Slackware 8.1
Posts: 398

Rep: Reputation: 30
hey, i know that

for i in /target_directory/*; do insmod $i; done

will allow you to insert every module in the target directory so try..

for i in /pdf_dir/*; do convert_pdf_program $i; done

convert every, pdf file in the given directory? i dont know any pdf conversion
program so replace convert_pdf_program with whatever you can find and try it.
 
Old 04-02-2004, 03:13 PM   #15
Goatdemon
Member
 
Registered: May 2002
Location: The good 'ol USofA
Distribution: ArchLinux - Slackware 8.1
Posts: 398

Rep: Reputation: 30
ooh, it's my birthday, how special, i get a cake next to my name. cool.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF to DOC Converter? vivek.sonny.abraham Linux - Software 20 11-30-2011 03:36 PM
Pdf Converter free Software James_dean Linux - Software 4 10-14-2005 12:58 AM
Linux RedHat 9.0 PDF to Word converter lamby Linux - Newbie 2 06-22-2004 06:45 PM
Program to Create Secure PDF Files? smc_one Linux - Software 1 10-08-2003 08:30 AM
PDF to PNG converter Kostko Linux - Software 10 05-05-2003 06:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration