Thanks for your question and for posting the complete source text of the form and gallery; very helpful.
I copied your code into my test system and it is working fine for me. When I enter a word that appears in the Title or Description field the corresponding items are displayed in the gallery output.
You wrote “if there is a keyword.” Where does the keyword value appear in the Media Library items associated with your PDF documents? By default, only the Title and Description fields are searched, but you can extend the search to the Name, ALT Text, Caption and/or taxonomy Terms if you need to.
Note that the keyword search is not able to look inside the PDF documents to match values contained in the document content.
Any additional information you can provide will let me be more specific.
By the way, you can suppress the default “all PDFs are displayed” behavior if you want to. See this earlier topic:
Tag cloud output
I will leave this topic unresolved until I hear back from you. Thanks for your interest in the plugin.
It has been two months since my last post in this topic and I have seen nothing further. I assume you have found a solution that works for your application.
I am marking this topic resolved, but please update it if you need any further help with the topic. Thanks for your interest in the plugin.