Try to check the following option: File->Printing Settings->Printing Options -> Print cell brackets->True (also available in the Option Inspector under "PrintCellBrackets").
To keep syntax coloring etc., please have a look at: Saving a notebook as PDF, preserving syntax highlightingSaving a notebook as PDF, preserving syntax highlighting.