From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: pdf images in html export Date: Wed, 12 Nov 2014 11:03:50 -0800 Message-ID: References: <84tx24x1r6.fsf@tm6592.fritz.box> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XodJB-0005P6-DD for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 14:10:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XodJ5-0002jy-K2 for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 14:10:25 -0500 Received: from iport-acv2-out.ucsd.edu ([132.239.0.174]:13548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XodJ5-0002jX-Bx for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 14:10:19 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Leha Cc: emacs-orgmode@gnu.org On Wed, 12 Nov 2014, Andreas Leha wrote: > Hi Rainer, > > Rainer M Krug writes: >> Andreas Leha writes: >> >>> Hi Marco, >>> >>> Marco Wahl writes: >>>> Andreas Leha 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, Chuck