I have recently started using the Better PDF plugin because it allows me to create links to specific PDF pages which work both in Windows and Mac computers. The fact that I do not even need to click on the link but the page is automatically embedded in the note is an added feature.
I have created two scripts for creating automatically the necessary snippet for embedding the current PDF page in an Obsidian note.
I prefer to save all my PDF files in one folder named "PDF files" inside my Obsidian vault. If you do not want to use this convention you need to adjust the url value in the scripts accordingly.
The generated snippet has the following form:
```pdf
{"url": "/PDF files/pdfTitle",
"page": [currentPDFpage]}
```
The pdfTitle and currentPDFpage are autopopulated.
If you are a Windows user you need to use the Adobe Acrobat Pro and create a new JavaScript Action.
Click on Specify Settings and paste the JavaScript code. Unckeck the option "Prompt User".
In order to create the snippet you need to click on the action and then on the start button.
After executing the action a new window opens with the appropriate code selected which you can copy and past on your Obsidian note.
You can either use Adobe Acrobat Pro or the free PDF reader Skim and my simple AppleScript. After executing the AppleScript the snippet will be copied automatically to your clipboard.