---
title: PMSessionGetDocumentFormatGeneration
framework: Application Services
role: pseudoSymbol
platforms: []
path: applicationservices/core_printing/1805525-pmsessiongetdocumentformatgenera
---

# PMSessionGetDocumentFormatGeneration

Obtains the spool file formats that can be generated for the specified printing session.

## Declaration

```occ
OSStatus PMSessionGetDocumentFormatGeneration (
   PMPrintSession printSession,
   CFArrayRef *docFormats
);
```

## Parameters

- `printSession`: The printing session whose spool file formats you want to obtain.
- `docFormats`: A pointer to your [doc://com.apple.corefoundation/documentation/CoreFoundation/CFArray](corefoundation/cfarray.md) variable. On return, the variable refers to a Core Foundation array that contains the MIME types for the available spool file formats. Each element in the array is a Core Foundation string. Despite what its name implies, the function `PMSessionGetDocumentFormatGeneration` has Create/Copy semantics which means you are responsible for releasing the array.

## Return Value

A result code. See [Result Codes](../core_printing.md).

## Overview

You must call the function `PMSessionGetDocumentFormatGeneration` between the creation and release of a printing session. See the function [PMCreateSession](../1463247-pmcreatesession.md). You should call `PMSessionGetDocumentFormatGeneration` only after the Print dialog is dismissed. 

The function `PMSessionGetDocumentFormatGeneration` determines the spool file formats that the specific print job supports. Spool file formats are represented by MIME types. The macOS print spooler supports PDF and PICT + PS. The default spool file format is PDF. PICT + PS is supported only for printing to a PostScript printer.

### Special Considerations

The PICT + PS spool file format is not available on Intel-based systems.

## See Also

### Accessing Data in Printing Session Objects

- [PMSessionGetDataFromSession](../1462964-pmsessiongetdatafromsession.md)
- [PMSessionSetDataInSession](../1461902-pmsessionsetdatainsession.md)
- [PMSessionGetCurrentPrinter](../1458998-pmsessiongetcurrentprinter.md)
- [PMSessionSetCurrentPrinter](1805523-pmsessionsetcurrentprinter.md)
- [PMSessionSetCurrentPMPrinter](../1461096-pmsessionsetcurrentpmprinter.md)
- [PMSessionSetDocumentFormatGeneration](1805527-pmsessionsetdocumentformatgenera.md)
- [PMSessionGetCGGraphicsContext](../1461952-pmsessiongetcggraphicscontext.md)
- [PMSessionGetGraphicsContext](1805529-pmsessiongetgraphicscontext.md)
- [PMSessionError](../1460003-pmsessionerror.md)
- [PMSessionSetError](../1460216-pmsessionseterror.md)
- [PMSessionGeneral](1805530-pmsessiongeneral.md)
