1

TLDR: When I download Google Docs as PDFs, the text becomes distorted, with added spaces or missing letters when we try to copy the text from the PDF. This issue may be related to the font used in the document. I want to understand why this happens before deciding how to address it (by, for example, changing the font I use as standard in our documents).

The long version: I write documents for work in google doc and then download them to pdf. However, we have encountered problems with this where the pdf messes up the text.

In our latest report the text is:

“This was a working report in which we estimated the effects of psychotherapy in low- and middle-income countries (LMICs), as well as the cost-effectiveness of two psychotherapy charities: StrongMinds (SM) and Friendship Bench (FB). In the first part of 2024, we have updated several parts of the analysis.”

In the pdf the text looks like:

Text screenshot from pdf

This looks fine, except if you start highlighting the text:

Text screenshot from pdf where highlighting shows gaps

Which leads to problems when copy pasting the text:

“This was a

working report in which we estimated the e ects of psychotherapy in low- and middle-income

countries (LMICs), as well as the cost-e ectiveness of two psychotherapy charities: StrongMinds

(SM) and Friendship Bench (FB). In the rst part of 2024, we have updated several parts of the

analysis.”

And thereby, problems with text-to-speech apps. Which probably also means many problems with accessibility.

Maybe the problem comes from fonts rather than the general conversion to pdfs process. Notably, the EB Garamond font isn’t by default on the computer (MAC M1). If we download the EB Garamond font to the device I am making the download from, it works better. “This was a working report in which we estimated the eects of psychotherapy in low- and middle-income countries (LMICs), as well as the cost-eectiveness of two psychotherapy charities: StrongMinds (SM) and Friendship Bench (FB). In the rst part of 2024, we have updated several parts of the analysis. “ It seems to work better if we use a more common font, like Arial:
“This was a working report in which we estimated the effects of psychotherapy in low- and middle-income countries (LMICs), as well as the cost-effectiveness of two psychotherapy charities: StrongMinds (SM) and Friendship Bench (FB). In the first part of 2024, we have updated several parts of the analysis. “ Before I decide to change the style of all our reports, I want to ask if someone knows a solution to this problem? The fact that there are still problems (notably with the letter F) when we download EB Garamond is worrying. This suggests that the solution isn’t “have the font on your computer” per se. Hence, it’s possible (but not necessary) that there are other problems that could sneak in even with a more common font (e.g., maybe arial doesn’t mind the letter f, but it dislikes some other feature of text that we might only notice too late).

Note that:

  • I have tried both Firefox and Chrome
  • I have tried both using File > Download > PDF document and File > Print (with Save as PDF).
  • I am using a Mac M1
  • A colleague of mine has tried this as well as gets the same problems

2 Answers 2

1

As Rubén pointed out there are a variety of potential issues that could be cropping up and performing additional tests on your own is the most likely path to a solution.

  1. Fonts are a very complex learning space.
  2. Google doesn't embed fonts in PDFs.
  3. You are using a variable font
  4. There could be an issue with the font or interoperability issues between the font and other applications or your platform (example 1example 2).

Some Options and Tests:

In addition to Rubén's reccomendations,

  1. You could open an issue on GitHub: Google \ fonts \ issues
  2. You could change to a static font like Arial.
  3. You could use Google's recommended variable font family Noto, such as Noto Sans.
  4. You could try downloading as a DOCX or other format and then converting to PDF locally.
  5. You could perform tests on a different system and OS platform.
1

The Google Documents file format is known as kix. AFAIK, as July 30, 2024, Google has not made this format publically available. Google hasn't made the conversion algorithm public.

Considering the above, the end-users of web applications, myself included, can't provide a definitive answer. The only thing that we can do is to try to do "reverse engineering" or speculate about this.

Once said, except for the breaks on specific letters, like in this case, the second F in a double F, I don't think that font is the primary factor on the low fidelity conversion.

The problem might be affected by other factors, such as the document settings to handle manually entered hyphens, hyphen words, and text alignment automatically. Other factors that might affect the way that the dimensions are measured. The Google Documents API uses a dimension unit of PT (1/72 inches).

You might need to follow a systematic error-try basis process to find what might help you have better conversion fidelity, i.e.

  1. Ensure the document style matches the attributes of the converted file, like page and margin dimensions.
  2. Try using paper sizes that use inches instead of centimeters, like Letter instead of A4.
  3. Ensure to use standard font sizes for the selected font, i.e., use a size of 10 instead of 9.
  4. Consider replacing "normal" hyphens with non-breaking hyphens on hyphenated words and avoiding the automatic hyphenation.
  5. Add no breaking spaces where necessary.
  6. Use basic fonts like Arial or Times New Roman.

Workaround

I understand that relying on workarounds is not ideal for having a streamlined workflow and that you might prefer to work with another word-processing application. If you want to keep using Google Docs to write your documents or need to process the existing documents, the following workaround might help.

Export the document to another format having a "better" conversion to PDF process. First, look for a conversion tool that warrants meeting your requirements:

  1. Copy paste "fidelity".
  2. Accessibility / text-to-speech "fidelity".
  3. etc.

By "fidelity" I'm referring to,taken from Wiktionary's fidelity entry:

Accuracy, or exact correspondence to some given quality or fact.

Once you have the file format conversion tool that meets your output requirements, check the supported input file formats and choose the exporting format based on it.

Related

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.