emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: pdf images in html export
Date: Wed, 12 Nov 2014 20:50:13 +0000	[thread overview]
Message-ID: <olur3x8cfei.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: alpine.OSX.2.00.1411121042550.458@charlessmacbook

Hi Chuck,

"Charles C. Berry" <ccberry@ucsd.edu> writes:
> On Wed, 12 Nov 2014, Andreas Leha wrote:
>
>> Hi Rainer,
>>
>> Rainer M Krug <Rainer@krugs.de> writes:
>>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>>
>>>> Hi Marco,
>>>>
>>>> Marco Wahl <marcowahlsoft@gmail.com> writes:
>>>>> Andreas Leha <andreas.leha@med.uni-goettingen.de> 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	other threads:[~2014-11-12 20:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  0:48 pdf images in html export Andreas Leha
2014-11-12  8:27 ` Marco Wahl
2014-11-12  9:30   ` Andreas Leha
2014-11-12 13:09     ` Rainer M Krug
2014-11-12 13:36       ` Andreas Leha
2014-11-12 14:13         ` Rainer M Krug
2014-11-13 12:21           ` Instructor account
2014-11-13 19:10             ` Andreas Leha
2014-11-12 19:03         ` Charles C. Berry
2014-11-12 20:50           ` Andreas Leha [this message]
2014-11-12 21:04         ` John Hendy
2014-11-12 21:32           ` Andreas Leha
2014-11-12 22:59             ` John Hendy
2014-11-13  9:11             ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=olur3x8cfei.fsf@med.uni-goettingen.de \
    --to=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).