GitbookIO / gitbook

The open source frontend for GitBook doc sites
https://www.gitbook.com
GNU General Public License v3.0
27.17k stars 3.87k forks source link

PDF: code blocks are impossible to select and copy/paste? #290

Closed toto88x closed 10 years ago

toto88x commented 10 years ago

I'm writting a technical book with gitbook that has a lot of code blocks.

When the book is in PDF, I can't properly select with my mouse a code block. It means that it's impossible to copy and past some code from the book.

That's a deal breaker for any technical book.

toto88x commented 10 years ago

@SamyPesse Do you have any information on this? Is it a ebook-convert issue? Can it be fixed? I'm asking because not being able to copy/past code from a pdf is super annoying for technical books.

Thanks!

AaronO commented 10 years ago

@toto88x I've noticed this too. I'm not sure if it's fixable or not. It doesn't seem like ebook-convert rasterizes those blocks (you can still zoom without any pixelization), so in theory it should be possible.

I'll take a look at this.

SamyPesse commented 10 years ago

It's working with the latest version (example: https://www.gitbook.io/book/gitbookio/javascript). Because we now use the default font instead of a special font.

toto88x commented 10 years ago

@SamyPesse Now with the latest version I can select the code. But on my mac, when using Preview, I still can't past the code.

So the issue should not be closed I think.

eljefe6a commented 10 years ago

I'm hitting this issue as well. I tested Preview on OSX 10.9.4 on the JavaScript book and that didn't paste. When you paste, everything is empty spaces. I tested with Chrome on Mac and that pasted correctly. I tried some Linux ones as well and those pasted fine. Also, Acrobat Reader pastes correctly.

I've Googled around and can't find anything specific on this issue for ebook-convert. I may put a note in my output that if pasting doesn't work, you'll need to use another program. This is a painful issue, though.

thormagnusson commented 8 years ago

Is there really no solution to this? - I've been having this issue in a book about coding I'm working on (and copying-pasting from the PDF is essential). Can't believe it hasn't been solved two years later.

eljefe6a commented 8 years ago

I ended up switching to Pandoc which didn't have this issue.

thormagnusson commented 8 years ago

So you're not hosting your book on GitBook then? - I was hoping to host the book on GitBook and readers could choose the format (PDF, eBook, HTML, etc.)

eljefe6a commented 8 years ago

Nope

irontribe commented 7 years ago

I find copy and paste are disabled when using Safari on MacOS anytime I'm working in Markdown view. Does not seem to be a Chrome problem.