emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] pdf images in html export


From: Andreas Leha
Subject: Re: [O] pdf images in html export
Date: Wed, 12 Nov 2014 20:50:13 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (darwin)

Hi Chuck,

"Charles C. Berry" <address@hidden> writes:
> On Wed, 12 Nov 2014, Andreas Leha wrote:
>
>> Hi Rainer,
>>
>> Rainer M Krug <address@hidden> writes:
>>> Andreas Leha <address@hidden> writes:
>>>
>>>> Hi Marco,
>>>>
>>>> Marco Wahl <address@hidden> writes:
>>>>> Andreas Leha <address@hidden> writes:
>>>>>
>>>>>> how would I export an org file containing
>>>>>>
>>>>>>   [[file:./myimage.pdf]]
>>>>>>
>>>>>> to html so that a say png version myimage.pdf is inlined in the html
>>>>>> which links to the pdf?
>>>>>>
>
> [deleted]
>
> Andreas replying:
>
>>
>> Thanks for this.  I am aware of how to *produce* graphics in different
>> formats for different export backends.  I use your first approach,
>> which I think is the better solution.
>>
>> Here, I am after a solution, that works on images that are not produced
>> but merely included via [[file:./some.pdf]].
>>
>> I think there should be the possibility to include these into html (and
>> odt) export without any user interaction.  So, I
>> - do not want to write a source block just to produce the by-backend image
>> - do not want to change the link manually
>> - do not want to run the converter manually
>>
>> I am pretty sure this should be achievable with standard orgmode tools
>> (like filters, export hooks, or anything).
>>
>> Since 'this is coming again and again' it seems a non-esoteric task.
>> And as there is 'no solution out of the box', I assume(d) that somebody has
>> written these filters already.
>>
>
> What you want is a custom `hyperlink type'.
>
> I don't know if anyone has written this, but the machinery is in
> `org-add-link-type'. You user would enter (say)
>
>       [[pdf:./some.pdf]]
>
> and clicking on it would open the file (assuming a proper FOLLOW
> argument) and exporting would handle all the behind the scenes
> tinkering to create png's or whatever is needed for the backend in
> question (assuming a suitable EXPORT argument).
>
> The docstring for `org-add-link-type' has details. Also there is a
> worked example and more instructions at
>
>       (info "(org) Adding hyperlink types")
>
> HTH,

It does.  Thanks for this hint.  This comes close to what I am after.


But -- at the risk of being persistent -- this still requires me to
change the orgmode document, if only to change [[file:...]] to
[[pdf:...]].

I still think that this use case is so common, that it would be nice
for org support of the original document.

Maybe that even deserves first class support in org.  One could imagine
some customizeable variable org-transcode-images-on-export, that would
know a list of supported image formats for each export backend and try
to run imagemagick on the others to transcode them into exportable
images linking to the original.

Given that this does not exist (and given that it won't be me
implementing that) I was hoping for a custom (hacky?) solution just for
pdfs.

Given that this appears not to exist either, I will probably follow your
suggestion of adding a custom link type.

Thanks,
Andreas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]