From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: pdf images in html export Date: Wed, 12 Nov 2014 20:50:13 +0000 Message-ID: References: <84tx24x1r6.fsf@tm6592.fritz.box> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xoers-0005OL-Tk for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 15:50:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xoern-0000Cx-Hu for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 15:50:20 -0500 Received: from plane.gmane.org ([80.91.229.3]:57563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xoern-0000Cd-Bq for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 15:50:15 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xoerm-0006h8-A3 for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 21:50:14 +0100 Received: from cpc33-cmbg15-2-0-cust4.5-4.cable.virginm.net ([81.102.136.5]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Nov 2014 21:50:14 +0100 Received: from andreas.leha by cpc33-cmbg15-2-0-cust4.5-4.cable.virginm.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Nov 2014 21:50:14 +0100 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: emacs-orgmode@gnu.org Hi Chuck, "Charles C. Berry" writes: > 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, 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