LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 04:18 PM   #31
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

This can be accomplished using pdftk. Suppose you have a letterhead in header.pdf and the invoice in invoice.pdf. Merging them into a single pdf (e.g. document.pdf) is as easy as
Code:
pdftk invoice.pdf output document.pdf background header.pdf
 
Old 01-23-2009, 05:35 PM   #32
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Interesting.. Learn something new every day..
 
Old 01-24-2009, 07:30 AM   #33
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
This can be accomplished using pdftk. Suppose you have a letterhead in header.pdf and the invoice in invoice.pdf. Merging them into a single pdf (e.g. document.pdf) is as easy as
Code:
pdftk invoice.pdf output document.pdf background header.pdf
Yes I actually came accross this 'pdftk' and just installed it on my
server:

When I type 'pdftk' at the command line I get:

Code:
[root@centos lib]# pdftk
pdftk: error while loading shared libraries: libgcj.so.4: cannot open shared object file: No such file or directory
But if I look for the library it states it is missing:

Code:
[root@centos /]# cd /lib/ssa
[root@centos ssa]# ls -l
total 9092
lrwxrwxrwx  1 root root      15 Sep  1 00:51 libgcj.so -> libgcj.so.4.0.0
lrwxrwxrwx  1 root root      15 Sep  1 00:51 libgcj.so.4 -> libgcj.so.4.0.0
-rwxr-xr-x  1 root root 9287192 May 22  2007 libgcj.so.4.0.0
drwxr-xr-x  2 root root    4096 Sep  1 00:51 security
As you can clearly tell I am a bit of a Linux noob, so any ideas how to solve this issue.

Note: I didn't get any errors during installation.

Last edited by stuaz; 01-24-2009 at 07:34 AM.
 
Old 01-24-2009, 07:48 AM   #34
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
Note: I didn't get any errors during installation.
Maybe this is due to the fact that the required library is not in a package marked as a dependency for the pdftk package and the error is triggered in runtime only. Anyway, as already mentioned by farslayer in a previous post, better to use the yum package manager from the command line (in place of rpm) since it takes care of dependencies.

Using yum you can also query for the package that provides the missing file, for example using:
Code:
yum whatprovides libgcj.so.4
if yum finds a suitable package, you can install it using yum install. Take a look at man yum for a list of the available yum commands.

Regarding the libgcj.so.4 shared library in CentOS, you should find it in a package with the same name: libgcj.
 
Old 01-24-2009, 02:42 PM   #35
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Maybe this is due to the fact that the required library is not in a package marked as a dependency for the pdftk package and the error is triggered in runtime only. Anyway, as already mentioned by farslayer in a previous post, better to use the yum package manager from the command line (in place of rpm) since it takes care of dependencies.

Using yum you can also query for the package that provides the missing file, for example using:
Code:
yum whatprovides libgcj.so.4
if yum finds a suitable package, you can install it using yum install. Take a look at man yum for a list of the available yum commands.

Regarding the libgcj.so.4 shared library in CentOS, you should find it in a package with the same name: libgcj.
Thanks again Colucix.

Unfortunalty any of the RPM's I use result in failed dependencies, and if I use yum, it just states there is a missing dependcency - and thats it. Doesnt't install it.

It may be that I am downloading the wrong RPM for my build I'm not sure.

My other alternative is to try and build it from the binary but that just seems a bit drastic when surely it is possible to do this on CentOS from an RPM.
 
Old 01-24-2009, 03:17 PM   #36
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
Hmmm... I suspect an erroneous configuration of the yum repositories. Take a look at /etc/yum.repos.d/. Here you will find the configuration files for all the repositories used by yum when retrieving packages from internet. There is a chance that some URLs have to be updated, since CentOS 4 is a bit old release. If the upgrade (or new install) of the whole system is not a possibility, at least you have to fix the yum repositories. Check the CentOS wiki for some useful information about package management.

In the meanwhile, please, post the content of /etc/yum.repos.d/CentOS-Base.repo so that I can take a look and tell you if there is a typo somewhere or if there is a macroscopic bug to fix. Please, post also the output of
Code:
lsb_release -r
so we can finally see the exact release running on the system.

Last edited by colucix; 01-24-2009 at 03:19 PM.
 
