LinuxQuestions.org
Help answer threads with 0 replies.
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 08-29-2003, 01:57 PM   #1
AcerKev
Member
 
Registered: Aug 2003
Location: Nottingham
Distribution: XP SP2, Vista, Mandrake/iva 9.2 - 2007
Posts: 50

Rep: Reputation: 15
Generate PostScript files with CUPS


Does anyone know if it's possible for CUPS to generate a postscript file and save it to disc that can be printed from later?

I.E.

1. Windows user would print to PSPRINTER (say using HP5Si Drivers to generate Postscript?) - As far as they were concered that would be a "normal" print job.

2. CUPS would recive as an IPP job, or via Smaba/MARS_NWE an LP command)

3. Rather than sending this to a printer, it would save the file to disc as /home/docs/filename

4. This would enable instant reprints from our webbased systems - very logical for the user - however this may go to a different printer, but the webbased system would issue a command like
"lp -d POSTIE -h MUG /home/docs/filename"
so that cups would convert this to a format the printer understands.

Saving as a PDF would also be a good alternative (in fact possbly nicer), but the user MUST NOT be prompted for the filename to save it as on the linux machine (their machine won't see the drive).

As the files are saved following conventions

i.e. JOBNO_TypeOfDocument.doc
any duplicates should (or can) overwrite the originals.
 
Old 08-29-2003, 02:18 PM   #2
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Check out existing functions in CUPs. It already has all printed files in a circular buffer. Any one if which can be restarted. I imagine the default buffer is small (maybe 20 megabytes), but I am sure it could be expanded to many Gigabytes to hold the last million print jobs.

Go to printer, jobs, show completed jobs. Some are already postscript, some are direct printed. So long as, like you show, people print to ps transparently, you should be good to go. Since ANY user can already connect to the print log and restart their OWN prints, you may be surprised that 95% of what you want is already there.

The naming of the file would be preserved because instead of, say ghostview creating kgostviewtempaa1.ps, the actual ps would be sent to CUPs.

RO

NOTE: Once you find where the .ps files are stored, it would be easy to back them up to an archive/disk periodically.

Last edited by RolledOat; 08-29-2003 at 02:19 PM.
 
Old 08-29-2003, 02:31 PM   #3
AcerKev
Member
 
Registered: Aug 2003
Location: Nottingham
Distribution: XP SP2, Vista, Mandrake/iva 9.2 - 2007
Posts: 50

Original Poster
Rep: Reputation: 15
We don't want users to go to cups to restart (they can't see it (the print server) via IP from their network, only via IPX), as the documents are listed as "PRINTIE-965" or such like i just assumed they would be in files like that (most also have the file name)

The idea is a repositry of documents can be printed by anyone in the company, regardless of weather or not they have Word or some propriatory app on their machine. - The basic plan is to replace the photocopier as it spends 95% of it;s time copying the same 20 or so word and propriatory docs

As far as cups is concered all the users are nwuser anyway (everything is (will be) done via MARS_NWE).

Can't wait till Monday to try this, i hope it works - Will save buying a printer with a bardcode scanner and harddrive in it and any printer can be used when the main one breaks down again
 
Old 08-29-2003, 03:37 PM   #4
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Hmmm, well, how about this. Everyone prints to PSPRINTER, which puts the file in, say,
/common/printjobs/<user>/Filename.ps
a cron comes through every minute, searches for new print jobs in /common/printjobs/
sends all prints to the appropriate print server and then creates a backup for anyone to print at
/mnt/NFS/DocumentArchice/Alphabetic
and at
/mnt/NFSpath/DocumentArchive/ByUser/
with each user having a subdirectory number the 'ByUser' directory.

I am assuming that people would print to the regular printer for things such as emails they get, or their grocery list, etc. You don't want to add all those the central repository, and only completed, archiveable docs would go to PSPRINTER.

Probably an easier method, is to simply teach people who to 'Print to File', and create an easy way to navigate to the archive directory to 'store' it.

RO
 
Old 08-29-2003, 04:34 PM   #5
AcerKev
Member
 
Registered: Aug 2003
Location: Nottingham
Distribution: XP SP2, Vista, Mandrake/iva 9.2 - 2007
Posts: 50

Original Poster
Rep: Reputation: 15
Ceratainly sounds do-able

For Clarification the plan is :

Convert to "Live" print server to the MARS_NWE/Samba/Cups/Mandrake9.1 box

Set the following printers up on all the machines (Windows)

