From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: pdf images in html export Date: Wed, 12 Nov 2014 14:09:06 +0100 Message-ID: References: <84tx24x1r6.fsf@tm6592.fritz.box> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoXfk-0002b6-5k for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 08:09:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoXfe-0003Xz-DC for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 08:09:20 -0500 Received: from mail-wi0-f173.google.com ([209.85.212.173]:48042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoXfe-0003Xq-6K for emacs-orgmode@gnu.org; Wed, 12 Nov 2014 08:09:14 -0500 Received: by mail-wi0-f173.google.com with SMTP id n3so4824883wiv.6 for ; Wed, 12 Nov 2014 05:09:13 -0800 (PST) In-Reply-To: (Andreas Leha's message of "Wed, 12 Nov 2014 09:30:06 +0000") 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 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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? >>> >>> I guess it should be possible to run imagemagick on all pdf links during >>> export somehow. >>=20=20=20=20=20=20 >> You could introduce a relation of the pdf-filenames to the respective >> thumb-filenames e.g. by using the suffix '_thumb'. Before the export >> the conversion tool would create the thumbs. >> >> The org-file could reference the data as >> >> [[file:./myimage.pdf][file:myimage_thumb.png]] >> >> See the info page (info "(org)Images in HTML export")? >> >> Untested. I just accidentially browsed that info page yesterday. >> >> > > Thanks for your thoughts. I would like to automate all of that. So, I > guess the first question is where to put code that would trigger the > conversion and how to best detect links to pdfs. Well - this is coming again and again - but no solution out of the box. There are effectively two approaches: 1) Macro to change properties according to backend used.=20=20 One usage is changing the file name extension according to the backend. This is implemented as a simplified macro below. This could be done by using ~(by-backend (html "graph.png") (latex "graph.pdf") (t "gr= aph.pdf"))~ =20 See [[http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html= #sec-4-3][work section ob-doc-LaTeX]] for details. #+begin_src emacs-lisp (setq org-babel-latex-htlatex "htlatex") (defmacro rmk-by-backend (&rest body) `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@b= ody)) #+end_src 2) To use svg image format, which is supported by both (although has it's drawbacks: slow rendering of the html, need to run external program= s upon compilation) So the first might be the modst feasible option. Rainer > > Thanks, > Andreas > > > =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUY1v2AAoJENvXNx4PUvmCF2AH/RhPRKkIKQJ7YgB3CIRgY+m0 6KwR908ZgskmhacClkp1Dt1cGNpxup6EzrKcGjc05ULUogwLZV136wXzlE7DCzhD Qp32LRDn6OqxIru1cJTj2MGPyoPTilJw5lGESIXsIJjpcN3FvrqhrLqXdsH/56B+ UaaAhx8e/w/SvyLfokrOMoHXVQdGUvpWkKxVfMng6RlxNmejCaFnx6FJKwgJ8EI2 Q7DyJMJH1oZEX+3/tIAZwT8aSFKOTe9L+7JdoqdC/pIHrc2Ze3MnNVId6EU0bK3j AyiB7s3hYOoRZRjS2GQ+lr5ZL2TUKE1+LB20St7J6xe/CTtJdPFX55yMb6v8fG0= =VwQo -----END PGP SIGNATURE----- --=-=-=--