MACSCRPT Archives

October 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Philip Aker <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 23 Oct 2006 18:52:03 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (58 lines)
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]

ATOM RSS1 RSS2