The PrintCode extension I mentioned in my previous post is no longer actively maintained. From my limited use of the extension, it seems to work perfectly well so this is not necessarily an immediate problem and if you are already using the extension and happy with it then you are free to continue to do so. However, for any new installations, or for those who prefer to use actively maintained software I can suggest an alternative extension:
You might also find this extension a bit more convenient to use since it allows you to print by clicking an icon in the primary Arduino IDE user interface rather than having to use the "command palette" as is required when using the PrintCode extension.
Install the extension
If you have used VS Code, you will be used to installing extensions via the manager in the application. Arduino IDE 2.x does not have that capability, so the extension installation process is different.
- If Arduino IDE is running, select File > Quit from the Arduino IDE menus.
All Arduino IDE windows will close. - Click the following link to open the latest release page on the extension's GitHub repository in your web browser:
https://github.com/PDConSec/vsc-print/releases/latest - Click the download link for the
.vsixfile that you will see under the "Assets" section of the page.
A file download will start. - Wait for the download to finish.
- Create a folder named
pluginsunder the Arduino IDE's configuration folder:- Windows:
(whereC:\Users\<username>\.arduinoIDE\<username>is your Windows username) - Linux:
(where/home/<username>/.arduinoIDE/<username>is your Linux username)
The .arduinoIDEfolder may be hidden by default in your file manager and terminal. - macOS:
(where/Users/<username>/.arduinoIDE/<username>is your macOS username)
The .arduinoIDEfolder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.
- Windows:
- Copy the downloaded file to the
pluginsfolder you created.
(e.g.,C:\Users\<username>\.arduinoIDE\plugins\pdconsec.vscode-print-0.11.19.vsix).
Printing sketches
- Open the sketch you want to print in Arduino IDE.
- Select the sketch tab you want to print.
- Click the icon that looks like a printer ("Print") at the right side of the sketch editor toolbar
The sketch file will now be rendered as a webpage in your browser and a print dialog will open. - Configure the print job to your preferences and click the "Print" button when you are ready.
Configuring the extension
In case the default behavior of the extension is not to your liking, the extension offers several configuration settings:
- Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
- Select the "Preferences: Open Settings (UI)" command from the menu.
A "Preferences" tab will open in the Arduino IDE main panel. - Select Extensions > Print from the navigation panel on the left side of the panel.
The settings for the Print extension will be shown. - Adjust the settings of the Print extension according to your preferences.
- Click the X icon on the "Preferences" tab.