How to print my sketch?

With the Arduino versions 1.8 we find in the "File" the PRINT command
But in the versions 2.0 or Arduino Pro IDE, this command don't exist

How to do??

@jo_6466 i moved this to the correct section. Please be more careful where you post in future.

Hi @jo_6466. Thanks for taking the time to give the Arduino IDE 2.0.0 release candidate a try!

At this time, the Arduino IDE 2.x does not have any printing capability. You will need to use a different application to do so.

There is an existing formal request for addition of a print capability here:

If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.

Printing is a good idea; it would be even better if you could print a selection, which didn't work in the old version.

I'm reminded of the preface to the manual for Turbo Pascal 3 which said (roughly) "OK, now you have a computer, and the best compiler ever, what should you buy next? A printer". It's still useful.

I agree. Although we are all trying not to print trivially, sometimes you can't beat having the paper listing in your hand. Also, I always print any global data structures that I use.
Your concept of printing a selection is sound.

I found cutting/pasting into notepad works but corrupts the indentation.

Hopefully will happen soon?

Hi @nibor65. Instructions for setting up a 3rd party solution for adding printing support were shared here:

If you paste to Notepad++ the section that you want to print I beleive you can print it in colour. Just make sure you tell notepad++ that it is C++ code. It will then format it correctly.

Printing in the old ide didn’t work very well.
It seems that modern OSes want to print some representation of your GUI representation, and have lost the ability to print plain text (and colored text? Hah!)

Your best bet was the “copy as html” feature. Then paste into an editor that understands html, and print from it.

(oops. I guess 2.x doesn't have the "copy as html" feature.)

The above suggested PrintCode VS Code extension does exactly that, creates a html page and opens it in your browser allowing printing in color as well as to a pdf.

Only problem is it is a bit of a pain to select. I could not find a way to create a shortcut key.

ON A MAC .... For very easily print a sketch, just open its file using "open with" and choosing "TEXTEDIT" or still better "WORD" ... this way you can easily choose the font, his size, his colour and others .... and then print

I use Visual studio* , which is free , you can cut and paste into that and get well formatted coloured printout .
I’m still on 1.8 , but printing in that is rubbish too .

  • I had intended to use this for coding , but never sorted libraries etc , so just use it for printing !!