unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Print to PDF? Configure fonts used when printing?
@ 2005-10-04 10:43 David Reitter
  2005-10-04 23:07 ` Peter Dyballa
  0 siblings, 1 reply; 6+ messages in thread
From: David Reitter @ 2005-10-04 10:43 UTC (permalink / raw)


I'd like to make printing comfortable on my OS without having to  
require Ghostscript (because it's large and it would be installed on  
many machines).

My problem is that the Postscript generated references a lot of fonts  
which aren't installed -- even though they are supposedly standard on  
PS printers.
Is there a way to centrally configure the set of fonts that can be  
used for PS output?
(I mean: centrally - not specifically for each mode defining its own  
faces.)

Alternatively, is there a package that would allow me to print to PDF  
directly? If I could print PDF, I could make printing perfectly  
comfortable through the OS's standard print dialogs. If I could print  
compatible PS, I could use on-board tools to convert to PDF and then  
display and print.

As it stands now, I can only print directly to the default PS printer  
without a chance to control / check the progress or preview the output.

Thanks for all suggestions!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Print to PDF? Configure fonts used when printing?
  2005-10-04 10:43 Print to PDF? Configure fonts used when printing? David Reitter
@ 2005-10-04 23:07 ` Peter Dyballa
  2005-10-06 22:11   ` David Reitter
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Dyballa @ 2005-10-04 23:07 UTC (permalink / raw)
  Cc: Emacs help


Am 04.10.2005 um 12:43 schrieb David Reitter:

> Alternatively, is there a package that would allow me to print to PDF  
> directly?

Not exactly an (X)Emacs package, but Perl:

http://search.cpan.org/~evanzs/PDF-CreateSimple1.09/lib/PDF/ 
CreateSimple.pm
http://search.cpan.org/~mhosken/Text-PDF-0.25/lib/Text/PDF/Page.pm
http://search.cpan.org/~jonallen/a2pdf-1.11/

a2pdf requires the PDF::API2 Perl module (tested with PDF::API2 version  
0.3r77).
Perl syntax highlighting requires the Perl::Tidy module.
To include images in the page header, the modules File::Type and  
Image::Size must be installed.
To enable the necessary "--page-size" option (A4 is standard), the  
Paper::Specs module must be installed.

While the other modules make own Perl script programming necessary,  
a2pdf looks to be ready-made -- but it does need a large set of other  
modules. Starting with Perl 5.8.7 there is perlcc -- a way to create  
binary Perl 'programmes' that carry everything needed with them, except  
dynamic libraries! a2pdf would need these, somewhere inside the  
Aquamacs Emacs application bundle (most are probably in Mac OS X):

	use File::Spec::Functions;
	use FindBin;
	use Getopt::Long;
	use Pod::Usage;
	use POSIX;
	use Text::ParseWords;
	use Perl::Tidy;
	use List::Util;
	use PDF::API2;
	use Paper::Specs;
	use File::Type;
	use Image::Size;

I'm having problems with a2pdf (Perl 5.6.1, Mac OS X 10.3.9, ...) ...


In the end, I think, it would be most useful to write an own script:  
you could use Unicode encoded fonts from Mac OS X (or additions to  
these sets) and be able to print in every script!

--
Greetings

   Pete

Time flies like an error
but fruit flies like a banana

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Print to PDF? Configure fonts used when printing?
  2005-10-04 23:07 ` Peter Dyballa
@ 2005-10-06 22:11   ` David Reitter
  2005-10-06 23:35     ` Peter Dyballa
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Reitter @ 2005-10-06 22:11 UTC (permalink / raw)
  Cc: Emacs help


