On Mon, 2005-12-05 at 17:25 +1300, Nick Rout wrote:
> On Sun, 04 Dec 2005 20:29:05 -0700
> Joseph wrote:
>
> > On Mon, 2005-12-05 at 15:57 +1300, Nick Rout wrote:
> > > On Sun, 04 Dec 2005 18:05:31 -0700
> > > Joseph wrote:
> > >
> > > > I want to print to "letter" size paper.
> > > > I'm using Sql-Ledger to print invoices, program is set to print with
> > > > command:
> > > > lpr -P Printer Name
> > > > Sql-Ledger is using latex forms to generate invoices. So to my
> > > > understanding the program will be using "dvips" to convert latex to
> > > > postscript and send it directly to printer, am I right?
> > >
> > > Probably, but not necessarily - look in the source and see what is
> > > called to make the document, or do some sort of tracing as the program
> > > runs.
> > >
> > > > Is there any other utility that conversion goes through, that I've
> > > > missed?
> >
> > looking at the configuration file in sql-ledger it is looking for:
> > latex, dvips or pdflatex, but making any changes to dvips makes no
> > difference.
> > it is hard to look in the source code if you don't know which file it
> > is.
> >
>
> I think I have tracked down the code for printing to the file SL/Form.pm
> (I tracked it by grepping the source for outr likely commands, dvips,
> pdflatex etc.)
>
> Unfortunately I am not a perl guru, but there are clearly differences in
> processing between ps output and pdf output. For example there is a
> passage that shows that if the format is ps the following is executed:
>
> latex --interaction=nonstopmode
> dvips -o -q
>
dvips -o -q
-o means: The output will be sent to file name If no file name is given, the
default name is file.ps
-q means quite mode.
Here is the part that sends file to a printer, can any perl guru help us
out???
How it converts to postscript file and which program is it using.
# Convert the tex file to postscript
if ($self->{format} =~ /(postscript|pdf)/) {
use Cwd;
$self->{cwd} = cwd();
chdir("$userspath") or $self->error($self->cleanup."chdir : $!");
$self->{tmpfile} =~ s/$userspath\///g;
# DS. added screen and email option in addition to printer
# screen
if ($self->{format} eq 'postscript') {
system("latex --interaction=nonstopmode $self->{tmpfile} >
$self->{tmpfile}.err");
$self->error($self->cleanup) if ($?);
$self->{tmpfile} =~ s/tex$/dvi/;
system("dvips $self->{tmpfile} -o -q > /dev/null");
$self->error($self->cleanup."dvips : $!") if ($?);
$self->{tmpfile} =~ s/dvi$/ps/;
}
if ($self->{format} eq 'pdf') {
system("pdflatex --interaction=nonstopmode $self->{tmpfile} >
$self->{tmpfile}.err");
$self->error($self->cleanup) if ($?);
$self->{tmpfile} =~ s/tex$/pdf/;
}
--
#Joseph
--
[email protected] mailing list