Old 01-24-2009, 03:41 PM   #37
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Hmmm... I suspect an erroneous configuration of the yum repositories. Take a look at /etc/yum.repos.d/. Here you will find the configuration files for all the repositories used by yum when retrieving packages from internet. There is a chance that some URLs have to be updated, since CentOS 4 is a bit old release. If the upgrade (or new install) of the whole system is not a possibility, at least you have to fix the yum repositories. Check the CentOS wiki for some useful information about package management.

In the meanwhile, please, post the content of /etc/yum.repos.d/CentOS-Base.repo so that I can take a look and tell you if there is a typo somewhere or if there is a macroscopic bug to fix. Please, post also the output of
Code:
lsb_release -r
so we can finally see the exact release running on the system.
An upgrade to CentOS 5 is out of the question, so I need to make it work with CentOS 4.

Code:
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#released updates
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1
And:

Code:
[root@centos yum.repos.d]# lsb_release -r
Release:        4.6
Thanks again for the help

Last edited by stuaz; 01-24-2009 at 03:44 PM.
 
Old 01-26-2009, 07:14 AM   #38
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Slightly different question to ask:

But when you install the cups-pdf applicaton it automatically creates a printer called "cups-pdf" and that prints to a local file of "cups-pdf:/" and uses a driver which it also installed.

With some of my print outs I manipulate the data, by using my own drivers to move the printout around the page (Set the margins, etc), is there a way I can create another pdfprinter which does the same job, but rather than using the driver the pdfprinter uses it uses one of mine.

I tried to create myself a printer though webmin and CentOS GUI but it rejects it because cups-pdf:/ is not a file.

Thanks,
 
Old 01-26-2009, 08:08 AM   #39
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by stuaz View Post
Slightly different question to ask:

But when you install the cups-pdf applicaton it automatically creates a printer called "cups-pdf" and that prints to a local file of "cups-pdf:/" and uses a driver which it also installed.

With some of my print outs I manipulate the data, by using my own drivers to move the printout around the page (Set the margins, etc), is there a way I can create another pdfprinter which does the same job, but rather than using the driver the pdfprinter uses it uses one of mine.

I tried to create myself a printer though webmin and CentOS GUI but it rejects it because cups-pdf:/ is not a file.

Thanks,
I managed to hack together a printer so that it prints to one of my printer drivers but unfortunatly it just creates a blank PDF.

Is the pdfdriver that the default installation uses the only one, and you can edit it? I.e change the CPI/LPI etc??

or can i change the .ppd file for the Cups-PDF printer to edit the CPI or LPI ?

Last edited by stuaz; 01-26-2009 at 08:17 AM.
 
Old 01-26-2009, 09:00 AM   #40
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If I run kprinter on openSuSE, there is a "print to PDF" in the printer selector drop down box. I don't have a cups-pdf package available.
Code:
sudo grep pdf *
root's password:
mime.convs:application/pdf              application/postscript  33      pdftops
mime.types:application/pdf                      pdf string(0,%PDF)
mime.types:application/vnd.cups-pdf
Is the cups-pdf package necessary? The pdftops program is used to convert ps to pdf and vice-versa. It is supplied (on my system) by an xpdf-tools option.

Since you are converting raw text output to pdf files, using enscript or a2ps and then ps2pdf may be appropriate. It would add page numbers, date, filename and you can add a suitable title to output. I do this at work to take a dvd backup listing, convert to csv files, sort and produce a pdf backup catalog.
 
Old 01-26-2009, 09:23 AM   #41
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
If I run kprinter on openSuSE, there is a "print to PDF" in the printer selector drop down box. I don't have a cups-pdf package available.
Code:
sudo grep pdf *
root's password:
mime.convs:application/pdf              application/postscript  33      pdftops
mime.types:application/pdf                      pdf string(0,%PDF)
mime.types:application/vnd.cups-pdf
Is the cups-pdf package necessary? The pdftops program is used to convert ps to pdf and vice-versa. It is supplied (on my system) by an xpdf-tools option.

Since you are converting raw text output to pdf files, using enscript or a2ps and then ps2pdf may be appropriate. It would add page numbers, date, filename and you can add a suitable title to output. I do this at work to take a dvd backup listing, convert to csv files, sort and produce a pdf backup catalog.

So is what your suggestin (if I am understanding this correctly), that the best course of action would be to print to a file as a .ps file, would that hold my settings in terms of font size? Then covert this .ps file to a PDF ?
 
  


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
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 01:01 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