Print specific pages

Refer to the following example code to export some specific pages to the PDF file.