Output as PDF (Swift)

Set up and configure output to PDF from your reporting application. This option is useful if you want to archive or mail a document.

To output your report as a PDF file, specify PDF in the selectDevice() function.

See this code excerpt from the OrderReportSwift.swift file, which you can find in the OrderReportSwift demo project:
// Configure the report execution to output an PDF file.
let rcPtr = createRuntimeConfiguration(reportDesignFileName)
setOutputFileName(rcPtr, outputFilename)
selectDevice (rcPtr, PDF)
configureDistributedProcessing(rcPtr, "127.0.0.1", 7000)
Examine the selectDevice() function:
  • The first parameter is the runtime configuration pointer, which has the information about the report to be output.
  • The second parameter sets the device to PDF

Device-specific configuration functions

Once you have specified PDF as the output, there are device-specific configuration functions available:
  • configurePDFDevice()
  • configurePDFFontEmbedding()
  • setPDFImageResolution()
  • setPDFJPEGImageEncoding()

These functions should be included after calling the selectDevice() function but before calling the createContentHandler() function.

For the full list of available functions, refer to the Genero Report Writer C API documentation.