LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-12-2006, 10:49 PM   #1
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
Why does Ghostscript PDF output look so bad?


I'm trying to convert some documents in KDE to PDF using kprinter. The resulting PostScript output files look just fine. When I print to PDF in kprinter, or use ps2pdf to convert the PS files, the resulting PDF can only be described as horrible -- jagged fonts, rough lines, some text completely missing. Look here for an example of what I am talking about (the top is the PS and the bottom is the resulting PDF). How can I change this?
 
Old 06-14-2006, 07:39 PM   #2
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
Anyone else experience this?
 
Old 06-16-2006, 07:12 PM   #3
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
I guess no one has ever had this problem before. Well thanks for the help. So much for the great "open source community" everyone talks about.
 
Old 06-17-2006, 04:41 PM   #4
minrich
Member
 
Registered: Aug 2003
Location: Isles of Man & Wight
Distribution: See signature
Posts: 548

Rep: Reputation: 40
Perhaps if you told us a little more ... such as whatr sort of printer you are using, how it is connected to (what sort of) computer, and what sort of distro/kernel/version you are using ... we might be able to help.

Your rather unhelpful third comment(post) does nothing to endear you to the community (or any sort of community, for thast matter).

I have been monitoring this tread to see if anyone else has had a similar problem -- luckily I have no such problems -- but my impression of your output is similar to a badly created OCR output. But then what do I know?
 
Old 06-18-2006, 07:25 PM   #5
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by minrich
Perhaps if you told us a little more ... such as whatr sort of printer you are using, how it is connected to (what sort of) computer, and what sort of distro/kernel/version you are using ... we might be able to help.
I am not using a printer. I am trying to create a PDF by printing to a file using the kprinter program. I am using Slackware 10.2 with kernel 2.4.31.

Quote:
Originally Posted by minrich
Your rather unhelpful third comment(post) does nothing to endear you to the community (or any sort of community, for thast matter).
Maybe you're right, but that's the way I feel. Everyone always says "With Linux, there is no one company but the community will definitely help with your problems." After doing my homework to make it easier on any would-be answerers (reading man pages, searching Google for hours, looking at newsgroups, etc.) and no one even bothers to say so much as "Sorry man, I don't know the answer" or "I had a similar problem, this is what I did", it makes me wonder what the point is when everyone jumps to help the person who does no reading of his own and says "Linux sux, I'm going back to MS."

Quote:
Originally Posted by minrich
I have been monitoring this tread to see if anyone else has had a similar problem -- luckily I have no such problems -- but my impression of your output is similar to a badly created OCR output. But then what do I know?
Probably a lot more than I do. I'm just trying to make PDF files without having to use OpenOffice.

By the way, thanks for replying.
 
Old 06-18-2006, 08:36 PM   #6
minrich
Member
 
Registered: Aug 2003
Location: Isles of Man & Wight
Distribution: See signature
Posts: 548

Rep: Reputation: 40
Does a kprinter command come up with an option (like mine does on kde 3.5.1 on Suse 10.1 x86_64) such as 'Print to file (PDF)' -- mine has a little Adobe icon before it?

Or does your kprinter offer you a different pdf creater?

Incidentally what version of kde are you using?

Cheers
 
Old 06-19-2006, 11:25 PM   #7
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
No, it has the Print to PDF, but it looks just as horrible because it uses Ghostscript to make the PDFs. At least with the Print to PS option it looks decent, but I want to have a PDF as the final result (because no one in the Windows world can read PS files). I'm using KDE 3.4.2.

I've tried messing around with the filters and print driver settings and stuff, but with no results.

Last edited by Wynd; 06-19-2006 at 11:26 PM.
 
Old 06-20-2006, 07:05 AM   #8
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 37
Just updated this laptop to Slackware-current [cups & related printing packages utilized] and can't duplicate your results/problem.

As mentioned in another post, with -current files, print to pdf is preceded by the adobe red icon.

My test was with a .txt file, output to default print.pdf file, open the print.pdf in Konqueror and it looked fine.
 
Old 06-21-2006, 06:37 PM   #9
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
I am running 10.2. I will try updating to -current.
 
Old 06-21-2006, 06:49 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I do something similar at work. I create a catalog of DVD backups and use an ls | sed | enscript pipe chain to produce a ps document, and then ps2pdf to produce a pdf file that windows users can read on the server. I haven't noticed such jaggies doing it this way. It is usually more likely if you print to pdf instead which will bitmap the fonts before printing.

Could the problem have something to do with your fonts? Are nonscalable, bitmapped fonts being selected somewhere along the line instead of proportional fonts?

