Google Drive says pdf's created with LibreOffice are executable files

Google Drive says that all the pdf’s that I have created with LibreOffice are executable files. This is annoying when sharing a file with others because they might think that I tried to hack their computers.

I have tried to create some pdf’s from a different computer and the result is the same. I have scanned the pdf’s with several online scanners and all of the files are clean. I even uploaded some pdf’s to OneDrive and there was no problem at all.

Why does Google Drive behave like that? How can I make Google Drive not tag the pdf’s as suspicious files?

If we just use extensions, google is right: PDF can contain executable code, especially JavaScript is not uncommon.
Please try to print a sample text to a pdf-printer and check, if it is tagged also as suspicious.
Because of this my company has set SumatraPDF as default reader - it doesn’t include this feature.
If only some pdfs are tagged as suspicious, please upload a sample file here for inspection.

Hello! I’ve just realized I couldn’t print to pdf. My only option to create a pdf was the export-to-pdf button in the toolbar. I have installed a pdf printer and the files are ok. The problem seems to be in the export-to-pdf tool.
I have uploaded a sample file tagged as suspicious in case someone can help with this problem.
sample.pdf (10.4 KB)

I try to check on your file the next days, a I’m not on my usual job now, but traveling…
One idea I have: Try to generate one of the “archive” formats of pdf, like pdf1/A.
I guess google will check the type of pdf, and active content like Javascript is forbidden in archive-pdfs. (Use the Export-dialogue, to get all options…)

I have downloaded the sample.pdf, and put it to my Google Drive. It looks OK there - or maybe I just don’t see where to look for the “executable file” flag.

So please provide a description how does the problem manifests itself; screenshots would be helpful. Note that the exact procedure of uploading to Google Drive is also important: do you use Web UI, or maybe you use some utility that maps the Drive to a local disc? Your OS and LO version information is also needed.
My suspicion is that there is nothing problematic with the PDFs, just some filesystem file attribute is considered by Google Drive.

To see the executable flag you must share the file with a link that gives access to everybody. I have attached a screenshot to this message.

Here is the link to my Google Drive: sample.pdf - Google Drive - it seems to still be OK.

EDIT: Ah, so the warning happens when you download it.

Interesting; this happens with PDFs generated using LO 3.3.
It would be nice to ask Google why do they issue this warning. It may be something wrong with our files; but just as well, it could be some problem on their side.

Thanks for the advice. I have generated a pdf with PDF/A ISO 19005 format and the problem persists. I have tried the three PDF/A versions (1b, 2b, 3b). Here is a file with PDF/A-2b format.
pdf A.pdf (23.7 KB)

In the export-as-pdf dialogue there are some marked boxes that I can’t unmark. Probably one of these options is causing the problem. I see “Tagged PDF (add document structure)” in the General tab and the following:

Exactly! Google is the one to blame because other storing services don’t see any problem with the files I create with LibreOffice. Or maybe Google knows something that the rest don’t. One day we may know what Google knows and why they do what they do.

I have posted this problem in the Community Support of Google but still no good answer. I’ll create a post in English because the Spanish Community is not very active.

Thanks; and I posted a support request from my GDrive. I hope they would get back to me with some clarifications.

1 Like

Downloading your link shows the message for me:

(In Spanish)

Yes, I use the Web UI to upload the pdfs.

I’m using Manjaro. It’s fully updated. About LibreOffice I have the community version.

Yesterday I created a pdf on Debian and Google Drive also tagged the pdf as executable. I’ll try to create a pdf from a Windows machine at work to see if the problem replicates also there.

I also think that changing some attribute in the pdfs created in LibreOffice could do the trick, but I don’t think we can apply a workaround as mere users.

Could you replicate my problem to discard that if it happens only to me? Please, follow these steps:

  1. Create a pdf in LibreOffice using the export-to-pdf button in the toolbar.

  2. Upload the pdf to Google Drive.

  3. Get a link to share so that everybody with the link can see it and download it.

  4. Open a private window in your browser, paste the link and try to download the file.

If the file downloads straight away not showing this warning message, then the problem is probably my computer or the distros I use:


Read above: @mikekaganski and @mariosv get the same note as you.
Funny note: My Android-phone opens the Link of Mike without any warning, so Google seem to warn only desktop users, or only, if there is space on the screen…
But re-reading your question. You don’t have any pdf in your Gdrive, wich is not flagged executable? So ALL pdfs are tagged?

Here is an example of pdf that is not flagged. I have just created it in LibreOffice with a pdf printer:

I love GNU/Linux! I have been trying to know what is wrong with the pdfs and finally I found the solution. Sadly, there is nothing I can do and I think that only the programmers of LibreOffice can solve the problem.
I have followed a tutorial on using a program called peepdf to disect pdfs. I have compared the outputs of an ok pdf and a executable pdf.
Here is the output of the ok pdf:


Here is the output of the executable pdf:


The difference is in object 12. Let’s see what object 12 is made of:


Voila! There it is. A simple string that says

/OpenAction [ 1 0 R /XYZ null null 0 ]

is the one to blame. I have found this Github issue from the mpdf project that clarifies how to solve the problem:
Now it’s only a matter of some small code writing to repair the export-to-pdf extension in LibreOffice. I don’t even know how to report this issue to the development team in LibreOffice as I am not a programmer myself. Is anybody here in the development team? Can anybody open a ticket about this topic?


Anyone can report bugs, it is best for accuracy if the person encountering the bug does it, How to Report Bugs in LibreOffice - The Document Foundation Wiki

You are right. I am working on it. But I have found a problem when reporting the bug: I have to specify the earliest version of LibreOffice with the bug. All this is too new for me and it would take me some time to learn where to find older versions of LibreOffice, how to install them for testing and reproducing the bug in every version. Anyway, I will do it but it will take some time.

Please do not consider the stuff there as some “requirement”. It’s not to force you to investigate: it’s just which oldest version do you know. I.e., if if didn’t work for you in prior 7.5.2, and now you installed 7.5.3, and it still doesn’t, you don’t put the latest 7.5.3, but the 7.5.2 (even if later someone discovers that it didn’t work in 4.4.)

Don’t waste your time at all. Just put there what you already know, and don’t feel like you need to spend even more time.

@Eugenioh please do not forget to mention the bug number here; it would allow others to see its progress; and I’d be able to add some data there, and confirm it. Thanks!