denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] Printing


From: Richard Shann
Subject: Re: [Denemo-devel] Printing
Date: Sat, 22 Dec 2007 08:30:50 +0000

On Fri, 2007-12-21 at 21:46 -0600, Jeremiah Benham wrote:
> On Fri, 2007-12-21 at 08:10 +0000, Richard Shann wrote: 
> > Does anyone know how to get the Print command working? I have it wired
> > to evince which is a pdf viewer that comes with Debian, but evince does
> > not have a "print then quit" option, so I can't just add an option to
> > that. If someone knows how this should be done I'll be happy to do it.
> > Richard
> 
> I know you could either use a system call to pipe it to the printer or
> open up /dev/lp or /dev/lpt as a file and write to it I suppose similar
> to a file copy or save as. I don't know which is more standard if there
> is not a better way. 
I am guessing that things like /dev/lp do not want the bytes in a PDF
file piped into them, they are device drivers from antiquity and unless
the printer connected to them is something sophisticated I would expect
you to get the content of the PDF as ASCII letters plus side effects on
the printer's control mechanism from the non-ascii characters.
What I anticipate is that there are a slew of drivers for controlling a
slew of printer types and that someone has made a compatibility
library/driver/demon/XXX allowing us to humbly offer our PDF up for
printing. 

> 
> Regarding printing: 
> When I try to print something I get a pop up saying "could not create
> pdf - etc ...."
> 
> The pdf was actually created in ~/.denemo/denemoprint.pdf. The error at
> the terminal says:
> 
> Processing `/home/jjbenham/.denemo/denemoprint.ly'
> Parsing...
> Interpreting music... [3]
> Preprocessing graphical objects...
> Interpreting music... 
> MIDI output to `denemoprint.midi'...
> Layout output to `denemoprint.ps'...
> Converting to `denemoprint.pdf'...
> 
> ** (denemo:32403): WARNING **: Failed to rename denemoprint.pdf
> to /home/jjbenham/.denemo/denemoprint.pdf
> 
> I thought I would give you this because you seem to be working on
> printing. 

My interest in the Print command is just that I am trying to make Denemo
look attractive to developers, I don't actually have a printer myself -
I cycle over to my mum's when I've finished my score!

> The problem seems to be in the rename line 110 of print.c.
> The issue is denemoprint.pdf is originally created in ~/.denemo. Then it
> wants to rename to be the same file in the same place. I commented out
> line 109 which removed the ~/.denemo/denemoprint.pdf. Unfortunately that
> was the original file. This all makes sense if denemoprint.pdf was
> created in /tmp but rename does not work for osX users because rename
> does not work in osX across different file-systems.  In Os X /tmp is on
> its own partition IIRC. I am not sure. Maybe we should just remove the
> whole rename thing. Since lilypond is directly creating denemoprint.pdf
> anyway. 

Sounds right - if the lilypond output of denemo is garbled, so that the
LilyPond interpreter fails to create a PDF, then the previously created
PDF is displayed, which is bad. It would be better to show nothing. So,
deleting any old denemoprint.pdf before starting sounds like a good idea
or overwriting it. There are security issues around writing files
(someone could make denemoprint.pdf a link to some valued file of yours
and deleting it could screw you up), but we might not be introducing
anything new doing this. We could check that it was a file before
deleting it.

Richard






reply via email to

[Prev in Thread] Current Thread [Next in Thread]