925-456-1020 info@acornnmr.com

Copying Spectra

Copying Spectra

NUTS Help

Copying spectra to other applications

NUTS provides multiple options for copying spectra into other applications, either via the clipboard or by writing to a file. On the Mac, the options are to copy a bitmap (Ctrl-C) or PICT file (Alt-C) to the clipboard, also available from the Edit menu. In the Windows versions, the choices are bitmap or metaile, and there are variations in the type of metafile. The enhanced metafile is supported only on Windows.

The commands described below are

Control-C — Copy to clipboard as bitmap
(Also, copy bitmap as black and white)
Alt-Shift-C —
Copy to clipboard as a standard metafile
Alt-Shift-E —
Copy to clipboard as an enhanced metafile
Alt-Shift-P —
Copy to clipboard as an enhanced metafile using the printer device context
Ctrl+Alt+C —
Copy to file as standard metafile
Ctrl+Alt+L —
Copy to file as placeable metafile
Ctrl+Alt+E —
Copy to file as enhanced metafile
Ctrl+Alt+P —
Copy to file as enhanced metafile using the printer device context
metafile — Copy to clipboard as an enhanced metafile
metafile enhanced_standard_clipboard — Copy to clipboard as an enhanced metafile
metafile enhanced_printer_clipboard — Copy to clipboard as an enhanced metafile using the printer device context
 
The last 3 commands listed above were created to allow copying from within a macro, because the special (control, alt, shift) keys cannot be used in a macro.  These commands operate in the non-2-letter command mode.

Choosing Copy Bitmap from the Edit menu (or typing Control-C) copies the currently displayed screen to the clipboard, from which it can be pasted into other programs, such as word processing programs. The "picture" created this way is a bitmap, and can be edited with a Paint program. This is the quickest way to place spectra into reports and is often sufficient. The drawback to a bitmap is that the picture is created pixel by pixel and so is limited to screen resolution, whereas NMR data usually has much better inherent digital resolution. The spectra can end up looking coarse, similar to a FAXed image. Distortions can also result when the bitmap is re-sized. The quality of the final image will be affected by the size of the NUTS window before executing Copy.  A large window will contain more pixels, so the resolution will be better.  However, if the image is then reduced in size, some pixels can be "lost", and the image can have gaps.  It may work better to set the NUTS window to the size of the final image desired, then Copy, and don’t resize after pasting.

The second method for placing a spectrum into a report is to copy it as a Windows Metafile (or Mac PICT file), rather than a bitmap.  A Metafile (or PICT) is a vector drawing and can be edited with Draw programs. This type of drawing preserves the digital resolution inherent in the data, so the spectrum looks as good as when printed directly out of NUTS. The disadvantage is that it is slow and the resulting picture when pasted into other programs can be very large. The more data points you have displayed, the slower the operation is.

The appearance of the image after pasting is affected not only by NUTS, but also by the target application (see comments below).  NUTS offers multiple Metafile variants to give the user the ability to experiment with what works best with his/her preferences and other applications.  Some trial and error is needed to determine the best way to paste spectra into a particular application.

The Enhanced Metafile is supported only under Windows. This seems to avoid some of the reported problems with printing from the target application, and seems to handle fonts somewhat better. Also, any inset plots which have been created (with MO) are copied along with the main plot, which is not true of standard metafiles. There are 2 types of Enhanced metafiles available from the Edit menu, one of which requires a printer "device context".  Using a printer DC means that the image is generated with properties pertaining to a specific printer.  If this is chosen, and a printer has not been defined in the current Nuts session, a print setup box will appear when a metafile is copied.

Why use a Printer Device Context?

