From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8CFCLojFx1/9JQAA0tVLHw (envelope-from ) for ; Wed, 02 Dec 2020 16:49:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CFwmKojFx1+nUwAA1q6Kng (envelope-from ) for ; Wed, 02 Dec 2020 16:49:12 +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 22A679402A8 for ; Wed, 2 Dec 2020 16:49:12 +0000 (UTC) Received: from localhost ([::1]:42484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkVJV-0004DC-Qa for larch@yhetil.org; Wed, 02 Dec 2020 11:49:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkVBt-0000Rs-8T for emacs-orgmode@gnu.org; Wed, 02 Dec 2020 11:41:17 -0500 Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:52934 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkVBr-0008Dm-Hi for emacs-orgmode@gnu.org; Wed, 02 Dec 2020 11:41:17 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kkVBn-0001q8-DQ for emacs-orgmode@gnu.org; Wed, 02 Dec 2020 17:41:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: Re: Bring up a screen giving option to open a series of orgmode files Date: Wed, 2 Dec 2020 23:41:03 +0700 Message-ID: References: <87eekkcwzs.fsf@localhost> <874klfcj5k.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 43 X-Spam_score: 4.3 X-Spam_bar: ++++ X-Spam_report: (4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, PDS_OTHER_BAD_TLD=1.501, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.68 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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-Migadu-Queue-Id: 22A679402A8 X-Spam-Score: -1.68 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: ruHUY+6rpAIB 2020-12-01 Jean Louis wrote: > * Maxim Nikulin [2020-11-30 20:10]: > To note is that not every PDF has text inside. They may be made from > images. Images do not necessary mean absence of text. Tesseract can generate PDF files with text layer in addition to original scans. > and prepares `capturexpdf.sh' to be executable and contains following: > > ,---- > | #!/bin/bash > | capture="/home/data1/protected/xpdfcaptured.org" > | entry=`zenity --entry` > | hyperlink="[[$1:$2][$entry]]" > | echo $hyperlink >> $capture > `---- Personally I am considering something like (not ready to use, just quick and dirty proof of concept) ------->8----------- #!/bin/bash set -e set -o pipefail getmeta() { file="$1" page="$2" sel_x="${3:-0}" sel_x="${sel_x%.*}" sel_y="${4:-0}" sel_y="${sel_y%.*}" sel_X="${5:-0}" sel_X="${sel_X%.*}" sel_Y="${6:-0}" sel_Y="${sel_Y%.*}" url="${7:-}" # FIXME obtain page height using pdfinfo page_height=792 echo "[[${file}#page=${page}]]" pdfinfo "$file" | sed -n -e 's/^\(CreationDate\|ModDate\|Author\|Title\|Subject\):\s*\([^ ]\)/- \1 :: \2/p' if [ -n "$sel_Y" ] ; then echo "#+begin_quote" pdftotext -layout -f "$page" -l "$page" \ -x "$sel_x" -y "$((page_height - sel_Y))" -W "$((sel_X-sel_x))" -H "$((sel_y-sel_Y))" "$file" - \ | sed -e 's/^[#*]/,&/' -e 's/\s*$//' echo "#+end_quote" fi if [ -n "$url" ] ; then echo -e "\n- Link: [[$url]]" fi } if [ -z "$1" ] || [ -z "$2" ] ; then echo "No file or page" 1>&2 exit 1 fi # or emacsclient calling org-capture getmeta "$@" | xsel -b --------->8--------- Unfortunately Xpdf quite slow works with large raster images. Evince better handles PDF files with wide spread problems (e.g. relying on fonts that are not embedded into the document) or with text in non UTF-8 encodings. >> Surprisingly PDF viewers built in into browser have fences >> preventing access of browser extensions to the text content. I did >> not expect such limitations. > > It does not sound as progress. Evince maybe originates from xpdf but > does not have nearly these options as xpdf. We go back and become more > beautiful with software but less useful. Maybe it is possible to add necessary features to pdf.js and to serve the viewer from purely static site (no authorization and no API endpoints). >> And finally, running browser under a different user is likely not enough. >> Browser for working with "external" resources should be isolated from home >> or office network (network namespace, container, virtual machine). There are >> enough web sites that checks which ports are open at least on the localhost. >> Local network could be scanned through browser as well. > > I agree, only that it is not practical for majority of us. In my > opinion browsing machines should be separate with few sensitive > files if any. https://stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/ https://gudok.xyz/lxcdeb/ > When I get > mobile device in my hand it allows me to share pictures to email, > chat, web server, to other file managers, and so on. Desktop operating > systems are not so well integrated as mobile systems. Desktop has a convenient keyboard and a mouse to allow *authoring*, mobile devices are more limited in that sense, they are more suitable for *sharing* content generated by others or "liking" it. On desktop one could add a couple of valuable phrases in several seconds: why the item to share is important for particular person at particular moment, copy-paste is just a few more keystrokes.