[-- Attachment #1.1: Type: text/plain, Size: 1241 bytes --]

Hi Peter,

>  Not exactly an (X)Emacs package, but Perl:
>
>
> In the end, I think, it would be most useful to write an own  
> script: you could use Unicode encoded fonts from Mac OS X (or  
> additions to these sets) and be able to print in every script!

The problem with a2pdf as I see it is that I won't get syntax  
highlighting from Emacs. I mean, there's really no point in offering  
a print function if it doesn't relate to what's shown on the screen,  
because otherwise one could just fire up Textedit or whatever and  
copy&paste the buffer over.

I mean, printing would have to respect the faces chosen. I don't  
understand why it should be impossible to generate PDF instead of PS,  
using the same methods that the current printing system uses. It  
seems to me there's a real lack of a package.

I suspect I'm just going to have to see if I can coerce the output  
system to print instead of showing things on the screen. ATSUI  
( being made available these days ) might help here, but I suspect it  
won't be a peace of cake due to the way letters are output.  
Unfortunately, lacking inside knowledge about how Emacs outputs stuff  
on the screen, I'm not really qualified to implement printing support.

Cheers
David



[-- Attachment #1.2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2400 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Print to PDF? Configure fonts used when printing?
  2005-10-06 22:11   ` David Reitter
@ 2005-10-06 23:35     ` Peter Dyballa
  2005-10-11 20:06     ` Peter Dyballa
       [not found]     ` <mailman.10931.1129061171.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2005-10-06 23:35 UTC (permalink / raw)
  Cc: Emacs help


Am 07.10.2005 um 00:11 schrieb David Reitter:

> The problem with a2pdf as I see it is that I won't get syntax 
> highlighting from Emacs. I mean, there's really no point in offering a 
> print function if it doesn't relate to what's shown on the screen, 
> because otherwise one could just fire up Textedit or whatever and 
> copy&paste the buffer over.
>

Yes, that's true! My PostScript printer is b&w.

On Monday, we had a holiday, I experimented with a2ps. Its output is 
*often* Apple compliant, meaning it can be converted to PDF with 
pstopdf. The problems are with the ISO Latin-{2,3,4,5,6,9,10} 
encodings. The Slavic ones can't be converted because of the a2ps 
internal use of the ogonkify engine. For the latter encodings a2ps does 
not seem to understand that many 8 bit characters are correct and 
printable ...

GNU enscript and a2ps are two utilities that convert text to PostScript 
with syntax highlighting. Their developers are not easily accessible, 
and their products are more kind of a workaround than a useful utility 
when your printer has the € built-in. I hope that in a2ps is a means to 
switch off ogonkify! Then it would be worth ...

Beside Perl there could be too a programmatic solution based on C and 
PDFlib.

http://www.inf.enst.fr/~demaille/a2ps/
http://directory.fsf.org/GNU/enscript.html
http://www.pdflib.com/products/pdflib/index.html

--
Mit friedvollen Grüßen

   Pete

There is no national science just as there is no national
multiplication table; what is national is no longer science.
          -- Anton Checov

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Print to PDF? Configure fonts used when printing?
  2005-10-06 22:11   ` David Reitter
  2005-10-06 23:35     ` Peter Dyballa
@ 2005-10-11 20:06     ` Peter Dyballa
       [not found]     ` <mailman.10931.1129061171.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2005-10-11 20:06 UTC (permalink / raw)
  Cc: Emacs help


Am 07.10.2005 um 00:11 schrieb David Reitter:

> The problem with a2pdf as I see it is that I won't get syntax 
> highlighting from Emacs.

There is one more thing that excludes it: it only can handle US-ASCII! 
It's author sent me this message ...

If I could clone myself, in 2025 we would have a splendid solution! 
Maybe even in 2024 because of the Olympic games then.

--
Greetings

   Pete

"engineer: a mechanism for converting caffeine into designs"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Print to PDF? Configure fonts used when printing?
       [not found]     ` <mailman.10931.1129061171.20277.help-gnu-emacs@gnu.org>
@ 2005-10-12 10:39       ` Piet van Oostrum
  0 siblings, 0 replies; 6+ messages in thread
From: Piet van Oostrum @ 2005-10-12 10:39 UTC (permalink / raw)


>>>>> Peter Dyballa <Peter_Dyballa@Web.DE> (PD) wrote:

>PD> Am 07.10.2005 um 00:11 schrieb David Reitter:
>>> The problem with a2pdf as I see it is that I won't get syntax
>>> highlighting from Emacs.

>PD> There is one more thing that excludes it: it only can handle US-ASCII!

That's what the 'a' in its name means.
-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet@vanoostrum.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-10-12 10:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-04 10:43 Print to PDF? Configure fonts used when printing? David Reitter
2005-10-04 23:07 ` Peter Dyballa
2005-10-06 22:11   ` David Reitter
2005-10-06 23:35     ` Peter Dyballa
2005-10-11 20:06     ` Peter Dyballa
     [not found]     ` <mailman.10931.1129061171.20277.help-gnu-emacs@gnu.org>
2005-10-12 10:39       ` Piet van Oostrum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).