Are you experiencing issues with exporting to PDF or printing the already exported PDF file?
If the issue is related to exporting the PDF file can you provide additional details? Can you modify this sample so the issue is reproduced?
If the issue is related to the printing of the already exported PDF file, note that when exporting to PDF, the document size might be larder than the default A4 paper size, if that is the target paper size. To fit the whole exported document you can set the scale of the printer to the printable area or the page size, depending on your preferences.