# Preview / link to pages in pdf files

**URL:** <https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772>\
**Category:** Troubleshooting\
**Created:** [March 25, 2025, 4:01pm UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772 "2025-03-25T16:01:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![archiee](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@archiee](https://org-roam.discourse.group/u/archiee)\
**Post date:** [March 25, 2025, 4:01pm UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/1 "2025-03-25T16:01:11Z")

</div>

Hi eveyone,

I am new here, hope posting my question in the right place.

I am coming from obsidian. I can link to pdf pages directly in it. even preview them (eventho it can get slow on large file and adds a lot of overhead ).

Is there a way to do the same in org-roam? I know I can link to org headings and files via id but not sure about pdf pages.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [March 25, 2025, 4:24pm UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/2 "2025-03-25T16:24:08Z")

</div>

> [@archiee](#):
>
> I can link to pdf pages directly in it. even preview them (eventho it can get slow on large file and adds a lot of overhead ).
> 
> Is there a way to do the same in org-roam?

Linking from an org buffer to a PDF file or specific page is possible.

- File links are part of Org. Refer to [https://orgmode.org/manual/External-Links.html:](https://orgmode.org/manual/External-Links.html:) a PDF file is used as an example.
- For linking to a page, refer to [GitHub - fuxialexander/org-pdftools: A custom org link type for pdf-tools](https://github.com/fuxialexander/org-pdftools/). This is not part of Org-roam or Org themselves.

For previewing, I have not seen any way to enable preview within an Org buffer. It’s just one-person experience, but I don’t think it’s been done before (judging from how Emacs display works vs PDF works).

---

<div class="post-metadata">

**Author:** ![archiee](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@archiee](https://org-roam.discourse.group/u/archiee)\
**Post date:** [April 12, 2025, 10:01am UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/3 "2025-04-12T10:01:41Z")

</div>

Thank , I can’t figure out how to properly install packages in doom. github repos usually put the configs in their README for emacs not doom. I get that I should put `(package! PACKAGE_NAME)` in packages.el file. but how I should change the config? Is there a stanadard way to convert this config to work with doom?

```auto
(use-package org-noter
  :config
  ;; Your org-noter config ........
  (require 'org-noter-pdftools))

(use-package org-pdftools
  :hook (org-mode . org-pdftools-setup-link))

(use-package org-noter-pdftools
  :after org-noter
  :config
  ;; Add a function to ensure precise note is inserted
  (defun org-noter-pdftools-insert-precise-note (&optional toggle-no-questions)
    (interactive "P")
    (org-noter--with-valid-session
     (let ((org-noter-insert-note-no-questions (if toggle-no-questions
                                                   (not org-noter-insert-note-no-questions)
                                                 org-noter-insert-note-no-questions))
           (org-pdftools-use-isearch-link t)
           (org-pdftools-use-freepointer-annot t))
       (org-noter-insert-note (org-noter--get-precise-info)))))

  ;; fix https://github.com/weirdNox/org-noter/pull/93/commits/f8349ae7575e599f375de1be6be2d0d5de4e6cbf
  (defun org-noter-set-start-location (&optional arg)
    "When opening a session with this document, go to the current location.
With a prefix ARG, remove start location."
    (interactive "P")
    (org-noter--with-valid-session
     (let ((inhibit-read-only t)
           (ast (org-noter--parse-root))
           (location (org-noter--doc-approx-location (when (called-interactively-p 'any) 'interactive))))
       (with-current-buffer (org-noter--session-notes-buffer session)
         (org-with-wide-buffer
          (goto-char (org-element-property :begin ast))
          (if arg
              (org-entry-delete nil org-noter-property-note-location)
            (org-entry-put nil org-noter-property-note-location
                           (org-noter--pretty-print-location location))))))))
  (with-eval-after-load 'pdf-annot
    (add-hook 'pdf-annot-activate-handler-functions #'org-noter-pdftools-jump-to-note)))

```

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [April 12, 2025, 12:27pm UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/4 "2025-04-12T12:27:26Z")

</div>

I cannot help you with doom; I don’t use it. Many people who I see still active in this forum do not use doom, either. My suggestion is to ask questions and request help in doom’s forum

---

<div class="post-metadata">

**Author:** ![archiee](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@archiee](https://org-roam.discourse.group/u/archiee)\
**Post date:** [April 12, 2025, 6:35pm UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/5 "2025-04-12T18:35:17Z")

</div>

Sorry , I know it is not the prefect place to ask it. I did ask it on a doom discord, but only one that I find is not active at all. I am new to Emacs and its community. I would appreciated any guide on how and where to find help.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [April 12, 2025, 7:37pm UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/6 "2025-04-12T19:37:24Z")

</div>

I just googled “emacs doom how to configure packages”.

One of the top hits is this. In it, the author of doom emacs, hlissner, says the following, which to me answers your question about `use-package!` and clarifies the purposes and difference between package.el and config.el (I am omitting a quote for the latter point).

> <https://github.com/doomemacs/doomemacs/issues/241>
>
> After reading through the docs I'm still a bit confused on how to properly load …packages. I have noticed an increase in emacs loading time (1s --\> 3s) after having added 5 packages. 
> 
> My private module for doom is version controller \[here\](https://github.com/teesloane/dotfiles/tree/master/tees)... but I'm mostly wondering - when to use the \`package!\` and \`use-package!\` macros. 
> 
> Currently I'm doing the following in \`packages.el\`
> 
> \`\`\`
> ;; -\*- no-byte-compile: t; -\*-
> ;;; private/tees/packages.el
> 
> (package! rjsx-mode)
> (package! doom-themes)
> (package! prettier-js)
> (package! browse-at-remote)
> (package! yaml-mode)
> (package! markdown-mode)
> 
> 
> ;; This might be slowing boot ... should make this happen on hooks?
> (use-package! rjsx-mode :demand t :config)
> ;; (use-package! doom-themes :demand t :config) ;; I think this is already installed
> (use-package! prettier-js :demand t :config)
> (use-package! browse-at-remote :demand t :config)
> (use-package! yaml-mode :demand t :config)
> (use-package! markdown-mode :demand t :config)
> \`\`\`
> 
> I noticed that if I don't use \`:demand\` a package is not available in \`M-x\`. 
> 
> I'm super new to configuring emacs, but having lots of fun with this. So if you see anything that could be improved let me know...
> 
> Thanks for your time and all your hard work!

> `use-package!` is for configuring plugins and describing to Emacs when (and how) to load them. It is a thin wrapper around [use-package](https://github.com/jwiegley/use-package). It accepts the same arguments. It is tremendously helpful; I suggest you get to know it better.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [April 12, 2025, 7:41pm UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/7 "2025-04-12T19:41:58Z")

</div>

In terms of getting help… README of the doom emacs’s github repo has “[Getting help](https://github.com/doomemacs/doomemacs#getting-help)”. If Discord is not active (I see about 1800 members online now), they seem to also have a Discourse forum. I guess you could also ask a question in the github issue like the one I quoted above if your question has not been addresses elsewhere. It is always advisable that you search FAQ and other places for an answer first — in your case, I think it’s already answered.

---

<div class="post-metadata">

**Author:** ![archiee](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@archiee](https://org-roam.discourse.group/u/archiee)\
**Post date:** [April 13, 2025, 9:28am UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/8 "2025-04-13T09:28:31Z")

</div>

The link you send is very helpful. I did read the documentation on it but it was not very clear about many issue.

I checkout the Discourse Forum which was empty. Thank you very much for you help. sorry again for cluttering topics here. I like to learn more about org-roam more. I think I would do that after figuring out basics of doom emacs. Emacs learning curve is really steep indeed. I think learning Nvim was a walk in a park compared to emacs and elisp.

---

<div class="post-metadata">

**Author:** ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)\
**Post date:** [April 13, 2025, 8:29pm UTC](https://org-roam.discourse.group/t/preview-link-to-pages-in-pdf-files/3772/9 "2025-04-13T20:29:57Z")

</div>

@archiee There is an inherent problem in reducing complexity - it always comes back - with a vengence.In reality the basics of package management is very simple, one can write under 600 lines a system that interacts with melpa/github and maintains autoloads.

Doom tries to be user friendly - and in each step they take towards this, an extra set of assumptions about the user are implicitly made, this stacks up into its own complexity - that was not present in the original.

If you are just beginning out, you might like to just use vanilla emacs, youd find the learning curve isn’t so steep - there are only a few ‘basic rules’ that interact in different ways to generate the seeming complexity - once you feel comfortable with the basics - the rest all falls into place.
