CGM files into PC Word for Windows [message #5238] |
Fri, 27 October 1995 00:00  |
f055
Messages: 29 Registered: April 1995
|
Junior Member |
|
|
Hi,
I'm having problems importing IDL created CGM files into Word for Windows
on a PC.
Using IDL 4.0 under DEC OSF, I've created a CGM file as follows:
IDL> set_plot,'cgm'
IDL> device,filename='idl.cgm'
IDL> !p.color=0
IDL> loadct,39
IDL> tvscl,findgen(200,200)
IDL> device,/close
Then why I try to import it as a picture into Word, I get:
This graphics file may be damaged and cannot be converted
Why? And how do I get around it?
Two extra points:
1) If I output graphics other than an image - i.e. plot or contour instead
of tvscl - then it works fine
2) I have similar problems importing CGM files containing images onto a
Power Mac, via Graphicconverter and ClarisDraw.
Hope someone can help.
Cheers, Tim
t.osborn@uea.ac.uk
Climatic Research Unit, University of East Anglia, Norwich, UK
|
|
|
Re: CGM files [message #17642 is a reply to message #5238] |
Thu, 04 November 1999 00:00  |
Jack Saba
Messages: 30 Registered: January 1996
|
Member |
|
|
> Justin <Justin_Ashmall@hotmail.com> wrote in message
> news:7vp9bo$ml8$1@jura.cc.ic.ac.uk...
>> IDLers,
>>
>> I'm attempting to produce a CGM file of a plot, however the resulting file
>> gives a square image rather than the landscape shaped plot I'm after and
>> also has some over-lapping text. Producing an encapuslated postscript file
>> with the same plot commands works fine (i.e. the correct aspect ratio, no
>> overlapping text).
>>
>> Ultimately I want to get the plot into Word (I don't want to use .eps
> since
>> I'm not using a PS printer). If I resize the CGM file the text becomes
>> distorted. Outside of IDL I've tried using Ghostview to convert the .eps
>> file to a windows meta-file which works except the resolution is very
> poor,
>> leading to my curves becomes badly jagged.
>>
>> Any suggestions?
>
I had to do something similar recently. I opened the .ps file in GSView,
then copied it to the clipboard and pasted it into Word. The resolution
did not seem degraded using this procedure.
|
|
|
Re: CGM files [message #17644 is a reply to message #5238] |
Thu, 04 November 1999 00:00  |
Justin Ashmall
Messages: 15 Registered: May 1999
|
Junior Member |
|
|
Thanks to all for the suggestions. For any interested parties the final
solution was to convert the .eps file to an Adobe Illustrator (.ai) file (I
think this just adds a header to the .eps file) using Ghostscript with the
ps2ai.ps file. The .ai file (but not the .eps?) could then be loaded by
Visio (amongst others) where I was able to cut and paste the image or save
it off as a .wmf. As I pointed out before using pstoedit (under Ghostview)
produced .wmf's with very poor resolution.
Although most agree the way to go is .eps files I much prefer the WYSIWYG
approach afforded with .wmf's (even against and .eps with a preview TIFF).
This aside, if the CGM driver worked as expected (keeping the correct aspect
ratio) the .cgm files would have loaded into Word fine.
Thanks again for the suggestions,
Justin
|
|
|
Re: CGM files [message #17647 is a reply to message #5238] |
Thu, 04 November 1999 00:00  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Justin <Justin_Ashmall@hotmail.com> wrote in message
news:7vp9bo$ml8$1@jura.cc.ic.ac.uk...
> IDLers,
>
> I'm attempting to produce a CGM file of a plot, however the resulting file
> gives a square image rather than the landscape shaped plot I'm after and
> also has some over-lapping text. Producing an encapuslated postscript file
> with the same plot commands works fine (i.e. the correct aspect ratio, no
> overlapping text).
>
> Ultimately I want to get the plot into Word (I don't want to use .eps
since
> I'm not using a PS printer). If I resize the CGM file the text becomes
> distorted. Outside of IDL I've tried using Ghostview to convert the .eps
> file to a windows meta-file which works except the resolution is very
poor,
> leading to my curves becomes badly jagged.
>
> Any suggestions?
If you DID have a Postscript printer, then by far the best way would be to
use the IDL PS device to generate EPS output. You can add a TIFF preview, if
you want, in IDL or with GSview (on Windows) or maybe Ghostview (which I
haven't used).
Without a PS printer you don't have too many satisfactory options.
The CGM device is pretty much useless for importing into Word, as you have
noted.
Ideally you want WMF (Windows Metafile) format but IDL does not have a WMF
driver. (Surely it wouldn't be that hard for them to write one!)
You could import EPS files into Word and then try to solve the problem at
the output end. You could print from Word to a file using a Postscript
driver, then print that to your non-PS printer using Ghostscript or GSview.
I don't know how well that works. If you had Adobe Acrobat Distiller, you
could print from Word through the Distiller driver to generate a PDF file,
which can then be printed to a non-PS printer. I don't know how well that
works either, and Distiller is not free.
Otherwise you could try to convert the EPS files before importing them.
There is a program called pstoedit
( http://www.geocities.com/SiliconValley/Network/1958/pstoedit /) which can
take EPS files and convert them to other vector forms. The win32 version can
now generate WMF format, which can be imported into Word. Pstoedit does have
some limitations, however, in particular it can't handle images.
Rumour has it that IDL 5.3 will be able to generate Windows Metafile output,
but only for Object Graphics and only on win32.
---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
>
>
|
|
|
Object Graphic Output, was Re: CGM files [message #17655 is a reply to message #5238] |
Wed, 03 November 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
William Thompson (thompson@orpheus.nascom.nasa.gov) writes:
> Isn't it true that object graphics produces only bitmapped output?
No. In fact nothing could be further from the truth.
Object graphics strives to produce printer "independent"
output by using the object version of the PRINTER device.
Output sent to the PRINTER is written in the default
printer-specified language, either PCL or PostScript.
And I will admit that it is truly WYSIWYG ooutput.
Unfortunately, this is not always WYHIM (What You
Had in Mind). And it almost always takes a hell of
a lot longer to print than you were expecting. :-(
It is these problems that are being addressed now
and we will see some relief in IDL 5.3. I think the
Windows Metafile output is one way to approach
some of these problems, at least for Windows users.
Cheers,
David
P.S. And, of course, it is still possible to
get JPEG, GIF, and TIFF output from object graphics
as well.
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: CGM files [message #17656 is a reply to message #5238] |
Wed, 03 November 1999 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
"Mark Hadfield" <m.hadfield@niwa.cri.nz> writes:
> Rumour has it that IDL 5.3 will be able to generate Windows Metafile output,
> but only for Object Graphics and only on win32.
I should have included this in my previous message. Isn't it true that object
graphics produces only bitmapped output?
Bill Thompson
|
|
|
Re: CGM files [message #17657 is a reply to message #5238] |
Wed, 03 November 1999 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
"Mark Hadfield" <m.hadfield@niwa.cri.nz> writes:
> Ideally you want WMF (Windows Metafile) format but IDL does not have a WMF
> driver. (Surely it wouldn't be that hard for them to write one!)
I'm not familiar with that format. Does it support both line and bitmapped
graphics (and hardware fonts) the way that PostScript does? Does it have
scalable pixels? IMHO, those are the good features of PostScript.
Luckily, all our printers are PostScript, so the question doesn't arise here.
Bill Thompson
|
|
|
|
Re: CGM files [message #17660 is a reply to message #5238] |
Wed, 03 November 1999 00:00  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
Justin <Justin_Ashmall@hotmail.com> wrote in message
news:7vp9bo$ml8$1@jura.cc.ic.ac.uk...
> I'm attempting to produce a CGM file of a plot, however the resulting file
> gives a square image rather than the landscape shaped plot I'm after and
> also has some over-lapping text. Producing an encapuslated postscript file
> with the same plot commands works fine (i.e. the correct aspect ratio, no
> overlapping text).
>
> Ultimately I want to get the plot into Word (I don't want to use .eps
since
> I'm not using a PS printer). If I resize the CGM file the text becomes
> distorted. Outside of IDL I've tried using Ghostview to convert the .eps
> file to a windows meta-file which works except the resolution is very
poor,
> leading to my curves becomes badly jagged.
One trick that can work fairly well is to create your plot as a bitmap in a
graphics window at 2 or 3 times normal size, save the contents of the
graphics window to a BMP, TIFF, or other format thay you can import into
Word, and then resize the image once it's in Word.
For a nice tutorial, check out 'Making viewgraphs' at
http://fermi.jhuapl.edu/s1r/idl/s1rlib/local_idl.html
You may need the JHU/APL library, which is available from the same location.
Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
|
|
|