Subject: | |
From: | |
Reply To: | |
Date: | Mon, 23 Oct 2006 19:52:24 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On 2006-10-23, at 18:52:03, Philip Aker wrote:
I should have finished that last post. One of the options these days is:
/usr/libexec/cups/filter/nstexttopdf '' $USER jobx 1 '' zzz.txt 2>/
dev/null > zzz.pdf
which seems to handle \r (and also RTF and HTML files). You can omit
the 2>/dev/null to verify for errors.
I can't remember for sure but you might want to check that 'lpstat -
p' returns that you have a valid printer.
Philip
> On 2006-10-23, at 12:55:51, Barry Wainwright wrote:
>
>> I’ve been trying to output a file to PDF and have tried both groff
>> and
>> enscript, followed by pstopdf, but they both produce pdfs with all
>> the lines
>> superimposed on one another at the top of the page.
>>
>> Here's the shell script call I'm using:
>> set shellCommand to "echo " & quoted form of outputText &
>> "|enscript
>> -B -n r -o -|pstopdf -o " & quoted form of (folderName & fileName)
>> & " -i"
>>
>> or:
>> set shellCommand to "echo " & quoted form of outputText --& "|
>> groff -T
>> ps -i |pstopdf -o " & quoted form of (folderName & fileName) & " -i"
>>
>> Followed by
>> do shell script shellCommand
>>
>> 'outputText' contains several (mac formatted) paragraphs of text.
>> I have
>> tried running the results of the echo command through a 'tr' pipe
>> to change
>> line endings, without any success. I have also tried writing the
>> data to a
>> temporary file with either mac or unix line endings, but again, no
>> change in
>> the output.
>
> Hi Barry,
>
> I suggest you break it down to several stages and then re-assemble
> when things are working.
>
> * Do your 'tr' to a file, then check with 'nano -N my.txt' for
> spurious carriage returns. You'll see ^M if it's bad.
>
> * The enscript options don't look quite right.
>
> r instead of -r
> and I use "-p- " instead of "-o -"
>
> I worked with enscript quite a bit on 10.2 and found it easier to
> set up the configuration and the .enscriptrc rather than working
> with the command line options. But otherwise the enscript/pstopdf
> worked quite well.
>
> * Maybe leave a space after the -i option for pstopdf
>
> I tried groff a bit but honestly I wouldn't trust it even if it had
> a handwritten note from Mother Teresa.
>
>
> Philip Aker
> [log in to unmask]
Philip Aker
[log in to unmask]
|
|
|