Forum Bugs

PDF copy-paste loses formatting on OS X Mavericks

fortuity
I've generated a PDF file using Prince 9.0 on Mac OS X 10.9 Mavericks. In the past, using Mac OS X 10.8, I was able to copy from the PDF file and paste to a text file without problem. On Mac OS X Mavericks, the line breaks are lost.

The original HTML looks like this:

<pre><span class="n">source</span> <span class="s1">'https://rubygems.org'</span>
<span class="n">ruby</span> <span class="s1">'2.0.0'</span>
<span class="n">gem</span> <span class="s1">'rails'</span><span class="p">,</span> <span class="s1">'4.0.0'</span>


The PDF looks like this:

source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0'


After I copy from the PDF file and paste to a text file, I see this:

source 'https://rubygems.org' ruby '2.0.0'
gem 'rails', '4.0.0'


Perhaps Mavericks implements copy-and-paste from PDF differently?

Are you able to duplicate this issue?
mikeday
Yes, sounds like another bug in MacOS X Preview. Can you replicate this in Acrobat? (Does anyone use Acrobat on MacOS X?)
fortuity
Copying from Acrobat, the line endings are correct after pasting, but any indented lines lose their indentation (all lines are flush left).
mikeday
Right, that's not too surprising, as indentation in PDF is generally not indicated by embedding multiple space characters. I think we will need to revisit this copy-paste issue once tagged PDF is working, and see if PDF readers can take advantage of that.