PyCharm 2021.2 Help


File | Print

Use this dialog to specify the text to print and configure the print layout.

File <name>

Print the file, which is currently selected in the Project view or opened in the editor.

Selected text

Print the text selected in the editor.

All files in the directory

Print all files in the current directory.

Include subdirectories

Print the files in the subdirectories of the current directory as well.


In this tab, specify the basic print layout settings.



Paper size

Select the desired paper size.


Select the desired font style and size.

Show line numbers

Select this checkbox to have line numbers printed.

Draw border

Select this checkbox to have a border printed.


In this area, specify the paper orientation. The available options are:

  • Landscape

  • Portrait


In this area, specify the style of the printout by selecting the relevant checkboxes. The available options are:

  • Color printing: print code in color.

  • Syntax printing: print code with syntax highlighting. Otherwise, code will be printed as plain text.

  • Print as graphics: generate graphics and send it to the printer driver. Otherwise, the IDE sends text to the printer driver. This is a legacy option that might be helpful if there are printer driver issues.

    For example, if you clear this option and print to a PDF printer, you can select text in the result file. When the option is selected, you cannot select and copy text in a PDF file.

In this tab, specify the contents and placement of the header and footer.



Text line

In this field, specify the contents of the header or footer. If necessary, combine plain text with print keywords. By default, PyCharm suggests to print the name of a file $FILE$ in the header and the current page number $PAGE$ of all pages $TOTALPAGES$ in the footer.

  • $FILE$ prints fully qualified filename.

  • $PAGE$

  • $DATE$

  • $TIME$

  • $FILENAME$ prints filename without path.



Use this list to specify whether the above line will be printed in the header or in the footer.


From this list, select the desired alignment.


In this area, specify the desired font style and size to print the header and footer text.





In this area, configure text wrapping. The available options are:

  • No wrap

  • Wrap at word breaks


Use the text boxes in this area to specify the margins in inches.

Last modified: 08 March 2021