I need to create a database of different PDF files which are either uploaded by users on the server or are saved as bookmarks for the pdf files available on internet. The files available through internet are opened in pdf.js. I came across the the fingerprint that pdfjs generates for some of its operations and was wondering if I could use that to identify the pdf uniquely. But to do that I also need to generate this fingerprint myself for the documents that are uploaded but not opened via viewer.js (since I can get my hands on this fingerprint via viewer.js but not otherwise). I can use iTextSharp as pdf parser for pdf parsing but have no clue how pdfjs generates the fingerprint.

It seems pdf.js is doing the following in its fingerprint():

  • If available, it uses the first ID string from the PDF trailer.
  • If there's no ID, an MD5 hash of (part of) the byte content is calculated.

That's my quick interpretation of the current pdf.js fingerprint() source

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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