LinuxQuestions.org
Help answer threads with 0 replies.
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 11-20-2012, 07:13 AM   #1
Nasicus
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Rep: Reputation: Disabled
Printing PDF with not embedded TrueType Font (cups / lpr)


Hi there

I'm getting crazy over here, I already googled my a** off but didn't find an answer.

Following scenario:

I have a PDF in which the TrueType Font OCRB is used, however the font is not embedded.

So I tried to install the font on my system (which is by the way a SLES11 SP2), I did the following things:
- Double Clicked the font on gnome Desktop and clicked install
- Copied it in the /user/home/.fonts folder
- Copied it in the /usr/share/fonts
- With root: SuSEconfig --module fonts
- fc-cache
... are just some varous things I tried during googling.

Anyway when I try to print the pdf with the command:
lpr -PHL2400Ce -o -# 1 test.pdf
The pdf prints just fine, but the OCRB font is gone and replaced with the standard one.

HOWEVER when I open the pdf with evince (gnome Document viewer) I already see the OCRB font in the viewer and when I print it (with the same printer) its there and absolutely correct.

I don't understand this because I guess evince also uses lpr in some way? Any ideas what I can do?

Thanks for your time.
 
Old 11-21-2012, 03:34 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,373

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
there's level 1 - level 3 pdfs, and the number of fonts you have goes up. Make sure you're set for level 3 all along. Check you have the font in /usr/share/ghostscript/fonts or some similar place. An if at first you don't succeed - give up. Embed the fonts always as this sort of thing is wearing.
 
Old 11-21-2012, 04:33 AM   #3
Nasicus
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
The problem is "its not in my power" to embed the font
I copies the ttf font in the /usr/share/ghostscript/fonts doesnt help though :S
 
Old 11-21-2012, 08:56 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,373

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
you need to rerun mkfontalias, mkfontscale, & mkfontdir after adding a font, and a ttf will be ignored by ghostscript. Try this
http://onlinefontconverter.com/ and make it a pfm or something. That might help.
 
Old 11-28-2012, 01:29 AM   #5
Nasicus
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for pointing me in the right direction.

I did the following now:

I used http://www.freefontconverter.com/ to convert the ttf into a .pfb.
I copied the pfb into /usr/share/ghostscript/fonts/
I added the following line to the fontmap file (located at /usr/share/ghostscript/<gsversion>/lib/Fontmap):
/OCRB (/usr/share/ghostscript/fonts/ocrb.pfb);

Then I used the following command to embedd the font:

gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=output.pdf -f test.pdf

When I print via lpr the font is now correct... but I have a new problem, the "margins" on the paper are not the same.
When I print it via lpr everything is like 1 cm displaced (to the bottom), but when I print (the same pdf) with adobe (on windows) its correct.
Any advise on that?

Last edited by Nasicus; 11-28-2012 at 01:42 AM.
 
Old 11-28-2012, 05:01 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,373

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Quote:
-sPAPERSIZE=letter
change or omit that. There are also fancy options to lp and lpr. But most of this stuff is 20 years old and thwe best advice is to read man pages and try stuff. Apply patience.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing under Linux. Cups, Apsfilter, lpr ? Sonic_Traveler Linux - Hardware 4 10-03-2011 04:52 PM
actually printing after setup of cups, lp, lpr not happy kampow Linux - Newbie 4 07-20-2006 01:06 AM
lpr pdf printing (even pages upside down) Vismat Linux - General 1 01-26-2006 02:51 PM
CUPS and LPR printing carlmarshall Linux - Newbie 2 01-23-2004 01:17 PM
lpr & lpr-cups commands not working with CUPS trinbellwoods Debian 2 01-08-2004 08:25 AM

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

All times are GMT -5. The time now is 12:22 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