For me its not clear which PDF book you are referring to.
And what does "all bunched up" mean ?
Pauls copy/paste from the Microchip PDF (Example 17-1) is correct, the only thing is that spaces/blanks are missing, which destroys the column alignment. However testing with exactly Pauls PDF document and example code I tested the following (I'm using Firefox Browser
and Foxit PDF Reader
And I verified that the source of the problem is the "copy" not the "paste" (Nirsoft Inside Clipboard). Results:
a) Loading the PDF in Foxit from disk shows a result like Paul posted. N blanks are reduced to 1 blank.
b) Googling the same PDF and open it in Firefox keeps the blanks and thus formatting.
So the workaround here is to load the PDF with Firefox, not with Foxit. This kept formatting.
However the PDF rendering in Firefox is still done by some Foxit component, which is by default (but optionally) installed during Foxit setup.
Apparently you are using Acrobat Reader, so probably you have an Adobe Browser component for PDF rendering.
I cannot test that for you. But like with Foxit you should at least test, whether it makes a difference when loading the PDF with Foxit.
(I also tested Chrome, which likely has its own PDF engine, -> it also "eats" the blanks. )
It's not really clear, whether that is you problem, but if yes, the above combination could be a solution, otherwise simply test more PDF readers and check what they copy to the clipboard.
post edited by rodims - 2018/11/10 07:49:46