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

Home » Public Forums » archive » Re: IDL and PDF
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
Re: IDL and PDF [message #27183] Fri, 12 October 2001 09:33 Go to next message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Todd Clements wrote:
>
> Steve Worland <worley@maths.ex.ac.uk> wrote:
>
>> Does anyone know any way of producing a .pdf output using IDL, or any
>> way of converting .ps to .pdf but keeping the graphics looking nice?
>
> Steve -
>
> My favorite answer is to use ghostcript. If you're on some sort of UNIX
> box, here's your command line:
>
> gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -q -r 72 -sOutputFile=outFileName
> inputFileName
>
> where the 72 is the resolution (in dpi) you want your graphics rendered
> at, inputFileName is the name of the .ps file you've created, and
> outFileName is the name of the PDF you want created.
>
> I create this string at run time with the appropriate file names and
> resolution:
>
> str = 'gs -sDEVICE='+device+' -dBATCH -dNOPAUSE -q -r'+ $
> strtrim(fix(res),2)+' -sOutputFile='+ $
> strippedFileName+extension+' '+ fileList[i]
>
> and then use spawn to execute it.

Note: Some systems may not like the space after the "-r" in the example above.


Or use the Unix "convert" utility (sorry for the length of the following):

% man convert

convert(1) convert(1)

NAME
convert - converts an input file using one image format to an output file with the
same or differing image format.

SYNOPSIS
convert [ options ... ] file [ file... ] file

DESCRIPTION
convert converts an input file using one image format to an output file with the
same or differing image format.

convert recognizes the following image formats:

Tag Description
------------------------------------------------------------ -------------------
AVS AVS X image file.
BIE+ Joint Bi-level Image experts Group file interchange format.
BMP+ Microsoft Windows bitmap image file.
BMP24+ Microsoft Windows 24-bit bitmap image file.
CGM Computer Graphics Metafile.
CMYK Raw cyan, magenta, yellow, and black bytes.
DCX+ ZSoft IBM PC multi-page Paintbrush file.
DIB Microsoft Windows bitmap image file.
DICOM Medical image file.
EPDF Encapsulated Portable Document Format.
EPI Adobe Encapsulated PostScript Interchange format.
EPS Adobe Encapsulated PostScript file.
EPS2 Adobe Level II Encapsulated PostScript file.
EPSF Adobe Encapsulated PostScript file.
EPSI Adobe Encapsulated PostScript Interchange format.
EPT Adobe Encapsulated PostScript Interchange format with TIFF preview.
FAX+ Group 3.
FIG TransFig image format.
FITS Flexible Image Transport System.
FPX FlashPix Format.
GIF+ CompuServe graphics interchange format; 8-bit color.
GIF87+ CompuServe graphics interchange format; 8-bit color (version 87a).
GRAY Raw gray bytes.
GRANITE
granite texture.
HDF+ Hierarchical Data Format.
HISTOGRAM
HPGL HP-GL plotter language.
HTML Hypertext Markup Language with a client-side image map.
JBIG+ Joint Bi-level Image experts Group file interchange format.
JPEG Joint Photographic Experts Group JFIF format; compressed 24-bit color.
ICO Microsoft icon.
LABEL text image.
MAP Red, green, and blue colormap bytes followed by the image colormap indexes.
MIFF+ Magick image file format. MNG Multiple-image Network Graphics.
MONO Bi-level bitmap in least-significant-byte (LSB) first order.
MPEG+ Motion Picture Experts Group file interchange format.
MTV+ MTV Raytracing image format.
NETSCAPE
Netscape 216 color cube.
NULL NULL image.
PBM+ Portable bitmap format (black and white).
PCD Photo CD. The maximum resolution written is 512x768 pixels.
PCL Page Control Language.
PCX ZSoft IBM PC Paintbrush file.
PDF+ Portable Document Format.
PGM+ Portable graymap format (gray scale).
PICT Apple Macintosh QuickDraw/PICT file.
PIX Alias/Wavefront RLE image format.
PLASMA plasma fractal image. Specify the base color as the filename (e.g.
plasma:gray). Use fractal to initialize to a random value (e.g.
plasma:fractal).
PNG Portable Network Graphics.
PNM+ Portable anymap.
PPM+ Portable pixmap format (color).
PS+ Adobe PostScript file.
PSD Adobe Photoshop bitmap file.
PS2+ Adobe Level II PostScript file.
P7 Xv's visual schnauzer format.
RAD Radiance image format.
RGB Raw red, green, and blue bytes.
RGBA Raw red, green, blue and matte bytes.
RLA Alias/Wavefront image file; read only
RLE Utah Run length encoded image file; read only.
SGI+ Irix RGB image file.
SHTML Hypertext Markup Language with a client-side image map.
SUN+ SUN Rasterfile.
TEXT raw text file; read only.
TGA+ Truevision Targa image file.
TIFF+ Tagged Image File Format.
TIFF24+
24-bit Tagged Image File Format.
TILE tile image with a texture.
TIM PSX TIM file.
TTF TrueType font file.
UIL X-Motif UIL table.
UYVY Interleaved YUV.
VICAR read only.
VID Visual Image Directory.
VIFF+ Khoros Visualization image file.
WIN select image from or display image to your computer screen.
X select image from or display image to your X server screen.
XC constant image of X server color. Specify the desired color as the filename
(e.g. xc:yellow).
XBM X11 bitmap file.
XPM X Windows system pixmap file (color).
XWD X Windows system window dump file (color).
YUV+ CCIR 601 4:1:1 file.

I use IDL 5.4.1 and use convert to create GIF output of my pretty PostScript files (which have
always looked better than IDL produced GIF files if you can handle the larger file sizes).
Works fine for PS->PDF too (lathough you may have to dick about with fonts

cheers,

paulv

--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
Re: IDL and PDF [message #27185 is a reply to message #27183] Fri, 12 October 2001 09:10 Go to previous messageGo to next message
Todd Clements is currently offline  Todd Clements
Messages: 23
Registered: January 2001
Junior Member
Steve Worland <worley@maths.ex.ac.uk> wrote:

> Does anyone know any way of producing a .pdf output using IDL, or any
> way of converting .ps to .pdf but keeping the graphics looking nice?

Steve -

My favorite answer is to use ghostcript. If you're on some sort of UNIX
box, here's your command line:

gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -q -r 72 -sOutputFile=outFileName
inputFileName

where the 72 is the resolution (in dpi) you want your graphics rendered
at, inputFileName is the name of the .ps file you've created, and
outFileName is the name of the PDF you want created.

I create this string at run time with the appropriate file names and
resolution:

str = 'gs -sDEVICE='+device+' -dBATCH -dNOPAUSE -q -r'+ $
strtrim(fix(res),2)+' -sOutputFile='+ $
strippedFileName+extension+' '+ fileList[i]

and then use spawn to execute it.

Todd
Re: IDL and PDF [message #27190 is a reply to message #27185] Fri, 12 October 2001 08:21 Go to previous messageGo to next message
Med Bennett is currently offline  Med Bennett
Messages: 109
Registered: April 1997
Senior Member
Steve Worland wrote:

> Does anyone know any way of producing a .pdf output using IDL, or any
> way of converting .ps to .pdf but keeping the graphics looking nice?
>
> Cheers

Yes - get a copy of Ghostscript (you don't say what platform you're
working on though) - it does .ps -> to .pdf very nicely!
Re: IDL and PDF [message #27193 is a reply to message #27190] Fri, 12 October 2001 07:50 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Steve Worland (worley@maths.ex.ac.uk) writes:

> Does anyone know any way of producing a .pdf output using IDL, or any
> way of converting .ps to .pdf but keeping the graphics looking nice?

I've converted my entire book to PDF files. Almost all
the figures are created in IDL as encapsulated PostScript
output. I've never noticed any problem with graphics
looking nice, and I'm pretty anal about things like that.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: IDL and PDF [message #27236 is a reply to message #27183] Tue, 16 October 2001 01:43 Go to previous messageGo to next message
Steve Worland is currently offline  Steve Worland
Messages: 2
Registered: October 2001
Junior Member
Paul van Delst wrote:

> Todd Clements wrote:
>>
>> Steve Worland <worley@maths.ex.ac.uk> wrote:
>>
>>> Does anyone know any way of producing a .pdf output using IDL, or any
>>> way of converting .ps to .pdf but keeping the graphics looking nice?
>>
>> Steve -
>>
>> My favorite answer is to use ghostcript. If you're on some sort of UNIX
>> box, here's your command line:
>>
>> gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -q -r 72 -sOutputFile=outFileName
>> inputFileName
>>
>> where the 72 is the resolution (in dpi) you want your graphics rendered
>> at, inputFileName is the name of the .ps file you've created, and
>> outFileName is the name of the PDF you want created.
>>
>> I create this string at run time with the appropriate file names and
>> resolution:
>>
>> str = 'gs -sDEVICE='+device+' -dBATCH -dNOPAUSE -q -r'+ $
>> strtrim(fix(res),2)+' -sOutputFile='+ $
>> strippedFileName+extension+' '+ fileList[i]
>>
>> and then use spawn to execute it.
>
> Note: Some systems may not like the space after the "-r" in the example above.
>
> Or use the Unix "convert" utility (sorry for the length of the following):
>
> % man convert
>
> convert(1) convert(1)
>
> NAME
> convert - converts an input file using one image format to an output file with the
> same or differing image format.
>
> SYNOPSIS
> convert [ options ... ] file [ file... ] file
>
> DESCRIPTION
> convert converts an input file using one image format to an output file with the
> same or differing image format.
>
> convert recognizes the following image formats:
>
> Tag Description
> ------------------------------------------------------------ -------------------
> AVS AVS X image file.
> BIE+ Joint Bi-level Image experts Group file interchange format.
> BMP+ Microsoft Windows bitmap image file.
> BMP24+ Microsoft Windows 24-bit bitmap image file.
> CGM Computer Graphics Metafile.
> CMYK Raw cyan, magenta, yellow, and black bytes.
> DCX+ ZSoft IBM PC multi-page Paintbrush file.
> DIB Microsoft Windows bitmap image file.
> DICOM Medical image file.
> EPDF Encapsulated Portable Document Format.
> EPI Adobe Encapsulated PostScript Interchange format.
> EPS Adobe Encapsulated PostScript file.
> EPS2 Adobe Level II Encapsulated PostScript file.
> EPSF Adobe Encapsulated PostScript file.
> EPSI Adobe Encapsulated PostScript Interchange format.
> EPT Adobe Encapsulated PostScript Interchange format with TIFF preview.
> FAX+ Group 3.
> FIG TransFig image format.
> FITS Flexible Image Transport System.
> FPX FlashPix Format.
> GIF+ CompuServe graphics interchange format; 8-bit color.
> GIF87+ CompuServe graphics interchange format; 8-bit color (version 87a).
> GRAY Raw gray bytes.
> GRANITE
> granite texture.
> HDF+ Hierarchical Data Format.
> HISTOGRAM
> HPGL HP-GL plotter language.
> HTML Hypertext Markup Language with a client-side image map.
> JBIG+ Joint Bi-level Image experts Group file interchange format.
> JPEG Joint Photographic Experts Group JFIF format; compressed 24-bit color.
> ICO Microsoft icon.
> LABEL text image.
> MAP Red, green, and blue colormap bytes followed by the image colormap indexes.
> MIFF+ Magick image file format. MNG Multiple-image Network Graphics.
> MONO Bi-level bitmap in least-significant-byte (LSB) first order.
> MPEG+ Motion Picture Experts Group file interchange format.
> MTV+ MTV Raytracing image format.
> NETSCAPE
> Netscape 216 color cube.
> NULL NULL image.
> PBM+ Portable bitmap format (black and white).
> PCD Photo CD. The maximum resolution written is 512x768 pixels.
> PCL Page Control Language.
> PCX ZSoft IBM PC Paintbrush file.
> PDF+ Portable Document Format.
> PGM+ Portable graymap format (gray scale).
> PICT Apple Macintosh QuickDraw/PICT file.
> PIX Alias/Wavefront RLE image format.
> PLASMA plasma fractal image. Specify the base color as the filename (e.g.
> plasma:gray). Use fractal to initialize to a random value (e.g.
> plasma:fractal).
> PNG Portable Network Graphics.
> PNM+ Portable anymap.
> PPM+ Portable pixmap format (color).
> PS+ Adobe PostScript file.
> PSD Adobe Photoshop bitmap file.
> PS2+ Adobe Level II PostScript file.
> P7 Xv's visual schnauzer format.
> RAD Radiance image format.
> RGB Raw red, green, and blue bytes.
> RGBA Raw red, green, blue and matte bytes.
> RLA Alias/Wavefront image file; read only
> RLE Utah Run length encoded image file; read only.
> SGI+ Irix RGB image file.
> SHTML Hypertext Markup Language with a client-side image map.
> SUN+ SUN Rasterfile.
> TEXT raw text file; read only.
> TGA+ Truevision Targa image file.
> TIFF+ Tagged Image File Format.
> TIFF24+
> 24-bit Tagged Image File Format.
> TILE tile image with a texture.
> TIM PSX TIM file.
> TTF TrueType font file.
> UIL X-Motif UIL table.
> UYVY Interleaved YUV.
> VICAR read only.
> VID Visual Image Directory.
> VIFF+ Khoros Visualization image file.
> WIN select image from or display image to your computer screen.
> X select image from or display image to your X server screen.
> XC constant image of X server color. Specify the desired color as the filename
> (e.g. xc:yellow).
> XBM X11 bitmap file.
> XPM X Windows system pixmap file (color).
> XWD X Windows system window dump file (color).
> YUV+ CCIR 601 4:1:1 file.
>
> I use IDL 5.4.1 and use convert to create GIF output of my pretty PostScript files (which have
> always looked better than IDL produced GIF files if you can handle the larger file sizes).
> Works fine for PS->PDF too (lathough you may have to dick about with fonts
>
> cheers,
>
> paulv
>
> --
> Paul van Delst Religious and cultural
> CIMSS @ NOAA/NCEP purity is a fundamentalist
> Ph: (301)763-8000 x7274 fantasy
> Fax:(301)763-8545 V.S.Naipaul

Thankyou all for your help!!!
Re: IDL and PDF [message #27561 is a reply to message #27183] Fri, 26 October 2001 10:06 Go to previous message
src is currently offline  src
Messages: 9
Registered: January 2001
Junior Member
Or, if you have LaTeX installed, it has a script called epstopdf that
calls ghostscript to convert eps to pdf - very easy to use. Personally I
wish you could output pdf direct from IDL, since then I wouldn't have to
convert my eps files to pdf for use with pdflatex (which won't accept eps
files)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL and ActiveX
Next Topic: plot question

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

Current Time: Wed Oct 08 16:00:22 PDT 2025

Total time taken to generate the page: 0.00719 seconds