shg / org-inline-pdf.el

Inline PDF previewing for Org
GNU General Public License v3.0
48 stars 8 forks source link

Support rendering PDF's linked as attachment #15

Open SamuelFountain opened 2 weeks ago

SamuelFountain commented 2 weeks ago

Using GNU Emacs 30.0.50 with org version 9.8-pre, with an org mode header of the form

* Weekly Meeting 2024-06-06 Thu               :ATTACH:
:PROPERTIES:
:ID:       e4b537ab-560e-4a7f-a58e-44e56ec2c62c
:END:

I can render a pdf using the link with file

#+ATTR_ORG: :width 40% :page 1
[[file:data/90/4f1c95-a9ab-4575-a32c-5e3938e80562/example.pdf]]

but when I use the attachment link form

#+ATTR_ORG: :width 40% :page 1
[[attachment:example.pdf][example.pdf]]

it will not render the pdf. (for refrence png's will display inline with the attachment form).

shg commented 2 weeks ago

Hi @SamuelFountain

I haven't tested org-attach much but it is working here. But your example does not work.

[[attachment:example.pdf][example.pdf]]

The problem is the description part. The description part is the content that Org displays inline. If you have a text there, it will be shown. Just remove it.

[[attachment:example.pdf]]

Or you can also put a link to an alternative image for inline display in there.

[[attachment:example.pdf][attachment:forinline.pdf]]