You might try looking for ghostscript documentation on you system at '/usr/share/ghostscript/<version>/doc/', where <version> is your ghostscript version, such as "8.15".

Last edited by jschiwal; 06-21-2006 at 07:34 PM.
 
Old 06-23-2006, 06:07 PM   #11
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
jschiwal, thanks for the reply. I'm not on that machine at the moment, so I will try after the weekend.

From what I can discern from Google, bitmapped fonts are the problem. Unfortunately, I have no idea how to change it.

Do you think you could post your ls | sed | enscript for me to test and see if that works OK?
 
Old 06-23-2006, 10:33 PM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
You probably need to take some of those PDF files and view them .. upon separate machines (e.g. using Windows), and also with separate software under Linux. In other words, just as many different reader-environments as you can.

PDFs can be built a number of different ways; font-handling, types of fonts, and so-on have a number of different options, and it really isn't always the case that exactly what the creator "printed" will be exactly what you see. So, before you pass judgement as to whether the problem is on "recording" or "playback," establish as many test-cases as you possibly can.

Even in the Adobe suite there are PDF-generators that are "fast" and others that are "good." The readers are more consistent but even then you can see sometimes-noticeable differences between, say, a Mac and a PC.
 
Old 06-25-2006, 03:39 AM   #13
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I'm on vacation this week, so I don't have access to the script.

What I did was take the output of "ls -l" with certain options for way that the date was displayed, and used cut to retain just the information I wanted. I piped this though the "tr" command to replace multiple spaces with a single tab and redirected this to a file. It is similar to a csv file but I called it <disk name>.tsv.

Then in a separate program I cat all of the individual .tsv files together and pipe that through sort and uniq to obtain a master catalog file.


Then wrote a script that used enscript to convert this file to a two column catalog.

It took a lot of tweeking so that the result looked OK, and the output of enscript will depend on things like the length of the filenames. You may need to use a single column. I also used the fancy-headers option.
The last line in the script used ps2pdf to convert the postscript file to pdf.

I printed out the man-pages for the cut and enscript commands, so I could refer to them as I tweeked the scripts. Each script was only a few lines long.

man -t enscript | lpr
man -t cut | lpr
 
Old 06-26-2006, 11:57 PM   #14
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
OK, I updated to current. Now, when I try to print PDF files, I get this error message:

Quote:
A print error occurred. Error message received from system:

gs -q -dSAFER -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out{/home/wynd/print.pdf} -sPAPERSIZE=a4 -c .setpdfwrite -f '/tmp/kde-wyndHeAFnB/kdeprint_GzkFfVy1' : execution failed with message:
Error: /invalidfon in findfon Operand stack: BitstreamVeraSansMono-Oblique-Uni-00 --nostringval-- --nostringval-- BitstreamVeraSansMono-Oblique B tstreamVeraSansMono-Oblique Font BitstreamVeraSansMono-Oblique 1232609 BitstreamVeraSansMono-Oblique --nostringval-- BitstreamVeraSansMono-Oblique Helvetica-Oblique NimbusSanL-ReguItal Times-Italic NimbusRomNo9L-ReguItal Execution stac : %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --n stringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- 5 3 %oparray_pop 6 3 %oparr y_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 9 4 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 1 -1 1 --nostringval-- %for_neg_int_continue Dictionary stack: --dict:1124/1686(ro)(G)-- --dict:0/20(G)-- --dict:166/200(L)-- --dict:17/17(ro)(G)-- --dict:1124/1 86(ro)(G)-- Current allocation mode is local Last OS error: 2 Current file position is 9212 GPL Ghostscript 8.5 : Unrecoverable error, exit code 1
 
Old 06-28-2006, 11:13 PM   #15
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
To add another twist, now that I updated to -current, I can't make PS files either -- they come out completely blank.

Is Ghostscript really supposed to be this difficult to work with?
 
  


Reply

Tags
font, pdf



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ghostscript & pdf mania arunswarup General 0 11-07-2005 01:45 PM
ghostscript shifting PDF output upwards sshatz Linux - Software 1 09-22-2004 07:06 PM
Ghostscript: why is pdf size sometimes increased so much? J_Szucs Linux - Software 2 08-27-2004 09:19 AM
What is wrong with pdf files created by Ghostscript? J_Szucs Linux - Software 2 02-01-2004 09:45 AM
Ghostscript and pdf creation J_Szucs Linux - Software 0 05-29-2003 02:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:16 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
Open Source Consulting | Domain Registration