Creating PDF with gnome-cups-manager doesn't work

Gerhard Gaußling ggrubbish at web.de
Sat Mar 25 13:47:17 UTC 2006


Am Samstag, 25. März 2006 12:26 schrieb Gerhard Gaußling:
> Am Samstag, 25. März 2006 10:37 schrieb Nik:
> > In article <200603251015.04736.ggrubbish at web.de>,
> >
> >    Gerhard Gaußling <ggrubbish at web.de> wrote:
> > > Am Samstag, 25. März 2006 09:37 schrieb Nik:
> > > > Look in your home directory for a file along the line of
> > > > 'job_36-untitled_document/pdf'.
> > >
> > > I'll try that again without the changed lines "RunAsUser No" in
> > > cupsd.conf and without world writeaccess
> > > for /var/spool/cups-pdf/SPOOL , which works now for me.
> > >
> > > I'll switch back to "RunAsUser Yes" and groop writable SPOOL to
> > > enhance security again. It could work, because I found such a
> > > "job_[0-9]-untitled_document.pdf in my home directory.
> > >
> > > Isn't there a possibility to get a "save as" dialog? It's odd to
> > > save the PDF documents "randomly".
> >
> > I've no idea!
> > It's not randomly saved, though - it takes the name of the print
> > job (the 'job_36' bit - the number changes)  and is always saved in
> > your home directrory.
> > For me, at least, this seems pretty good.
>
> Hmmm.. That all doesn't work for me. The only way to produce PDF
> Files with mozilla through gnome-cups-manager (gnome printer spooler
> ?) is to set "RunAsUser Yes"  (default) to "RunAsUser No" an do
> sudo chmod 777 /var/spool/cups-pdf/SPOOL.
>
> What are the security downsides on this?
>
> I also copied cups-pdf.conf from
> http://cip.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/
> to /etc/cups/cups-pdf.conf.
> "Copy the file cups-pdf.conf to /etc/cups/cups-pdf.conf (or whatever
> you set above in cups-pdf.h) and modify it to meet you requirements.
> All options are commented and the defaults should work fine on most
> systems."
>
> There, one can define another Directory than $HOME foer PDF output.
>
> When printing PDF from mozilla I use this line in the device options
> of the moz printer dialog:
> lpr -o PreFilter=Level1 ${MOZ_PRINTER_NAME:+"-P$MOZ_PRINTER_NAME"}
>
> and get PDF's like
> -rw-------  1 gerhard gerhard  19705 2006-03-24 22:27
> tfv764eOc+0r+ckMTbk__0____0___0_.pdf
> -rw-------  1 gerhard gerhard  36380 2006-03-25 11:59
> zNvGw2EuZnlhVGAsRqE__0__kghostview,__0_.pdf
>
> Hmm... that looks pretty randomly to me ;-)
>
> Also, there are no fonts displayed in the created PDF's by looking
> them with gv,  xpdf, evince. If I take a look on these PDF's with a
> viewer like  kghostview, kpdf the fonts in the thumbnails on the left
> are shown properly, but it takes ages to render the page (simply:
> they will not render at all, while the clock is turning round)!
>
> The only way to render the fonts is to use `gs -display $PDFFILE`
>
> Here is the output of xpdf/evince while trying to render such a PDF:
>
> [...]
> Error (4561): No font in show
> Error: Unknown font tag 'R18'
> Error (4569): No font in show
> Error: Unknown character collection
> 'mozilla_printout-k8FVXI42znySd16Ai2dJ51EDJdI='
> Error: Missing or invalid Encoding entry in Type 0 font
> Error: Unknown character collection
> 'mozilla_printout-tLeVffP/zNvGw2EuZnlhVGAsRqE='
> Error: Missing or invalid Encoding entry in Type 0 font
> Error: Unknown character collection
> 'mozilla_printout-FsWXfakr0K1d3i4EiaC9M2LeSRs='
> Error: Missing or invalid Encoding entry in Type 0 font
> Error: Unknown font tag 'R11'
> Error (3804): No font in show
> Error (3861): No font in show
> Error (3877): No font in show
> Error (3899): No font in show
> Error: Unknown font tag 'R18'
> Error (4280): No font in show/space
> Error: Unknown font tag 'R24'
> Error (4297): No font in show
> [...]
> and so on...
>
> How to configure, extend and use gnome-cups-manager the right way, or
> even better: How to replace it in a gnome environment with kprinter
> (I've got kde already installed and working on my ubuntu box).
>
> regards
>
> Gerhard Gaußling
> --
> I'm Sorry for my poor english! I hope I'll achieve anyway what I want
> to say.

I found this thread:
http://www.ubuntuforums.org/showthread.php?t=29722

And altered this file:
/etc/cups/pdftops.conf:

#Set the default PostScript file or command.

psFile                  "gs -q -sDEVICE=pswrite -sOutputFile=- -dNOPAUSE 
-dBATCH -dMozConvertedToLevel2=true -|lpr"

But that does not affect the ability to include the fonts properly into 
the created PDF.

Also to put that line in front of the printing command in the mozilla 
printing dialog does not help on this issue.

But it helps to put this whole line into the mozilla printing dialog:
gs -q -sDEVICE=pswrite -sOutputFile=- -dNOPAUSE -dBATCH 
-dMozConvertedToLevel2=true - | lpr ${MOZ_PRINTER_NAME:
+'-P'}${MOZ_PRINTER_NAME}

It#s slightly different to my line when putting only gs -q 
-sDEVICE=pswrite -sOutputFile=- -dNOPAUSE -dBATCH 
-dMozConvertedToLevel2=true -|
in front of the lpr command.

Now I got PDF's like job_55-untitled_document.pdf out of mozila firefox.

This might have something to do with a freetype2 bug in breezy:
https://bugs.freedesktop.org/show_bug.cgi?id=2719

If you replace lpr with kprinter, than you can use the "Save as PDF" 
dialog of kprinter to save the created PDF directly where you want to 
have it stored.

I also replaced my default moz font with Bitstream Vera fonts (sans, 
serif, moono) to work around a bug which allows mozilla to render text  
between <code> tags (I guess due to wrong/buggy monospace fdefault 
fonts).
   
regards

Gerhard





More information about the ubuntu-users mailing list