define device for printing on a file

Good morning,

I don’t know if it’s the right forum but I try here.

I need to define a device for printing on a file positioned in a subdir defined by me.

Can anyone help me please?

Thanks a lot

A quick look at the KDE options suggests that this is not possible in KDE because there is no option to define the output device. However, ghostscript does have such an option, see gs --help for details.

I assume that, if you call ghostscript from the subdir, it will leave the output there.

AFAICT you might be making things more difficult that they are:

In almost every app I see, in the list of available printers, an option to print to file, i.e. .ps or .pdf
LibreOffice apps have the option to export to pdf

On 2012-05-15 09:16, bonovox73 wrote:
>
> Good morning,
>
> I don’t know if it’s the right forum but I try here.
>
> I need to define a device for printing on a file positioned in a subdir
> defined by me.

All Linux applications print to postscript file which is then sent to the
printer system for processing.

If what you want is the binary stream that is sent to the printer port,
that’s different, there is no normal access to it.

If this is not what you mean, please explain again.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I’m going to explain:
Before migrate on linux suse system, some applications of my farm run on Solaris O.S.
With command “lpadmin” I configured a print device that printed on file placed in a subdir.
This was a printer and when selected, the output was sent not to a phisical device but to the file in that subfolder.
Now I need to do the same in my new linux environment so I’m looking to find instructions, command line or cups configuration for having the same result as in Solaris environment.

Am 15.05.2012 15:06, schrieb bonovox73:
>
> I’m going to explain:
> Before migrate on linux suse system, some applications of my farm run
> on Solaris O.S.
> With command “lpadmin” I configured a print device that printed on file
> placed in a subdir.
> This was a printer and when selected, the output was sent not to a
> phisical device but to the file in that subfolder.
> Now I need to do the same in my new linux environment so I’m looking to
> find instructions, command line or cups configuration for having the
> same result as in Solaris environment.
>
>
The package cups-client contains the command /usr/sbin/lpadmin. I never
used it, but if you are lucky you can do the same with it you did on
Solaris maybe.
Did you already try it?


PC: oS 12.1 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.3 | GeForce GT 420
ThinkPad E320: oS 12.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.3 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

Yes of course I’ve already tried and it returned an error.
Is for this reason that I’m writing on this forum looking for an help

On 2012-05-15 15:46, bonovox73 wrote:
>
> Yes of course I’ve already tried and it returned an error.

What error?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

bonovox73 wrote:
> Yes of course I’ve already tried and it returned an error. Is for
> this reason that I’m writing on this forum looking for an help

Well that sounds like a very critical reply to Martin. Who only had to
make the helpful suggestion because you hadn’t told us that you had
tried that program. Even now you haven’t told us what the error message
was, so we have no idea whether it is something that can be fixed or a
fundamental limitation. In short, you’re not helping yourself with your
current approach to the forum.

As Carlos said, programs produce postscript. Most of the print dialogs
have a check box or suchlike to save the postscript to a file. So
there’s no need to create any device or anything, just select the
checkbox and choose where to save the file.

On 2012-05-15 15:06, bonovox73 wrote:

> Now I need to do the same in my new linux environment so I’m looking to
> find instructions, command line or cups configuration for having the
> same result as in Solaris environment.

have a
look here

There are two replies.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2012-05-15 16:16, Dave Howorth wrote:
> As Carlos said, programs produce postscript. Most of the print dialogs
> have a check box or suchlike to save the postscript to a file. So
> there’s no need to create any device or anything, just select the
> checkbox and choose where to save the file.

There can be. Once I captured a bunch of flash screens in firefox by
printing them to a file - but as flash prints directly with no dialog, I
had to change the default printer to one that saved the file in a directory

  • always the same file, mind. I think I used the trick I saw in the post
    link sent some minutes ago.

But it is an exception, caused by proprietary software in this case.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 05/15/2012 03:06 PM, bonovox73 wrote:
> some applications of my farm run on Solaris O.S

did you migrate from Solaris to SUSE Linux Enterprise Server or Destop,
or to openSUSE…there is a difference…

and which version are you using?

if not certain, please run the following in a terminal:

please show us the terminal input/output from


cat /etc/SuSE-release

and, as well, if a desktop system is in use please identify it…


dd

Sorry for my answer, I was not well expressed.
I thanks very much Martin for his help and also all members of this forum.

This is the command that I used from Solaris O.S. and I tried in suse system

illinois:~ # lpadmin -p filesap -v /EDI/P2F/print2file

and this is the messages (that is not properely an error but I don’t know how to do) generated immediately after run the command

lpadmin: File device URIs have been disabled! To enable, see the FileDevice directive in “/etc/cups/cupsd.conf”.


From Solaris I used a little procedure:

lpadmin -p <print_name> -v <file2print>
lpadmin -p <print_name> -T unknown -I any
accept <print_name>
enable <print_name>

after, with command “lpstat -t” I could see my new printer just defined.

So I think that also in suse may be a similar procedure.
Otherwise it is possible do the same with samba or cups.
I’m reading a lot of docu from network

Christian

This is the output of the command:

cat /etc/SuSE-release

SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 1

May be a news:

I’ve added in cupsd.conf file this entry:
FileDevice yes
and I restarted cups deamon.

Now the command lpstat -p… doesn’t return any message…

Am 15.05.2012 15:46, schrieb bonovox73:
>
> Yes of course I’ve already tried
Since youdi d not tell that before i had to ask.

> and it returned an error.
> Is for this reason that I’m writing on this forum looking for an help
>
>

Beside the natural question what error you get and what exact command(s)
you used (as already asked by others in the meantime) there seems to be
a simple solution with a tiny shell script which does what you want.

http://hints.macworld.com/article.php?story=20090527074203125

While this is for Mac I do not see any reason from a first look at it
why it should not work for Linux (after all it is a generic solution for
CUPS).
I have not tested it myself but think it is worth a try.

On 05/15/2012 04:56 PM, bonovox73 wrote:
>
> SUSE Linux Enterprise Server 11 (x86_64)

here, you really should be using the forums of the producer/supporter of
the commercial version…they are here: http://forums.suse.com/


dd

Hi
Look at the man page for lpadmin;


The CUPS version of lpadmin does not support all of the System V or
Solaris printing system configuration options.

Since your on SLE, as indicated please re-post your issue at
http://fourms.suse.com


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.1 (x86_64) Kernel 3.1.10-1.9-desktop
up 3 days 23:24, 4 users, load average: 0.03, 0.05, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

I’ve solved

Following the procedure to define a device on Suse linux for printing on a file

  1. Add ‘FileDevice Yes’ to /etc/cups/cupsd.conf
  2. Restart CUPs deamon
    /etc/init.d/cups restart
  3. Prepare folder tree and file with right owner and permissions
  4. Define the printer device with command line
    lpadmin –p <device_name> –v <file_2_print>
    accept <device_name>
    cupsenable <device_name>

Now the new device is visible with command lpstat -t and all jobs will be redirected to the file <print_2_file>