Jump to content

(Archived) source beautifiers? any expert knowledge?

Recommended Posts

hi all,

i'm looking for a way to convert colored and formatted source-code files to EN. easily.

on my unsuccessful research here, i found only requests and those forgotten ones (1,2)

but i've read here about "source beautifiers".

is there any EN user out here, who can offer a short how2 or maybe a good site, where to start with these programs?

i myself, use notepad++ for windows and it has a very good customizable syntax highlighting feature, which i extended to highlight my code-files, but it seems that i cannot paste the highlighted code into EN because it looses coloring. also, i cannot save the files as html, as the coloring is not exported as well ;-/

hereupon i had the idea to mass convert the source-code-files with one of these mentioned source beautifiers.

so i would greatly apreceate any knowhow which was collected with such a tool *and* the succsesful import to En. :-)

thank you,


Link to comment

I think you might have a problem with the colour. In my experience these 'beautifiers' or 'pretty printers' will indent the code, align brackets etc, in the code, directly affecting the text file. All they are adding is whitespace.

However, the colour is not 'fixed' in the text file itself, it is created on-the-fly by the display element of the 'pretty printer' when the code is displayed on the screen. It cannot embed anything like a control code or a font colour change into your source code, because that would introduce erroneus characters into your file. Therefore, copying the text only copies the text - not the colour.

Link to comment

Just had another thought - if you are using Windows you would install a PDF printer driver like the free version of PrimoPDF. This will appear on your machine as though it was a physical printer. Print from Notepad++ to that and it willcreate a PDF, which will contain your beautified and coloured source code. Import the PDF to Evernote.

Link to comment

Gurkha, I was thinking along similar lines (only using screen caps) but I'm also wondering if evermullah is wanting to easily/quickly copy any of the code snippets to paste elsewhere. The screen caps & PDFs would display the code nicely but not allow copying of the code. (At least IME with printing to PDF.) I was thinking he could have the PDF for easy reference but also copy the code into the note, too for easy copying/pasting. Not sure if that would work for him or not.

Link to comment

It depends on the 1) PDF viewer and 2) what settings you choose when ytou create the PDF. For a standard non-protected PDF I've used the free (and brilliant) PDF viewer called PDF-Xchange which allows you copy text out of the PDF, to annotate the PDF, etc. etc.

Copying the cde into the note together with the PDF would work too.

Link to comment

I'm going to have to take a look at PDF-Xchange. I've used CutePDF (free) to print & Paperport (came with one of my scanners) for scanning & annotating. Paperport allows limited annotations but it would be nice to have something more robust. But I'm not gung ho enough about it to buy something. ;)

Thanks for the tip!

Link to comment

thank you guys!

well, the coloring is the problem here, i see.

i will try the suggestion with printing a pdf, pasting the pdf into EN and then select all the text and then copy it into the clipboard and then delete the pdf in the note and then paste the clipboard to the note again.

all that hassle because i maybe need (but not mentioned before, sorry) to edit/imybprove/adjust the code later.

i've read about the inline editing of pdf document inside en-notes, so maybe this is an easy one. (beside the too much steps to do this...)

on the mac, there is a very simple solution, all you can print, you can save as a pdf, natively. very nice. but unfortunately, the syntax highligher is on windows and printing from windows is kinda pain here...

anyways, just to whine a little bit: with onenote, i was on a remote desktop of another win-computer and i just copied the colored code to the clipboard and pasted it into my local onenote. less than 20 secs. done!

ok, its all m$-software, so i don't blame en, but...it could be soooo easy...




after printing this from windows notepadd++


the final PDf looks good:


but pasting the content of the pdf looses all the formatting ;-/


no matter, where i copy the code (win/mac) or where i insert it (textedit.app/en/m$word)

i think, this might be a problem of the pdf-generator?

i use pdf-factory, which i purchased some time ago.

i will try the mentioned one above...

...making my life easier....what a gyp...

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...