Intellij print all classes as PDF

时间:2016-08-31 18:49:30

标签: pdf text intellij-idea printing

My professor wants to get the code of my Library Management project not only as .java files but also as a one PDF file. Is there any way to do that in Intellij? I have a lot of classes, and I would like to avoid having to click and print every one of them separately.

Is there any workaround? I am using Mac OS. If I select the folder where the code is, the print button shows greyed out.

1 个答案:

答案 0 :(得分:4)

  1. 选择包含所有源代码的目录。如果您的代码分散在不同的目录中,则必须分批打印或将要打印的所有文件放入一个临时文件夹并选择它。
  2. 点击File - > Print
  3. 在弹出的菜单中选择All files in directory选项。 This help page解释了此菜单中的所有选项。点击Print
  4. 要将所有代码保存为PDF而不是物理打印机,请选择虚拟PDF打印机。 Windows 10默认安装了“Microsoft Print to PDF”。如果您没有,可以在this Wikipedia page
  5. 为您的操作系统选择一个