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

Cannot copy text inside PDF?! #193

Open
Alwinator opened this issue Oct 6, 2020 · 2 comments
Open

Cannot copy text inside PDF?! #193

Alwinator opened this issue Oct 6, 2020 · 2 comments

Comments

@Alwinator
Copy link

The text inside the PDF is not select-able and not copy-able.
This is because I used a custom font (Open Sans). Is it possible to make the text select-able and copy-able with a custom font?

My CSS code:

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap');

span, p, h1, h2, h3, h4, h5, h6, td, th, li {
    font-family: 'Open Sans', sans-serif;
}
@neallred
Copy link

I also have this issue, including tools like pdfgrep do not find any text in the PDF. My CSS files are loaded from on disk FWIW. When I comment out the font declarations so the fonts are not loaded, suddenly I am able to select & copy text, and tools like pdfgrep can find text in them.

Font declarations: https://github.com/neallred/resume-formatter/blob/master/in/neallred.css#L1-L23
Using CSS file in document generation: https://github.com/neallred/resume-formatter/blob/master/package.json#L7

@Alwinator
Copy link
Author

It is not a solution to this exact problem, but I am using Asciidoctor instead of Markdown now. It has very similar syntax and offers advanced features and out-of-the-box PDF generation using asciidoctor-pdf.

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

No branches or pull requests

2 participants