Download Wikipedia article as a .pdf, with program not shown correctly

wikipedia

I tried to download https://en.wikipedia.org/wiki/Java_(programming_language) as a PDF file. I clicked "Download as PDF", and downloaded the generated .pdf file.

But the Java code part in the .pdf file was rendered as ordinary text, and lumped up together (no syntax indent and no highlighting which appear in the web page).

Is there a solution for that?

Best Answer

In Chrome, at least, if you use your browser to Print the page, with the choice "Save as PDF", you'll get a PDF file that does not have that formatting problem.

This PDF doen't have two-column formatting nor as nice pagination, but it's more readable than the word-wrapped source code.

Also, do report the bug to Wikipedia.