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 01-23-2009, 05:02 AM   #1
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Rep: Reputation: 15
Print to PDF


Hello,

Not sure if this is the right area for my post, so sorry if it is.

I am looking for information on how to setup a printer on my CentOS system so that when I print to it, it will be a PDF stored somewhere on the system.

I have looked at cups-pdf however when I tried it, it installed properly, but I was unable to create a new printer using the PDF printer they specified (Just wasn't there as an option for me).

Does anyone else have any other idea?

Thanks,
 
Old 01-23-2009, 05:21 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Recent versions of OpenOffice and Firefox on Linux are still able to print to a PDF file. Which is exactly your requirement? Do you want to be able to print to PDF from any application?
 
Old 01-23-2009, 05:29 AM   #3
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Recent versions of OpenOffice and Firefox on Linux are still able to print to a PDF file. Which is exactly your requirement? Do you want to be able to print to PDF from any application?
Hi,

thanks for your quick response.

I run a database application on CentOS/RedHat and other OS servers, and currently print various multiple page documents (Sometimes one, sometimes 51 pages) to normal physical printers.

I want these documents (Some sent in raw text, some are sent to postscript printers) to print to a 'pdf printer' where I can then pick the PDF's and email out to email addresses I specify.

Or left on the server for me to FTP into and pick up and place elsewhere.

Hope this helps.
 
Old 01-23-2009, 05:55 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Yes. It is clear now. Indeed, the multi-client requirement for specific applications makes the cups-pdf software suitable for the situation. How did you install it? Building from source or by a pre-compiled package? Have you restarted cups on the test machine after the set up?
 
Old 01-23-2009, 06:00 AM   #5
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Yes. It is clear now. Indeed, the multi-client requirement for specific applications makes the cups-pdf software suitable for the situation. How did you install it? Building from source or by a pre-compiled package? Have you restarted cups on the test machine after the set up?
I am using the source from this website:

http://www.physik.uni-wuerzburg.de/~...download.shtml

Then within the SRC directory (After I have un-tar it) It has the cups-pdf.h
cups-pdf.c

Files in it.

I then do the following command:

gcc -O9 -s -o /usr/lib/cups/backend/cups-pdf cups-pdf.c

With no errors.
 
Old 01-23-2009, 06:34 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Well, maybe you missed some passage after that. Before going into details about the procedure, why not try to install from the RPM for CentOS? If using CentOS 5.x on a i386 machine, just download the cups-pdf package from here, then:
Code:
# rpm -Uvh cups-pdf-2.4.6-1.el5.i386.rpm
check if the requirements are met (caveats about root permissions of the backend, SElinux not interfering, etc.) and do a restart of the cups daemon.
Code:
# /etc/init.d/cups restart
after that, having accepted all the default values in /etc/cups/cups-pdf.conf, you will have Cups-PDF as a printer to select from applications, and the newly created PDF files will be placed onto the user's Desktop. The spool directory will be /var/spool/cups-pdf/SPOOL.

Last edited by colucix; 01-23-2009 at 06:48 AM. Reason: Forgotten to post the link
 
Old 01-23-2009, 07:04 AM   #7
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Well, maybe you missed some passage after that. Before going into details about the procedure, why not try to install from the RPM for CentOS? If using CentOS 5.x on a i386 machine, just download the cups-pdf package from here, then:
Code:
# rpm -Uvh cups-pdf-2.4.6-1.el5.i386.rpm
check if the requirements are met (caveats about root permissions of the backend, SElinux not interfering, etc.) and do a restart of the cups daemon.
Code:
# /etc/init.d/cups restart
after that, having accepted all the default values in /etc/cups/cups-pdf.conf, you will have Cups-PDF as a printer to select from applications, and the newly created PDF files will be placed onto the user's Desktop. The spool directory will be /var/spool/cups-pdf/SPOOL.
Thanks again for the reply.

I tried using the RPM and got message for missing files:

libc.so.6

Though it might be that I downloaded the incorrect one. Do CentOS themselves offer one?

I did however make a breakthrough doing it the other way. I copied the .ppd files that came with the .tar file into the default .ppd location.

If i then go into Webmin I can see the relevant file, but when I select to make a printer against it (/dev/null as the device) while I can print to it, and the job appears to leave the queue, it apparently should go to /var/spool/cups-pdf/SPOOL and then a subdirectory of the username who printed it. It doesn't.

Last edited by stuaz; 01-23-2009 at 07:15 AM.
 
Old 01-23-2009, 07:35 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
CentOS5.2 , no cups-pdf installed.

Isn't that a build-in function these days ?
When opening a text file with gedit and
clicking "Print", this option is shown :
" Create a PDF document ".

....

Another 'funny' thing : Printers connected
to another computer are shown too, also a
result of an automatic setup, probaly during
the OS install. And they just print via the
network cabling, no setup needed.
....
 
Old 01-23-2009, 07:39 AM   #9
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by knudfl View Post
CentOS5.2 , no cups-pdf installed.

Isn't that a build-in function these days ?
When opening a text file with gedit and
clicking "Print", this option is shown :
" Create a PDF document ".

....

Another 'funny' thing : Printers connected
to another computer are shown too, also a
result of an automatic setup, probaly during
the OS install. And they just print via the
network cabling, no setup needed.
....
Your right, you can do that through gedit but as far as I could tell cups-pdf was not installed before I started this.
 
Old 01-23-2009, 07:52 AM   #10
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by stuaz View Post
Thanks again for the reply.

I tried using the RPM and got message for missing files:

libc.so.6

Though it might be that I downloaded the incorrect one. Do CentOS themselves offer one?
CentOS offers the one you would install using yum if you enabled that exact repository I linked in my previous post (Fedora EPEL5). Maybe you've not downloaded the correct version, since libc.so.6 is provided by glibc which should be installed by default. My guess is that you're running on a 64-bit machine, while the link I provided was for 32-bit. In that case just go up to the parents directories until you can select x86_64.

Which CentOS release have you installed on your machine, anyway? If in doubt, post the output of the command lsb_release -a and uname -a.

Quote:
Originally Posted by stuaz View Post
I copied the .ppd files that came with the .tar file into the default .ppd location.
This is required if you just want to use the color Postscript driver coming with the package, instead of the system one. You don't really need it to print a colorful PDF. Furthermore, for what I can understand, you don't need to install a new printer via webmin. Just be sure the backend file is properly copied to the correct location with owner root and permissions 700 and the cups-pdf.conf is in place. Than simply restart the cups daemon. For your convenience, here is a list of the relevant files installed by the cups-pdf package on my CentOS box:
Code:
-rw-r--r-- 1 root root  8853 May  7  2007 /etc/cups/cups-pdf.conf
-rwx------ 1 root root 24524 May  7  2007 /usr/lib/cups/backend/cups-pdf
-rw-r--r-- 1 root root 20817 May  7  2007 /usr/share/cups/model/PostscriptColor.ppd
drwxr-xr-x 3 root root  4096 Jan 23 12:58 /var/spool/cups-pdf
drwxr-xr-x 2 root root  4096 Jan 23 14:39 /var/spool/cups-pdf/SPOOL
 
Old 01-23-2009, 08:26 AM   #11
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
CentOS offers the one you would install using yum if you enabled that exact repository I linked in my previous post (Fedora EPEL5). Maybe you've not downloaded the correct version, since libc.so.6 is provided by glibc which should be installed by default. My guess is that you're running on a 64-bit machine, while the link I provided was for 32-bit. In that case just go up to the parents directories until you can select x86_64.

Which CentOS release have you installed on your machine, anyway? If in doubt, post the output of the command lsb_release -a and uname -a.


This is required if you just want to use the color Postscript driver coming with the package, instead of the system one. You don't really need it to print a colorful PDF. Furthermore, for what I can understand, you don't need to install a new printer via webmin. Just be sure the backend file is properly copied to the correct location with owner root and permissions 700 and the cups-pdf.conf is in place. Than simply restart the cups daemon. For your convenience, here is a list of the relevant files installed by the cups-pdf package on my CentOS box:
Code:
-rw-r--r-- 1 root root  8853 May  7  2007 /etc/cups/cups-pdf.conf
-rwx------ 1 root root 24524 May  7  2007 /usr/lib/cups/backend/cups-pdf
-rw-r--r-- 1 root root 20817 May  7  2007 /usr/share/cups/model/PostscriptColor.ppd
drwxr-xr-x 3 root root  4096 Jan 23 12:58 /var/spool/cups-pdf
drwxr-xr-x 2 root root  4096 Jan 23 14:39 /var/spool/cups-pdf/SPOOL
[root@centos examples]# lsb_release
LSB Version: :core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch

Linux centos.mess 2.6.9-67.ELsmp #1 SMP Fri Nov 16 12:48:03 EST 2007 i686 i686 i
386 GNU/Linux

See above for lsb_release -a and uname -a.

I changed the permissions on the files you specified, restarted cups:

/sbin/service cups restart

Then did

lp -dprinter /etc/hosts

No output

In regards to the rpm this is the error i get when i install it using your command:

[root@centos sdennis]# rpm -Uvh cups-pdf-2.4.6-1.el5.i386\(2\).rpm
warning: cups-pdf-2.4.6-1.el5.i386(2).rpm: V3 DSA signature: NOKEY, key ID 21752
1f6
error: Failed dependencies:
libc.so.6(GLIBC_2.4) is needed by cups-pdf-2.4.6-1.el5.i386
rtld(GNU_HASH) is needed by cups-pdf-2.4.6-1.el5.i386
 
Old 01-23-2009, 08:42 AM   #12
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Why do people insist on installing the rpms manually?
Use the package management system in your Distribution, that will handle the dependencies automatically.

you also need the libc6 and glibc packages.

yum install cups-pdf

Then when you configure it in CUPS, you setup a Generic Postscript Printer choosing the cups-pdf device.. Done !
 
Old 01-23-2009, 08:46 AM   #13
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by farslayer View Post
Why do people insist on installing the rpms manually?
Use the package management system in your Distribution, that will handle the dependencies automatically.

you also need the libc6 and glibc packages.

yum install cups-pdf

Then when you configure it in CUPS, you setup a Generic Postscript Printer choosing the cups-pdf device.. Done !
When I run your command I get the below:

Code:
[root@centos SPOOL]# yum install cups-pdf
Setting up Install Process
Setting up repositories
epel                      100% |=========================| 2.1 kB    00:00
update                    100% |=========================|  951 B    00:00
base                      100% |=========================| 1.1 kB    00:00
addons                    100% |=========================|  951 B    00:00
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 1.3 MB    00:03
epel      : ################################################## 3717/3717
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for cups-pdf to pack into transaction set.
cups-pdf-2.4.6-1.el5.i386 100% |=========================|  10 kB    00:00
---> Package cups-pdf.i386 0:2.4.6-1.el5 set to be updated
--> Running transaction check
--> Processing Dependency: libc.so.6(GLIBC_2.4) for package: cups-pdf
--> Processing Dependency: rtld(GNU_HASH) for package: cups-pdf
--> Finished Dependency Resolution
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package cups-pdf
Error: Missing Dependency: rtld(GNU_HASH) is needed by package cups-pdf
[root@centos SPOOL]#
[root@centos SPOOL]# yum install cups-pdf
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package cups-pdf.i386 0:2.4.6-1.el5 set to be updated
--> Running transaction check
--> Processing Dependency: libc.so.6(GLIBC_2.4) for package: cups-pdf
--> Processing Dependency: rtld(GNU_HASH) for package: cups-pdf
--> Finished Dependency Resolution
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package cups-pdf
Error: Missing Dependency: rtld(GNU_HASH) is needed by package cups-pdf
 
Old 01-23-2009, 09:12 AM   #14
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
I realize that you already have at least a couple of contributors offering varying bits of advice, but from my Fedora/yum days, I believe that what's happening is that the attempted installation via yum is finding conflict(s) with the existing manual installation.

The same type of situation often arises when repositories are mixed.

Hence, you should remove your manual install (man rpm - I can quite remember the switches for removal), and then install via yum.

hth,
 
Old 01-23-2009, 09:18 AM   #15
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Did you configure yum properly ?

http://wiki.centos.org/PackageManagement/Yum/Priorities


mrclisdue has a valid point..

I think it's rpm -e <packagename> to remove a package manually.. man haven't done that in years..

Last edited by farslayer; 01-23-2009 at 09:20 AM.
 
  


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
Print to PDF yogaboy Linux - Desktop 12 02-17-2009 06:09 AM
Can't print pdf klee12 Linux - Software 2 07-24-2007 02:41 AM
Can't print to PDF tauro_kpo Linux - Software 2 05-12-2007 05:31 PM
Print-to-file print driver to print PDF Bill Fox Linux - General 3 05-02-2006 04:15 PM
Help! ...Cannot print PDF! Mike Stern Linux - Hardware 1 06-23-2004 09:44 PM

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

All times are GMT -5. The time now is 10:02 AM.

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