QPrinter printer(QPrinter::HighResolution); printer.setCreator("My Application"); QPainter painter; painter.begin(&printer); // Print document using painter painter.end();In this example, a QPrinter instance is created with the HighResolution option. Then, the setCreator function is used to set the creator name to "My Application". Finally, a QPainter instance is created and the document is printed using it. The Qt library is required to use QPrinter and its functions.