From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QMvhMN9Xsl//bwAA0tVLHw (envelope-from ) for ; Mon, 16 Nov 2020 10:43:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kPDALN9Xsl9EZwAAbx9fmQ (envelope-from ) for ; Mon, 16 Nov 2020 10:43:43 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 774229401CD for ; Mon, 16 Nov 2020 10:43:43 +0000 (UTC) Received: from localhost ([::1]:40226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kebz4-0008Hh-BV for larch@yhetil.org; Mon, 16 Nov 2020 05:43:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdubl-0005en-CN for emacs-orgmode@gnu.org; Sat, 14 Nov 2020 07:24:45 -0500 Received: from stw1.rcdrun.com ([217.170.207.13]:48855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdubj-0005C2-3T for emacs-orgmode@gnu.org; Sat, 14 Nov 2020 07:24:44 -0500 Received: from localhost ([::ffff:41.202.241.56]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E05D.000000005FAFCC68.000008A7; Sat, 14 Nov 2020 05:24:07 -0700 Date: Sat, 14 Nov 2020 14:34:53 +0300 From: Jean Louis To: Georges Ko Subject: Re: Link to open PDF at a specific page Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Received-SPF: pass client-ip=217.170.207.13; envelope-from=support1@rcdrun.com; helo=stw1.rcdrun.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/14 07:24:09 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 16 Nov 2020 05:41:30 -0500 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.49 X-TUID: OkW8Akv4aNc5 * Georges Ko [2020-11-14 11:48]: > If I export the file as HTML, it is output as: > > ... > > 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: > > ... > > 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?