1
votes

I have never written any printing methods myself, and after reading and trying a few examples in C# I'm really discouraged. Either I'm using completely outdated methods, not the right libraries or printing (at least in C#) is a real pain.

Firstly, the code to print even a simple document is complete and utterly ugly. I've read a few examples and just printing a string on more than one page is too complex imho. Even if I succeed in writing the code it just looks really ugly - nothing compared to what I'm used from LaTeX.

So my question is: Wouldn't it just be easier to generate a .tex document, compile it and print the resulting .pdf? Creating the .tex file would be easy enough, however I have no idea about compiling it under windows and printing the .pdf. Or am I missing some helpful libraries / tips in C#?

1

1 Answers

1
votes

I've never tried to print a file directly from C#, but if you really choose the LaTeX path, you would need to have a LaTeX compiler installed first. However, you might find the texlive.js project useful: if you manage to create the .tex file, you can display a webpage that renders that file to a PDF and delegate the printing to the browser.