comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » post script printing
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
post script printing [message #4354] Sat, 27 May 1995 00:00 Go to next message
staten is currently offline  staten
Messages: 2
Registered: May 1995
Junior Member
Hi. I'm running IDL on a powermac 7100 and I'm trying to create an
encapsulated post script file. For some reason, the following code creates a
file which is unreadable by Word, Adobe, or Aldus:

image = fltarr(256,256)
set_plot,'ps'
device,/encapsulated,filename = 'test.eps'
tv,image
device,/close_file

The file 'test.eps' cannot be opened as an eps file
by Word, Adobe Photoshop, or Aldus. What am I doing wrong?


Question 2: I'm running IDL on a mixed platform (SUN SPARCSTATION and
Powermac] and I'm looking into getting a dye-sub color printer for outputting
color overlayed brain MRI images (publication quality]. Has anyone had any
experience with this (or similar applications) on the Tek Phaser 440 vs other
printers?


Thanks,

Joe Maldjian
Neuroradiology
University of Pennsylvania
Re: post script printing [message #4435 is a reply to message #4354] Tue, 30 May 1995 00:00 Go to previous messageGo to next message
Keith Horton is currently offline  Keith Horton
Messages: 1
Registered: May 1995
Junior Member
knipp@ipi.uni-hannover.de (K Knipp) wrote:
> In article 0013F647@mail.med.upenn.edu, staten@mail.med.upenn.edu writes:
>> Hi. I'm running IDL on a powermac 7100 and I'm trying to create an
>> encapsulated post script file. For some reason, the following code creates a
>> file which is unreadable by Word, Adobe, or Aldus:
>>
>> image = fltarr(256,256)
>> set_plot,'ps'
>> device,/encapsulated,filename = 'test.eps'
>> tv,image
>> device,/close_file
>>
>> The file 'test.eps' cannot be opened as an eps file
>> by Word, Adobe Photoshop, or Aldus. What am I doing wrong?
>>
> ...

>
> Maybe Word, Adobe Photoshop, or Aldus expect the Enc. PostScript Interchange/
> Preview format, so try
>
> device,/ENCAPSULATED,filename = 'test.eps', /PREVIEW
>
>
> Karl
>

I've never gotten the /PREVIEW switch to work in IDL 3.6.x
Does anyone know if it works in 4.0? Right now, I pull in
the IDL-generated EPS file to ghostscript to attach the preview.
Works well, but its a real pain having to go through multiple
steps to create the final graphic.

Aloha, Keith
Re: post script printing [message #4447 is a reply to message #4354] Mon, 29 May 1995 00:00 Go to previous messageGo to next message
staten is currently offline  staten
Messages: 2
Registered: May 1995
Junior Member
In article <1995May29.100100.8788@newsserver.rrzn.uni-hannover.de> knipp@ipi.uni-hannover.de (K Knipp) writes:
> From: knipp@ipi.uni-hannover.de (K Knipp)
> Subject: Re: post script printing
> Date: Mon, 29 May 1995 10:01:00 GMT

> In article 0013F647@mail.med.upenn.edu, staten@mail.med.upenn.edu writes:
>> Hi. I'm running IDL on a powermac 7100 and I'm trying to create an
>> encapsulated post script file. For some reason, the following code creates a
>> file which is unreadable by Word, Adobe, or Aldus:
>>
>> image = fltarr(256,256)
>> set_plot,'ps'
>> device,/encapsulated,filename = 'test.eps'
>> tv,image
>> device,/close_file
>>
>> The file 'test.eps' cannot be opened as an eps file
>> by Word, Adobe Photoshop, or Aldus. What am I doing wrong?
>>
> ...
>> Thanks,
>>
>> Joe Maldjian
>> Neuroradiology
>> University of Pennsylvania



> Maybe Word, Adobe Photoshop, or Aldus expect the Enc. PostScript Interchange/
> Preview format, so try

> device,/ENCAPSULATED,filename = 'test.eps', /PREVIEW


> Karl


> ------------------------------------------------------------ ------------

> Karlheinz Knipp
> knipp@ipi.uni-hannover.de

> ------------------------------------------------------------ ------------


The PREVIEW keyword doesn't work either. Is there something wrong with
the first character of the header being written to an encapsulated post script
file using the powerpc version of IDL v3.6.1b ?



Joe
Re: post script printing [message #4450 is a reply to message #4354] Mon, 29 May 1995 00:00 Go to previous messageGo to next message
knipp is currently offline  knipp
Messages: 68
Registered: January 1993
Member
In article 0013F647@mail.med.upenn.edu, staten@mail.med.upenn.edu writes:
> Hi. I'm running IDL on a powermac 7100 and I'm trying to create an
> encapsulated post script file. For some reason, the following code creates a
> file which is unreadable by Word, Adobe, or Aldus:
>
> image = fltarr(256,256)
> set_plot,'ps'
> device,/encapsulated,filename = 'test.eps'
> tv,image
> device,/close_file
>
> The file 'test.eps' cannot be opened as an eps file
> by Word, Adobe Photoshop, or Aldus. What am I doing wrong?
>
...
> Thanks,
>
> Joe Maldjian
> Neuroradiology
> University of Pennsylvania



Maybe Word, Adobe Photoshop, or Aldus expect the Enc. PostScript Interchange/
Preview format, so try

device,/ENCAPSULATED,filename = 'test.eps', /PREVIEW


Karl


------------------------------------------------------------ ------------

Karlheinz Knipp
knipp@ipi.uni-hannover.de

------------------------------------------------------------ ------------
Re: post script printing [message #4509 is a reply to message #4354] Wed, 14 June 1995 00:00 Go to previous message
chase is currently offline  chase
Messages: 62
Registered: May 1993
Member
>>>> > "Keith" == Keith Horton <keith@guinness.pgd.hawaii.edu> writes:

Keith> I've never gotten the /PREVIEW switch to work in IDL 3.6.x
Keith> Does anyone know if it works in 4.0? Right now, I pull in
Keith> the IDL-generated EPS file to ghostscript to attach the preview.
Keith> Works well, but its a real pain having to go through multiple
Keith> steps to create the final graphic.

On the Macintosh a preview of an EPS file is a QuickDraw
representation stored as a PICT resource number 256 in the EPS file.
This is machine specific to the Macintosh. Postscript also provides
for a device-independent screen preview called encapsulated Postscript
interchange format (EPSI). (see the Postscript Language Reference
Manual).

Apparently, IDL uses the EPSI format when the PREVIEW keyword is used.
I do not know of any Mac applications that support the EPSI format.
In an idl.ps file generated with the PREVIEW keyword look for a line
like:

%%BeginPreview: 128 128 1 41

The parameters are: width height depth lines

In this example the preview is a 128x128 binary bitmap with 0 meaning
white and 1 meaning black. The previews that IDL generates are VERY
low resolution. They are also upside down from the Postscript
defintion for the preview.

Here is a routine that reads the EPSI preview from a postscript file
which can then be displayed in IDL using tvscl.

Chris Chase

---- begin file ----
function epsi_image, fn
;; Extract preview from an EPSI file fn and return an array containing
;; the preview.

on_ioerror, error
openr, un, fn, /get_lun
l = ''
map = bytarr(256)
map(byte('0123456789ABCDEF'))=bindgen(16)
readf, un, l
key = "%%BeginPreview:"

while strpos(l, key) ne 0 do readf, un, l

;; Get image parameters: width, height, depth, lines
;; depth can be 1,2,4,8
p = intarr(4)
reads, strmid(l, strlen(key), 256), p
;; Pixels are left to right, bottom to top.
;; IDL stores the image upside down from the Postscript defintion of
;; the Preview.

him = 0b
for i=0, p(3)-1 do begin
readf, un, l
him = [him, map(byte(strupcase(strmid(l, 1, 256))))]
endfor
free_lun, un
him = reform(him(1:*), 2, (n_elements(him)-1)/2)
him = him(0, *)*16B+him(1, *)
mask = byte(2^p(2)-1)
;; Image pixels per byte
bp = 8/p(2)
;; For each packed byte the left most pixel corresponds to the most
;; significant bits of the packed byte.
im = bytarr(bp, n_elements(him))
for i=0, bp-1 do begin
im(bp-i-1, *) = ishft(him and mask, -i*p(2))
mask = ishft(mask, p(2))
endfor
im = reform(im(0:p(0)*p(1)-1), p(0), p(1))
return, im
error:
print, 'Unable to find preview'
free_lun, un
return, 0
end

----- End file -----
--
===============================
Bldg 24-E188
The Applied Physics Laboratory
The Johns Hopkins University
Laurel, MD 20723-6099
(301)953-6000 x8529
chris.chase@jhuapl.edu
Re: post script printing [message #4587 is a reply to message #4354] Tue, 06 June 1995 00:00 Go to previous message
Joel Smith is currently offline  Joel Smith
Messages: 5
Registered: May 1995
Junior Member
I've been having similar problems with postscript files on a Powermac using
3.6.1. The problem I've been having is that if I create a file using something
simple such as

set_plot, 'ps'
plot,x,y,psym=1
device,/close ;only done after the plot statement has finished


This will generate a file on the Sun which can be ftp'd to the Mac and used
fine. (Hint - it will not be seen as a Postscript file unless you change the
filetype - this will be a problem where your application in the mac is
specifically searching and filtering for PS files).

However, on the Powermac, it generates the correct filename, but the file is
empty with 0 bytes. It doesn't seem to matter if it is standard or eps (with or
without preview). Has anyone else had similar problems?

I've been waiting to see release 4.0 to see if the problem is still there (when
it finally arrives later this week - I hope!).

Is this similar to the other problems?

Joel
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Editing Ascii File
Next Topic: Input buffer limits

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:51:00 PDT 2025

Total time taken to generate the page: 0.00720 seconds