Output


Supported with:
Library dependencies: System, SystemUI, Geometry, Display, Server

Additional library information: Contents, Object Model Diagram

The Output library is used to create graphical output to devices, such as printers and plotters, and to graphical file formats such as PDF and TIFF. The developer uses other objects in the ArcGIS system to generate drawing commands, and the Output objects are used to convert those commands to graphical output. Drawing instructions are typically generated by objects in the Display and Carto libraries.
 
Developers can extend the Output library for custom devices and export formats.

The objects that implement this functionality are grouped into a number of library subsystems. These library subsystems are:

Printers

The printer objects provide access to the ArcGIS printer engines. Each printer engine processes drawing instructions into a format that can be rendered on a print device. Several of the objects in the Printer subsystem are helper objects, designed to provide information and control for things such as PostScript fonts and printer paper. 
The ArcPress printer engine is contained in the OutputExtensions library.
Use Printer Paper Settings option
Special mention must be made of the Use Printer Paper Settings check box in the Page and Print Setup dialog box.  If this box is checked, the selected printer's information is stored within the map document.  If the map document is subsequently opened in an environment that does not include that printer, ArcMap automatically unchecks the Use Printer Paper Settings check box and the page size set within the map document will be used. This can generate some unexpected results.  See the How to check for a saved printer and uncheck the 'use printer paper settings' option topic for more information and code samples.
 
Output Image Quality option
The Output Image Quality setting on the Print dialog box affects the resampling of raster imagery during printing. This setting changes the ResampleRatio property of the active view. PageLayout is a composite view that contains one or more data frames (Maps).  In this case, each of the data frames must be enumerated, and their ResampleRatio must be set. For normal output image quality, ResampleRatio should be set to the value esriRasterOutputNormal (3).  Lower numbers result in better quality at the expense of resource consumption and performance.  Higher numbers result in faster printing and lower resource consumption at the expense of quality. How to set output image quality shows an example of how to set the output image quality for either type of active view.

Paper

The Paper object is a key object required by the Printer object. The Paper object is responsible for maintaining properties related to the paper and printer used with the Printer object.  In the ArcMap application, the Paper object is accessed through the Printer Setup section of the Page and Print Setup dialog box.
 
When working with an ArcGIS application such as ArcMap, a Paper object is automatically created based on the default printer for the system. To use another printer on the system, you must define a new Paper object and set it to the printer or plotter through the PrinterName property. The Paper object can then be associated with the Printer object through the IPrinter.Paper property.
 
The Paper object is basically a wrapper for the Microsoft GDI DevMode and DevNames parameters. The Windows GDI documentation on the Microsoft Developer Network (MSDN) library provides further details about these structures. 
 
The DevNames structure contains strings that identify the driver, device, and output port names for a printer. The DevMode data structure contains information about the device initialization and environment of a printer.
 
The Attach method is used by a Printer object when the IPrinter.Paper property is set.  ArcObjects developers will typically not need to use this method.
 
QueryPaperSize is a useful method for interrogating the dimensions of the printer's currently selected form size.
 
When printing from pagelayout, the printer's currently selected form can be set to match the size already set up in the layout.  Developers can find information related to the layout's selected page size by using properties and methods from the PageLayout IPage interface.  For instance, you might want to read the pagelayout's page size, and try to match it with an available form on a given printer.  To do so, you would enumerate through the available forms on the printer using an IEnumNamedID enumerator, and select any matching form by comparing the page dimensions with the results returned by QueryPaperSize.  Details of this process and code are shown in How to enumerate through a printer's available page sizes.
 
Additional strategies for page, paper, and printer handling can be found in the ModifyMapPageandPrinter sample.

Exports

The export objects provide access to the graphical file export drivers. These objects expose properties and methods that control resolution, bit-depth, compression options, and so on.  See the ExportActiveView sample for an example of the export process.
At ArcGIS 9.0, the export objects have been completely rewritten. Version 9.0 export objects appear as a new set of components and interfaces, with new names to differentiate them from the old objects. You are encouraged to use these new objects when developing applications. The old 8.x objects are still included for backwards compatibility; however, they are slated for removal in the next release. You should update your existing applications to take advantage of the new export objects. The version of an export object can be determined by the convention used in its name: for example, PDFExporter is from 8.x, ExportPDF is the new 9.0 version. The old export objects do not appear in the object model diagram (OMD) and have been marked as "superseded" in the developer help.
Image format exports
The image format export objects render drawing commands into a bitmap that can be persisted into one of five different raster image formats: BMP, JPEG, PNG, TIFF, or GIF. If the drawing commands are generated by a Map object, the IWorldFileSettings interface allows you to output the image coordinates and transform to a world file.  New at 9.2, the IWorldFileSettings2 interface contains an additional parameter for data frame rotation.  This allows the export of a correct world file for a rotated data frame.  Use the IWorldFileSettings2.MapRotation parameter to specify data frame rotation—it can be populated from the active view ScreenDisplay.DisplayTransformation.Rotation  parameter.  For an example of how to do this, see How to initialize a worldfile with rotation.
 
For rasters smaller than 8 MB, the export object reads a device independent bitmap from memory, converting it to the target image format. For cases where bitmap size is larger than 8 MB, the bitmap is exported to a temporary Enhanced Metafile (EMF) file, which is subsequently parsed and rendered to the target image format. You can override this size threshold by creating the registry key "HKCU\Software\ESRI\Output" and adding a DWORD value named "esriExportRasterBufferSizeMB".
 
Microsoft font smoothing/ClearType and ArcGIS image exports
Font smoothing settings on the machine can negatively affect image exports from ArcGIS by increasing the color depth of the image.  Some symptoms of this include "salt and pepper" patterns across previously solid-colored areas of an image, or color interpretation problems.  To ensure quality output from ArcGIS image exporters, you can disable the font smoothing option until your exports are complete. Code examples of this are shown in How to check for, enable, and disable font smoothing, and the ExportActiveView sample shows how to implement these functions.
 
Vector format exports
The vector export objects translate ArcGIS native drawing commands into one of five vector graphic formats: EMF, EPS, AI, PDF, or SVG. The objects expose properties and methods that control things such as font embedding, inserted image resolution and downsampling, and several format-specific items.  One new vector export option is the Picture Symbol option, which demonstrates how to set these options.  See How to set the picture symbol vectorization settings for vector exports for more information.
 
Output image quality for exports
The Output Image Quality setting, on the Export dialog box for the vector exports, affects the resampling of raster imagery in some export formats.  The setting changes the ResampleRatio property of the active view.  PageLayout is a composite view that contains one or more data frames (Maps).  In this case, each of the data frames must be enumerated, and their ResampleRatio must be set.  For raster output formats, the Output Image Quality option should always be set to esriRasterOutputBest (1).  For vector exports, the value can be set at any integer value between 1 and 5 or by using the esriResampleRatio constants.  Lower numbers result in better quality at the expense of resource consumption and performance.  Higher numbers result in faster printing and lower resource consumption at the expense of quality.  How to set output image quality shows an example of how to set the output image quality for either type of active view.