On Wed, Apr 5, 2017, 5:21 AM Julian M. Burgos <julian.burgos@hafogvatn.is> wrote:
Can you clarify the purpose of this function?  I understand that
produces an image of each pdf linked to the file.

That's correct, but the user can control when that happens by adding that function to the appropriate hook. 

 But
the question in
emacs.stackexchange was about displaying pdf's as inline images.

Yes, I forgot to change the hook when I updated the whole answer; I have fixed that now. Now the answer shows how to add this function to the before-save-hook. 

 Your
function only converts the pdfs into images (and you have to do an
export to achieve that).

Well, the function org-include-img-from-pdf is the workhorse here, and it doesn't depend on when you want the PDF to PNG conversion to happen. The "when" depends on the hook you add the function to. 

  You would still would have to add a link to
the image file in order to see it as an inline image.
add a link in order to see it, correct?

I didn't follow that. The user is already adding that. Example:

# ()convertfrompdf:t
# User needs to have a ./foo.pdf. That will be converted to the below referenced foo.png.
[[./foo.png]]

When I get to a computer, I'll confirm if the #+CAPTION: and/or #+NAME: is needed for the inline images to show. Above works fine for exports, so I assumed that the inline images should show fine too. 



--

Kaushal Modi