CUPS-PDF - Slackware

This is a discussion on CUPS-PDF - Slackware ; Hello, I'm using Slackware vrs. 10.1.0 (kernel 2.6.11.10) with CUPS vrs. 1.1.23. I installed CUPS-PDF vers. 2.4.6 because I want to print pdf-files on a vitual printer. Downloaded & compiled the sources, restarted CUPS, made a new printer in CUPS ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: CUPS-PDF

  1. CUPS-PDF

    Hello,

    I'm using Slackware vrs. 10.1.0 (kernel 2.6.11.10)
    with CUPS vrs. 1.1.23.
    I installed CUPS-PDF vers. 2.4.6 because I want to
    print pdf-files on a vitual printer.
    Downloaded & compiled the sources, restarted CUPS,
    made a new printer in CUPS ... So far so good.

    No errors in CUPS, no errors while compiling.
    Only ... it doesn't print pdf files!
    Lines in /var/log/cups/cups-pdf_log:

    Thu Jun 14 12:38:14 2007 [STATUS] identification string sent
    Thu Jun 14 12:38:14 2007 [STATUS] identification string sent
    Thu Jun 14 12:40:35 2007 [STATUS] identification string sent
    Thu Jun 14 12:40:35 2007 [STATUS] identification string sent
    Thu Jun 14 12:43:07 2007 [ERROR] failed to set file mode for PDF file
    (non fatal) (/var/spool/cups-pdf/root/Test_Page.pdf)
    Thu Jun 14 12:43:07 2007 [STATUS] PDF creation successfully finished (root)
    Thu Jun 14 12:48:36 2007 [ERROR] failed to set file mode for PDF file
    (non fatal) (/var/spool/cups-pdf/ANONYMOUS/Test_Page.pdf
    Thu Jun 14 12:48:36 2007 [STATUS] PDF creation successfully finished
    (nobody)

    Does anybody have experience with CUPS-PDF on
    Slackware?

    There is no "RunAsUser" entry in /etc/cups/cupsd.conf, but I tried
    adding "RunAsUser No", as well as "RunAsUser Yes" but it didn't had
    any effect ...


  2. Re: CUPS-PDF

    Jacq Witjes ha scritto:
    > Hello,
    >
    > I'm using Slackware vrs. 10.1.0 (kernel 2.6.11.10)
    > with CUPS vrs. 1.1.23.
    > I installed CUPS-PDF vers. 2.4.6 because I want to
    > print pdf-files on a vitual printer.
    > Downloaded & compiled the sources, restarted CUPS,
    > made a new printer in CUPS ... So far so good.
    >
    > No errors in CUPS, no errors while compiling.
    > Only ... it doesn't print pdf files!
    > Lines in /var/log/cups/cups-pdf_log:
    >
    > Thu Jun 14 12:38:14 2007 [STATUS] identification string sent
    > Thu Jun 14 12:38:14 2007 [STATUS] identification string sent
    > Thu Jun 14 12:40:35 2007 [STATUS] identification string sent
    > Thu Jun 14 12:40:35 2007 [STATUS] identification string sent
    > Thu Jun 14 12:43:07 2007 [ERROR] failed to set file mode for PDF file
    > (non fatal) (/var/spool/cups-pdf/root/Test_Page.pdf)
    > Thu Jun 14 12:43:07 2007 [STATUS] PDF creation successfully finished
    > (root)
    > Thu Jun 14 12:48:36 2007 [ERROR] failed to set file mode for PDF file
    > (non fatal) (/var/spool/cups-pdf/ANONYMOUS/Test_Page.pdf
    > Thu Jun 14 12:48:36 2007 [STATUS] PDF creation successfully finished
    > (nobody)
    >
    > Does anybody have experience with CUPS-PDF on
    > Slackware?
    >
    > There is no "RunAsUser" entry in /etc/cups/cupsd.conf, but I tried
    > adding "RunAsUser No", as well as "RunAsUser Yes" but it didn't had
    > any effect ...
    >


    Did You try "UserUMask 0000" and not 0022...?
    and "Out /pdf" and then "chmod 0777 /pdf".

    Giulio

  3. Re: CUPS-PDF

    Giulio schreef:

    > Did You try "UserUMask 0000" and not 0022...?
    > and "Out /pdf" and then "chmod 0777 /pdf".
    >
    > Giulio


    I didn't, but now I did
    However, same problem ...

    Thu Jun 14 21:00:38 2007 [STATUS] directory created (/pdf)
    Thu Jun 14 21:00:38 2007 [ERROR] failed to set file mode for PDF file
    (non fatal) (/pdf/Test_Page.
    Thu Jun 14 21:00:38 2007 [STATUS] PDF creation successfully finished (root)
    Thu Jun 14 21:00:55 2007 [ERROR] failed to set file mode for PDF file
    (non fatal) (/pdf/Test_Page.
    Thu Jun 14 21:00:55 2007 [STATUS] PDF creation successfully finished (root)

    and /pdf = drwxrwxrwx
    "UserUMask" 0000 in /etc/cups/cups-pdf.conf, right?


    ### Key: UserUMask
    ## umask for user output of known users
    ## changing this can introduce security leaks if confidential
    ## information is processed!
    ### Default: 0077

    #UserUMask 0077
    UserUMask 0000






  4. Re: CUPS-PDF

    On Thu, 14 Jun 2007 13:03:45 +0200, Jacq Witjes wrote:

    > Hello,
    >
    > I'm using Slackware vrs. 10.1.0 (kernel 2.6.11.10) with CUPS vrs.
    > 1.1.23.
    > I installed CUPS-PDF vers. 2.4.6 because I want to print pdf-files on a
    > vitual printer.
    > Downloaded & compiled the sources, restarted CUPS, made a new printer in
    > CUPS ... So far so good.
    >
    > No errors in CUPS, no errors while compiling. Only ... it doesn't print
    > pdf files!
    > Lines in /var/log/cups/cups-pdf_log:
    >
    > Thu Jun 14 12:38:14 2007 [STATUS] identification string sent Thu Jun 14
    > 12:38:14 2007 [STATUS] identification string sent Thu Jun 14 12:40:35
    > 2007 [STATUS] identification string sent Thu Jun 14 12:40:35 2007
    > [STATUS] identification string sent Thu Jun 14 12:43:07 2007 [ERROR]
    > failed to set file mode for PDF file (non fatal)
    > (/var/spool/cups-pdf/root/Test_Page.pdf) Thu Jun 14 12:43:07 2007
    > [STATUS] PDF creation successfully finished (root) Thu Jun 14 12:48:36
    > 2007 [ERROR] failed to set file mode for PDF file (non fatal)
    > (/var/spool/cups-pdf/ANONYMOUS/Test_Page.pdf Thu Jun 14 12:48:36 2007
    > [STATUS] PDF creation successfully finished (nobody)
    >
    > Does anybody have experience with CUPS-PDF on Slackware?
    >
    > There is no "RunAsUser" entry in /etc/cups/cupsd.conf, but I tried
    > adding "RunAsUser No", as well as "RunAsUser Yes" but it didn't had any
    > effect ...


    Hello,
    try:
    chmod 0700 /usr/lib/cups/backend/cups-pdf

    This is a known bug of install scripts for cups-pdf
    Regards,
    Thierry

  5. Re: CUPS-PDF

    Thierry MERLE schreef:

    > Hello,
    > try:
    > chmod 0700 /usr/lib/cups/backend/cups-pdf
    >
    > This is a known bug of install scripts for cups-pdf
    > Regards,
    > Thierry


    Hello Thierry,

    Tried that too, it says so in the manual in case your cups
    version is 1.2.0 or higher, but it still doesn't print pdf
    and still the same error.

    I tried chmod & chgrp on /usr/lib/cups/backend/cups-pdf:

    -rwxr-xr-x 1 root root 37692 2007-06-14 12:36 cups-pdf*
    -rwxr-xr-x 1 root lp 37692 2007-06-14 12:36 cups-pdf*
    -rwxrwxrwx 1 root root 37692 2007-06-14 12:36 cups-pdf*
    -rwx------ 1 root root 37692 2007-06-14 12:36 cups-pdf*

    No effect.

    When I print I can see a spoolfile is created by cups in
    /var/spool/cups/ as:
    -rw------- 1 root sys 578 2007-06-14 23:17 c02110
    but that is as far as it goes ...


  6. Re: CUPS-PDF

    Jacq Witjes wrote:
    > I installed CUPS-PDF vers. 2.4.6 because I want to print pdf-files on a
    > vitual printer.


    I have no experience from cups, but maybe something like this would be
    useful:

    Instead of doing lpr file do:

    cat file | a2ps -q -o - --columns=1 -R | ps2pdf - > file.pdf

    With the old lprng it is rather easy to write a filter that does things
    like the above if you want a .pdf file instead of sending the job to a
    printer. Maybe it is possible to write filters also for cups?

    regards Henrik
    --
    The address in the header is only to prevent spam. My real address is:
    hc1(at)poolhem.se Examples of addresses which go to spammers:
    root@localhost postmaster@localhost


  7. Re: CUPS-PDF

    Jacq Witjes wrote:

    > Hello,
    >
    > I'm using Slackware vrs. 10.1.0 (kernel 2.6.11.10)
    > with CUPS vrs. 1.1.23.
    > I installed CUPS-PDF vers. 2.4.6 because I want to
    > print pdf-files on a vitual printer.
    > Downloaded & compiled the sources, restarted CUPS,
    > made a new printer in CUPS ... So far so good.
    >
    > No errors in CUPS, no errors while compiling.
    > Only ... it doesn't print pdf files!
    > Lines in /var/log/cups/cups-pdf_log:
    >
    > Thu Jun 14 12:38:14 2007 [STATUS] identification string sent
    > Thu Jun 14 12:38:14 2007 [STATUS] identification string sent
    > Thu Jun 14 12:40:35 2007 [STATUS] identification string sent
    > Thu Jun 14 12:40:35 2007 [STATUS] identification string sent
    > Thu Jun 14 12:43:07 2007 [ERROR] failed to set file mode for PDF file
    > (non fatal) (/var/spool/cups-pdf/root/Test_Page.pdf)
    > Thu Jun 14 12:43:07 2007 [STATUS] PDF creation successfully finished
    > (root)
    > Thu Jun 14 12:48:36 2007 [ERROR] failed to set file mode for PDF file
    > (non fatal) (/var/spool/cups-pdf/ANONYMOUS/Test_Page.pdf
    > Thu Jun 14 12:48:36 2007 [STATUS] PDF creation successfully finished
    > (nobody)
    >
    > Does anybody have experience with CUPS-PDF on
    > Slackware?
    >
    > There is no "RunAsUser" entry in /etc/cups/cupsd.conf, but I tried
    > adding "RunAsUser No", as well as "RunAsUser Yes" but it didn't had
    > any effect ...


    If you are willing to use a solution that is not CUPS-PDF I have two
    solutions.

    If you are running X and have kprinter installed you will then be able to
    print to any of your printers, mail a pdf (using kmail), save as a pdf,
    save as ps, or fax(using kdeprintfax).

    I have not found any documentation on how to do it completely from the
    command line but the following command will give a dialog asking where you
    want to save your pdf documenting the current slackware version you are
    running.

    kprinter --nodialog -P "Print to File (PDF)" /etc/slackware-version

    here is a way to create a printer in cups that outputs PDFs.
    http://www.linuxquestions.org/linux/...e_in_Slackware

    --

    ed

  8. Re: CUPS-PDF

    On Thu, 14 Jun 2007 23:31:14 +0200, Jacq Witjes wrote:

    > Thierry MERLE schreef:
    >
    >> Hello,
    >> try:
    >> chmod 0700 /usr/lib/cups/backend/cups-pdf
    >>
    >> This is a known bug of install scripts for cups-pdf Regards,
    >> Thierry

    >
    > Hello Thierry,
    >
    > Tried that too, it says so in the manual in case your cups version is
    > 1.2.0 or higher, but it still doesn't print pdf and still the same
    > error.
    >
    > I tried chmod & chgrp on /usr/lib/cups/backend/cups-pdf:
    >
    > -rwxr-xr-x 1 root root 37692 2007-06-14 12:36 cups-pdf* -rwxr-xr-x 1
    > root lp 37692 2007-06-14 12:36 cups-pdf* -rwxrwxrwx 1 root root 37692
    > 2007-06-14 12:36 cups-pdf* -rwx------ 1 root root 37692 2007-06-14
    > 12:36 cups-pdf*
    >
    > No effect.
    >
    > When I print I can see a spoolfile is created by cups in
    > /var/spool/cups/ as:
    > -rw------- 1 root sys 578 2007-06-14 23:17 c02110
    > but that is as far as it goes ...


    Oops OK, well this worked for me but it was another error :P
    On my system, the pdf file is written on /var/spool/cups-pdf/$USER/bla.pdf
    In /var/spool/cups/ all files are user=root group=lp, different from you
    but I don't know why it is different.
    Do you have a lp group in /etc/group?
    In /etc/cups/cups-pdf.conf I have:
    Out /var/spool/cups-pdf/${USER}
    AnonDirName /var/spool/cups-pdf/ANONYMOUS
    Spool /var/spool/cups-pdf/SPOOL
    In /etc/cups/cupsd.conf you can try to put loglevel to debug to see some
    debug outputs:
    LogLevel debug
    You have to restart the cups daemon:
    /etc/rc.d/rc.cups restart

    Thierry

  9. Re: CUPS-PDF, think I got something

    Thierry MERLE schreef:

    >
    > Oops OK, well this worked for me but it was another error :P
    > On my system, the pdf file is written on /var/spool/cups-pdf/$USER/bla.pdf


    Yeah, that's default

    > In /var/spool/cups/ all files are user=root group=lp, different from you
    > but I don't know why it is different.
    > Do you have a lp group in /etc/group?


    Yep.
    I have in /etc/cups/cupsd.conf:

    #
    # User/Group: the user and group the server runs under. Normally this
    # must be lp and sys, however you can configure things for another
    # user or group as needed.
    #
    # Note: the server must be run initially as root to support the
    # default IPP port of 631. It changes users whenever an external
    # program is run, or if the RunAsUser directive is specified...
    #

    #User lp
    #Group sys

    And in /etc/cups/cups-pdf.conf:

    ### Key: Grp
    ## group cups-pdf is supposed to run as - this will also be the gid for all
    ## created directories and log files
    ### Default: lp

    #Grp lp

    That's why.

    > In /etc/cups/cups-pdf.conf I have:
    > Out /var/spool/cups-pdf/${USER}
    > AnonDirName /var/spool/cups-pdf/ANONYMOUS
    > Spool /var/spool/cups-pdf/SPOOL
    > In /etc/cups/cupsd.conf you can try to put loglevel to debug to see some
    > debug outputs:
    > LogLevel debug
    > You have to restart the cups daemon:
    > /etc/rc.d/rc.cups restart
    >
    > Thierry


    Me too & did that all too ... but I think I foud why.
    I studied cups-pdf.c, the source file which comes with the download
    and which must be compiled to /usr/lib/cups/backend/cups-pdf.
    I searched for the error message and came along this section:

    (void) umask(0077);
    size=system(gscall);
    snprintf(title,BUFSIZE,"%d",size);
    log_event(CPDEBUG, "ghostscript has finished", title);
    if (chmod(outfile, mode)) {
    log_event(CPERROR, "failed to set file mode for PDF file (non
    fatal)", outfile);
    return -101;
    }

    I think the error will also occur when there is no file to chmod at all.
    So, the error message is confusing .. we think of a permission issue,
    but in fact there is another problem because there is no file created.
    Only cups-pdf does not give an error message in the log file for that.

    Anyway, thanks to Henrik.Carlqvist I also tried ps2pdf and found out
    that my gs (GhostScript) is not working!
    Cups-pdf also uses GostScript, so ...
    When I try:

    # gs -h

    I get:

    gs: error while loading shared libraries: libXt.so.6: cannot open shared
    object file: No such file or directory

    So ... I have something else to do first.

    Well, thanks everybody.
    Oh, and I will look into ps2pdf and kprinter as well.











  10. Re: CUPS-PDF, think I got something

    Jacq Witjes wrote:
    > Anyway, thanks to Henrik.Carlqvist I also tried ps2pdf and found out
    > that my gs (GhostScript) is not working!
    > Cups-pdf also uses GostScript, so ...


    That could explain why cups-pdf is unable to create any file.

    > When I try:
    >
    > # gs -h
    >
    > I get:
    >
    > gs: error while loading shared libraries: libXt.so.6: cannot open shared
    > object file: No such file or directory
    >
    > So ... I have something else to do first.


    Is X installed on your machine? The files libXt.so.* are part of the X
    libraries. Those files are needed by gs as gs was compiled to also use an
    X window as an output. A snippet from "ldd gs":

    ldd /usr/bin/gs
    libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x4002d000)
    libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x4007e000)
    libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4008c000)
    libpng.so.3 => /usr/lib/libpng.so.3 (0x40156000)
    libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40182000)
    ....

    regards Henrik
    --
    The address in the header is only to prevent spam. My real address is:
    hc1(at)poolhem.se Examples of addresses which go to spammers:
    root@localhost postmaster@localhost


  11. Re: CUPS-PDF, problem solved

    Henrik Carlqvist schreef:

    > Is X installed on your machine? The files libXt.so.* are part of the X
    > libraries. Those files are needed by gs as gs was compiled to also use an
    > X window as an output. A snippet from "ldd gs":
    >
    > ldd /usr/bin/gs
    > libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x4002d000)
    > libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x4007e000)
    > libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4008c000)
    > libpng.so.3 => /usr/lib/libpng.so.3 (0x40156000)
    > libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40182000)
    > ...
    >
    > regards Henrik


    No, didn't have X on my machine(s).
    They are server only, and the applications I run are character
    oriented ... BUT:

    I installed the x11-6.8.2-i486-10_slack10.2.tgz pakkage
    and everything runs fine now!

    Thanks everyone!



+ Reply to Thread