Forum Discussion
Is there any way at all to search for PDF files using PDF keywords in SharePoint Online?
- Oct 14, 2017
SharePoint can query the properties (i.e. metadata) of a document only if there is a document parser that "promotes" such properties when uploading the document.
Unfortunately, SPO does not implement out of the box a document parser for PDF files, hence the PDF properties are not "promoted" (i.e. they are ignored).
So, if you want to query PDF properties in SPO, you have to fill by yourself, manually or automatically, the corresponding columns on the document library where the PDF is stored.
See https://blogs.technet.microsoft.com/wbaer/2014/08/29/document-property-promotion-and-demotion-overview-and-considerations/
The PDF property keyword is not searchable on SharePoint Online. The only alternative is to use a custom solution (can be build in JavaScript) that extracts the keyword property value from PDF files and then captures the value into a SharePoint column. This allows use of the keywords value in searches but also in views.
Because it uses JavaScript it means it will also work on SharePoint Online and can be packaged in different ways (e.g. provider hosted app). Such a custom solution can read all the properties in PDF files like XMP fields. modification date and custom properties. As far as I know there are no free solutions that offer this capability. It would be beneficial to a wide audience because PDF is a common format.
Paul
> The only alternative is to use a custom solution (can be build in JavaScript) […]
I’m not quite familiar with the SharePoint Online architecture. I took a quick look at the article https://docs.microsoft.com/en-us/sharepoint/dev/general-development/sharepoint-add-ins-compared-with-sharepoint-solutions and my understanding is that my custom solution will have to either run in an active browser session or be hosted and run somewhere else, and either way it’s going to have to use the standard, client-facing APIs to fetch and parse the PDF files and update their columns. Is that right?
- Paul de JongDec 29, 2017Iron Contributor
Indeed. The interaction between JavaScript and SP will use REST API or CSOM.
Suppose the "solution" adds an extra option in the ribbon to upload PDF Files. This then allows for the JavaScript (running in the browser) to parse the PDF file prior to uploading, extract PDF metadata properties and then fill the corresponding SharePoint columns. This does require the users to use the new option to upload pdf files. This will not work in all cases (e.g. when they use explorer view to upload files).
To cater for the existing PDF documents already present in SharePoint you will need to find all PDFs without extracted metadata and then extract the PDF metadata. This needs to be repeated regularly to fix PDF files that are uploaded. It can be done but not trivial and requires ongoing attention.
A posssible alternative is to use workflows / flow. This event driven solution then needs to provide the logic to extract the pdf metadata. Plus you will need a solution to cater for the existing PDF documents. Again this is not simple to implement.- DeletedDec 29, 2017
It’s a pretty large PDF library and is almost always updated by the OneDrive desktop app. So I guess workflows is the only way to go. I’ve just seen that it’s possible to send HTTP requests from SP 2013 workflows with for example file GUIDs upon file creation and update and I’ll look further in this direction. Thank you.