LOCAL PRINTER (Default) - The Department Printer (about 5 different ones)
NETWORK PRINTER - Large Jobs
PAYROLL PRINTER - Required for Postscript out put from our legacy programmes. (and Payroll!)
COLOUR PRINTER - Colour Output
ARCHIVE PRINTER - The postscript "Printer"

Then for the stuff to go into the archive they would select the bottom one and for other stuff they would select the required printer. - This would allow them to print central repository and "regular" jobs in the same way

Once the repository jobs have been recived on the Linux box by MARS/Cups, Cron would pick the ARCHIVE_PRINTER PostScript files and move them to : /home/archive/AAA/###/Description

where the filename would have originally been (example)
AAA452_Quote.doc

i.e the document would live at
/home/archive/AAA/452/Quote.doc.ps

Then to print, the user goes to a repository webpage, Enters the job code
[AAA452]
Selects the Printer
[ACCOUNTS_LOCAL]
This retives a list of associated documents -
Quote.doc
Plan.xls
Kit.afm
Presentation.ppt
Questionaire.doc

Then they click on one, the server then issues the command

lp -d ACCOUNTS_LOCAL -h PRINTSERVER /home/archive/AAA/452/Quote.doc.ps

This means that we can be sure every document that is printed would be identical - i.e. no dodgy OpenOffice reformatting that we currently suffer and no need for MS Office for those who print about 2 word docs a year

Also this would allow the development team to print standard docs from our Linux boxes, our MD from his MAC, or our remote users could even print a few documents and get someone in the office to send them out, rather than the current hassle of e-mailing

Print to file has been considered, but not accepted, but if this way works i could save the company some money A great way to end the year, and yet another thing i can add on my CV.

And to think just under 12 months ago I HATED Linux with a passion - now i love it's power and flexability (shame i only begin to understand this 3 months before i leave!) -if this works a switch to Linux in 24 months for many users would be a strong possibility - the DOS programme is being phased out and will be gone by then - everything else is Webbased - apart from a VB App that is likly to be ported to Delphi/Kylix soon....

Last edited by AcerKev; 08-29-2003 at 04:37 PM.
 
Old 08-29-2003, 06:08 PM   #6
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Quote:
Originally posted by AcerKev
-if this works a switch to Linux in 24 months for many users would be a strong possibility - the DOS programme is being phased out and will be gone by then - everything else is Webbased - apart from a VB App that is likly to be ported to Delphi/Kylix soon....
Linux offers direct print to PDF, which would mean smaller files too and much more widespread viewing support.

RO
 
Old 08-29-2003, 06:20 PM   #7
AcerKev
Member
 
Registered: Aug 2003
Location: Nottingham
Distribution: XP SP2, Vista, Mandrake/iva 9.2 - 2007
Posts: 50

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by RolledOat
Linux offers direct print to PDF, which would mean smaller files too and much more widespread viewing support.
RO
I love that feature in OOo, but i doubt Linux migration will be a possiblity for a few years until OOo can open, format and save Word Docs 100% perfect

Heck some of our clients (big UK companys) are still using Netscape 4.2 and IE4!
 
Old 09-05-2003, 10:41 AM   #8
AcerKev
Member
 
Registered: Aug 2003
Location: Nottingham
Distribution: XP SP2, Vista, Mandrake/iva 9.2 - 2007
Posts: 50

Original Poster
Rep: Reputation: 15
Here's what i did to get it working (found on experts exchange)

cd /usr/lib/cups/backend
vi arch

the file arch had the contents of
------------
#!/bin/sh
cat $6 > "/home/netware/archive/$3.ps"
----------
chmod 777 arch
mkdir /home/netware/archive/
chmod 777 /home/netware/archive/

for reference this creates a ps file with the original file name (for a word doc this may be "Microsoft Word - document1.doc.ps")


$0 - name of the script
$1 - job number
$2 - user
$3 - filename
$4 - number of copies
$5 - ?
$6 - spooler file name

vi /etc/conf/printers.conf

At the top add a new Printer (i.e. before the first printer)
<Printer Arch>
Info Arch
DeviceURI arch.sh
State Idle
Accepting Yes
Jobsheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</printer>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Generate files using bash kaon Linux - General 1 03-08-2005 02:59 PM
galeon + cups + postscript + epson + printer mattmatteh Linux - Software 0 09-30-2004 11:19 PM
Slackware 9.1 + cups + postscript printer ..how should I go about it linuxlah Slackware 6 02-17-2004 08:35 AM
Foomatic: How to generate ppd drivers from xml files? johnny1959 Linux - Newbie 0 02-17-2004 05:27 AM
open postscript files in firebird dustinwu Linux - Software 0 01-30-2004 03:09 AM


All times are GMT -5. The time now is 05:47 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration