Link to specific page of a pdf

Taking notes using markdown files, is it possible to add a link to a specific portion of a PDF? I have found that you can add a link to a specific page by linking to the PDF and adding say ?page=15 at the end of the link to get it to go directly to page 16. Not sure why listing it as page 15 brings me to page 16. But it works. I’m also wondering if it is possible to link to a specific quote on a page.

It’s -1 based.

Here’s a script

-- Copy Reference URL

property revealRecord : false

tell application id "DNtp"
	try
		if not (exists think window 1) then
			error "Please open a window"
		else
			set theWindow to think window 1
		end if
		
		set theRecord to content record of theWindow
		if theRecord ≠ missing value then
			set theType to (type of theRecord) as string
			if theType is in {"PDF document", "«constant ****pdf »"} then
				set thePage to current page of theWindow
				if thePage ≠ -1 then
					set theRefURL to reference URL of theRecord & "?page=" & thePage
				else
					set theRefURL to reference URL of theRecord
				end if
			else
				set theRefURL to reference URL of theRecord
			end if
			if revealRecord = true then set theRefURL to theRefURL & "&reveal=1"
			set theName to name of theRecord
			set theMarkdownLink to "[" & theName & "](" & theRefURL & ")"
			set the clipboard to theMarkdownLink as string
			display notification "Copied" with title "DEVONthink"
		else
			error "Please select a record"
		end if
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
		return
	end try
end tell
2 Likes

No. The term I think you are looking for is deep linking, and the forum offers a number of results when you search for it, including more about software called Hook.

Thanks for the help, and for the script.