'Export C# Solution to PDF

I have to generate my whole Project as a PDF-File (every class has to be included).

The only was I found was to Print every Class as one PDF with the Visual Studio built-in Print function.

Is there an easier Solution?

I don't want to do this I have to do this s**t



Solution 1:[1]

You can use this bash command from the top directory: (works even on Windows if you have WSL installed)

(case sensitive)

cat `find . -type f -name '*.cs'` >> concat.txt

Or Windows powershell equivalent (not case-sensitive):

get-childItem . -Recurse -Filter *.cs | get-content | set-content concat.txt

Then you'll have all your files as one concat.txt, and you can print it with your favorite editor.

If you need to automate this process, there are command line pdf generator, but I'm not sure if this is what you want.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1