Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text copied from generated PDF is reversed #31

Closed
jloveridge opened this issue Apr 11, 2019 · 4 comments
Closed

Text copied from generated PDF is reversed #31

jloveridge opened this issue Apr 11, 2019 · 4 comments
Labels

Comments

@jloveridge
Copy link

Original text from the markdown file:

This token must be used as the password portion of the HTTP basic authentication header.

Pasted text after copying it from the generated PDF:

.redaeh noitacitnehtua cisab PTTH eht fo noitrop drowssap eht sa desu eb tsum nekot sihT

md2pdf: 2.6.2
Platform: macOS 10.14.4
node: 10.15.0

@simonhaenisch
Copy link
Owner

simonhaenisch commented Apr 11, 2019

😂 best bug report yet.

Just pasting this from a pdf I just converted:

Lorem ipsum dolor sit amet consectetur adipisicing elit.

I. e., can't reproduce on macOS 10.14.3 with node 11.13.0 and md2pdf 2.6.4 (opened the PDF in Preview.app).

I'd be keen to know what actually causes this though, never seen it before 🤓 Maybe someone installed you a copy-paste reverser as a hoax?

@jonathanj
Copy link

I'm having the same issue. The output PDF looks fine (although the selection indicator looks weird) but the text copied to the clipboard is reversed. The document is in English, but this happens on a basic document:

# Testing

Hello world

I found these related issues:

This unfortunately dramatically reduces the value of converting my documents to PDF.

md-to-pdf: 2.8.2
node: 10.19.0
Platform: macOS 10.15.3

@simonhaenisch
Copy link
Owner

Ok thanks for the info... seems to be an issue with custom fonts and how they are embedded in the pdf.

This unfortunately dramatically reduces the value of converting my documents to PDF.

Sorry but there's nothing I can do about this (as for everyone, my time is limited). This tool merely composes different tools to make it easier to generate PDFs from markdown, but I can't offer any support for those tools. It's an upstream issue and I'm keeping the dependencies up-to-date so once it's fixed, it should work with md-to-pdf as well.

You could use the --as-html flag to convert it to html instead, and then you could see whether there's another way of converting that to PDF that doesn't have the issue. Maybe there's another browser that allows to print to PDF programmatically 🤷🏻‍♂️

@jonathanj
Copy link

jonathanj commented Feb 26, 2020

I discovered that the cause of this issue (in my case) was indeed the use of a custom font. I don't know if the font itself has an issue or if it's any non-system font, but using a system font (like "Helvetica Neue" on macOS) made this issue go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants