简体   繁体   中英

Annotate the pdf file on the location clicked by user

I am having trouble in trying to find the solution for the below described problem.

Annotate the PDF file when user clicks on specific location in pdf and then finaly save the pdf which in future opens at annotated location.

How to approach this?

What I have tried.

  • I have tried to find various libraries irrespective of programming language (since programing language is not the dependency)- found few libraries like minipdf in python , pdfbox in java to mention few relevant ones. Finally selected pdfbox since it seemed to be mature enough to provide the solution closeby.
  • There are various hurdles now how to get user the location clicked by the user? since after getting the location I can able to perform various actions like annotating at the clicked location and then saving the pdf on the same specific location.
  • It seems I have to write whole pdf javascript to approach it but again how to do so?

I had similar problem and have solved it the other way. In my case I am not opening PDF in Adobe reader, but in browser. So what I did is converted the pdf to html using python libraries (Let me know if you are interested, I will share different library names with their pros and cons).
Now that html can be edited easily. We can put hyperlinks, highlights everything there as source code is with us.
This workaround may be applicable to you if your front end is web based.


PS: Wanted to post this workaround as comment, but couldn't due to little less reputation count as of now. Hope, it won't be downmarked :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM