Sign up ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Is there a way to use Google Search on an indexed (by google) PDF file to not only search within the PDF, but show snippets or previews of the search results? For example, one or two lines of text after the matching keyword(s)

share|improve this question

migrated from Mar 19 '14 at 3:51

This question came from our site for computer enthusiasts and power users.

Welcome to SuperUser. It looks like Google does include a couple lines of content from the PDF where the search term was found. ( ). Is the problem that your PDF is not showing those lines of text? – dangowans Mar 16 '14 at 20:00
"computers" occurs twice in the first document of that search, yet only one result is displayed. secondly, I'm talking about searching within a single pdf document for multiple occurences of the same keywords. you can do this on google drive for example, if the text "UniqueWord" is on page 500 of a large pdf, google drive instantly finds that pdf when you search your entire google drive for "UniqueWord", but it only shows the pdf file name, not the page number the result is located on or the text surrounding the result. – Luke Allen Mar 16 '14 at 20:15

1 Answer 1

The only thing you need to do is add the fallowing line as a parameter in your search query:


'filetype' parameter helps google to understand what kind of files you'r trying to search within, so you want to search in PDF files, so add the 'filetype' parameter with 'PDF' value.
As dangowans says, here is an example query about computer articles within the pdf files:

filetype:pdf computers

Basically, google shows up to two lines of the content as the snippets which depends on the query the user types. but if you want to get a little better preview of the pages, you can use plug-ins/extensions for your browser. for example, CoolPreviews and ezLinkPreview are two of the popular extensions for Google Chrome browser.

share|improve this answer
CoolPreviews and ezLinkPreview don't work on PDFs as I tested it. Furthermore, my search results don't return up to two lines of content as snippets when I search for filetype:pdf computers, can you provide a screenshot as I've tested on firefox, chrome, ie, and opera, and find it hard to believe. – Luke Allen Mar 16 '14 at 22:17
@LukeAllen Here's a screenshot with the two lines of text where the search term was found ( ). – dangowans Mar 17 '14 at 18:31
PDF file not pdf files, looking for two results or more for one single file, not one result for each file when one file may have the term "computers" multiple times. that is useless. – Luke Allen Mar 18 '14 at 2:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.