Org-mode mailing list
 help / color / mirror / Atom feed
From: Jean Louis <support1@rcdrun.com>
To: Georges Ko <gko@gko.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Link to open PDF at a specific page
Date: Sat, 14 Nov 2020 14:34:53 +0300
Message-ID: <X6/A3ZSHybsD+LT0@protected.rcdrun.com> (raw)
In-Reply-To: <yqc2amtzkuxzz.fsf@gko.net>

* Georges Ko <gko@gko.net> [2020-11-14 11:48]:
> If I export the file as HTML, it is output as:
> 
>   <a href="file:///c:/a/b/c/file.pdf#MissingReference">...</a>
> 
> so I modified org-html-link from:
> 
>   (concat raw-path
> 	  "#"
> 	  (org-publish-resolve-external-link option path t))
> 
> to
> 
>   (concat raw-path
> 	  "#"
> 	  (let ((r (org-publish-resolve-external-link option path t)))
> 	    (or (and (string= r "MissingReference")
> 		     (string-match "\\.pdf\\'" path)
> 		     (string-match "[0-9]+" option)
> 		     (format "page=%s" option))
> 		r)))
> 
> which generates the wanted HTML link:
> 
>   <a href="file:///c:/a/b/c/file.pdf#page=4">...</a>
> 
> Is there any way less quick & dirty to achieve this?

General function in plan Org program files shall not be modified in
the main development branch to serve a specific PDF reader on specific
OS system as that is hard coding and there are many PDF readers which
all behave in different manner.

Instead it is better if you make your custom link for Org that does
what you want.

It looks as being possible to be customized by using
org-link-abbrev-alist

Is it?



      reply	other threads:[~2020-11-16 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14  8:46 Georges Ko
2020-11-14 11:34 ` Jean Louis [this message]

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://orgmode.org

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

  git send-email \
    --in-reply-to=X6/A3ZSHybsD+LT0@protected.rcdrun.com \
    --to=support1@rcdrun.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gko@gko.net \
    /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

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git