When a metafile is copied to the clipboard, the coordinates are expressed as integers (because you can’t have a fraction of a pixel) and this can cause roundoff errors if the number of points in the spectrum being copied exceeds the number of pixels.  When the resulting metafile is pasted into the target application and stretched, distortion can result.   The logical solution is to create the metafile at higher digital resolution.   This is done by using a "Printer Device Context" which means that the metafile is composed at the digital resolution of the printer rather than the lower screen resolution.  Most common printers are 300 or 600 dpi, but you can install a printer driver that has much higher resolution (> 2000 dpi), even though you don’t actually have such a printer.  Add a "printer" (such as a Linotronic) on your computer whose designated destination is FILE rather than a printer port, and select this printer from inside NUTS (File/Printer setup).  Then choose "Copy Printer DC Enhanced Metafile to Clipboard" from the Edit menu.   When pasted, the image should be essentially free of distortion.  Note that many applications, such as Word, allow you to edit a pasted metafile, but to do this, the application converts it to its own internal graphics object, and this may re-create the very roundoff problem we had avoided.

We have recently (September, 2003) noticed that the procedure described above no longer yields high quality spectra in Word or PowerPoint.  If you display the resulting spectrum at 500% scale, the distortion is obvious.  We assume changes in newer versions of Office or perhaps Windows are responsible.  There is a work-around.  NUTS allows copy the metafile to a file, rather than to the clipboard.  Save the spectrum to a file, then use Insert/Picture from file to place the spectrum into the document.  This Word doc illustrates the different results using copy and paste vs. saving to a file and inserting.

The added complication is that the target application into which the spectrum is pasted also affects the final image quality.  Using the higher resolution printer device context solves the roundoff problem when pasting into Word or PageMaker.  But pasting the very same copied spectrum into Publisher or PowerPoint still gives a spectrum distorted by roundoff.

A few additional points need to be noted regarding metafiles. Any text displayed on the screen (with Ctrl-B command) is not copied when copying as a standard metafile or as a PICT file, because placing the spectrum into the clipboard replaces the text that was there. Text on the screen is preserved when copying as an enhanced metafile or bitmap. Font sizes chosen in NUTS assume a full-page plot. If the spectrum is reduced when pasted into another application, the fonts are reduced proportionately, and may become too small. The font can first be changed in NUTS from the Edit/Fonts menu. This can easi
ly be done with a macro which resets the font sizes. Whether or not the font can be changed after pasting into the target application depends on the specific application.   PowerPoint, Publisher and Word have the ability to break the image down into its component parts, which allows you to edit parts of the spectrum (eg., change the font of the axis labels, remove a specific integral trace, change colors of any single item).  However, this involves a conversion which can result in loss of image quality.

For documents which will ultimately be printed on a black and white printer, you may want to set all colors in NUTS to black (from the File / Page Setup menu, choose monochrome display). Otherwise, from some applications (such as Microsoft Word), the laser printer will "dither" the colors and the lines will come out dashed, not solid.  Figures for slides or posters may be more visible if the line thickness is increased before copying, which is also done from the NUTS File/Page Setup menu.  Depending on the graphcis capabilities of the target application, annotations may be made after pasting.  However, it may be simpler to add a structure or text annotations in NUTS before copying.

A Metafile can also be written directly to a file, rather than placed into the Windows clipboard, by typing Ctrl+Alt+C (for a Standard Metafile), Ctrl+Alt+L (for a Placeable Metafile) Ctrl+Alt+E (for Enhanced Metafile) Ctrl+Alt+P (for Enhanced Metafile with printer device context). These commands are also available from the Edit menu. The Metafile will consist of the currently displayed region. NUTS will prompt for a file name for the Metafile. (The file extension .WMF is suggested, as this will be recognized by many other Windows applications.)

Another method of incorporating spectra into reports is to print to a file.  Many applications, such asWord, have import filters for these files which can be used to insert a graphics object into the target application. Depending on the type of printer available and the import filters in the target application, it is possible to print to a file in either HPGL format or postscript format. To do this, choose Print Setup from the file menu and select "HPGL Plotter to File" or "Postscript Plotter to File" as the printer. (If this is not one of the printer options, the corresponding printer driver must first be installed. Then connect that printer to file using the Windows Control Panel.) Use Page Setup from the NUTS File menu to choose whether or not a box drawn will be drawn around the plot and whether or not parameters should be listed. Then choose Print from the File menu and supply a file name. The file can then be imported from within a word processing program or other application. How well this works is dependent on the import filter of the program into which the file is imported.

Main Help page

Command Index

 


Last updated: 1/5/05.