From owner-freebsd-questions@freebsd.org Wed Apr 22 23:16:23 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DEBFB2C5D61 for ; Wed, 22 Apr 2020 23:16:23 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 496xBt3kbDz46cK for ; Wed, 22 Apr 2020 23:16:22 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([188.102.109.75]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPA (Nemesis) id 1M7JvQ-1jZ5hD0px6-007iTw; Thu, 23 Apr 2020 01:16:15 +0200 Date: Thu, 23 Apr 2020 01:16:14 +0200 From: Polytropon To: Jordan Cc: freebsd-questions@freebsd.org, Polytropon Subject: Re: PDF Documents Manipulation Software options Message-Id: <20200423011614.b3bff716.freebsd@edvax.de> In-Reply-To: References: <09e273ff-4d9d-47eb-a6e1-d91f18c8a0ef@www.fastmail.com> <20200423002530.87cf0d91.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:iyZk67MuzpalFJYNu2O6AHA6UtNiUP1dwQCdj+5lUeHJ/E8kQgj vpxZtKy2xKepX1Ha7XVX5P6tEADM9qUPS9tw8vQcLjlbofv3NGdvvLQkSA8zwaj1L6ZgPG9 hPzXuUo72liuxTnoP+y3ZKdTe1Qv9xe3uM83wZI0t6zMXikqttuwpK0zV0fv/rDY1Kp2Nnb 2iodJ/uIJUuGtqudPQuBg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Ig6oYSvQUME=:ahMnPbTz9SUia7ZIsMdo6W HtFEcjpJjAmQn19YRIJCDp6008Iv/hYs8hrkJVvdmdpm2GDG0W/mI+tM9/3jywF5zigngCThH 9GWwcvk4hT1R5pqYyLmpULM3qdp4Uik32msEergj/9gkKnkoLA2F3B6spQwsZhBE4QGuGMMXh rxYCfYnub56Da1BvdfGnzjLKETtEVglvIKN24ZBvzAPpfdEV4dVmPJO/qtt3UhUhawU0fupUC vjqRdqZmeV5wonwblqNL/vLeIYnhPrJhubJzApam5TLoUj8djrpAG4cKP6VhicfBV2fbHo72t uALdXNj2NojBW8sMlXDzYPyk61HpKpGQbxL1cBFBx5asKnt2Lbx3ww6VLJ+uctYN2gvwLxdtz gQD2YlYUtdroSygiRKhCUvHojPCEg9/xDkfmDaY/KPuxzDOKE4pv3YrUV3DU3rJlFMI9niI8B ULrPw5jpNsGFWjk1mDlZUsMwTRyaNejCeUr+DJUnDH2Prbi2xKlOHn0Agp+cI0rO+27nhR3Ig nqlYRVfom/hVHAJKpyg9XnuOmWt5xIjVJPmQdX4+xK43jgAV4iNEHCmM3vQZU4iQbsCORq47x fSBum0dCkcRs4TMDURchxUNzsXiU4EXfwpKk2Sqwc/665RyIy+T+PIePO7zdfow+ajMe1g6P/ p3gnhnrfUHxqwiTldQ42X2pUcGlHutTCyMb0FwlMLHmtjfk8240tjCVkKJoRxlY8n1t1M747d YhTeTvGzuAPTUvF1DoOHdrzT6pid+W9UfFQel4zu/2trizuY6PPlb85u/hHejWNKY7IjJxYKO yESuUSRLTRqU/ld92Qb5ujkncLGQEtmFA7KFbXJqnDxK0i+DmRaDEtM3S6WxXJnPfjQIwx9 X-Rspamd-Queue-Id: 496xBt3kbDz46cK X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.187) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [4.42 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[75.109.102.188.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.75)[0.753,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[0.996,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[187.126.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[187.126.227.212.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.28)[ip: (0.53), ipnet: 212.227.0.0/16(-1.21), asn: 8560(2.07), country: DE(-0.02)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2020 23:16:23 -0000 On Wed, 22 Apr 2020 15:50:03 -0700, Jordan wrote: > I agree, manually manipulating PDFs with a GUI is not very efficient, > however, the work I do cannot be automated (atleast I haven't found > a way). Okay, so you have a scope of what you're trying to do. > On a PDF I may have to extract out pages 3, 5 and 14 into a new 3 > page PDF because I only need the data from pages 3, 5 and 14. The > very next PDF file I work on I may need to extract out 20 pages, all > in a row, from pages 20 to 40. The next PDF file I may need the > first and last page. There is absolutely no common denominator from > these three PDF's and the only thing common is that I need to extract > pages. While you will surely agree that pdftk can do this, I assume that you also have to look at the pages you're going to process. That's where probably Gimp's or LibreOffice's PDF support is the better tool. This matches a lot with your further description: You need interactive visual inspection, and basically "one of a kind"-work has to be done. > It is easier to visually click, hold CTRL to continue highlighting > pages and then right click, extract (which creates a new PDF) and > then drag and drop the new PDF pages into a GUI file manager (such > as Thunar) to create the new PDF. Many years ago, I had to do something similar with PDF files only containing images of circuit boards. I decided to use pdfimages (from the xpdf package) first, then previewing them in a GUI file manager with preview support; I deleted the non-needed images, renumbered what required renumbering, and then run my png2pdf.sh script (that uses ImageMagicK's convert program in combination with pdftk) on the "result directory", which generated a new PDF file containing only the diagrams needed. Of course, this does not work for PDF files containing text, but for this specific task, there is no text, only Zuul. ;-) > I don't see how CLI tools will work with the above example > workflows although I am all ears to hearing others opinions. A CLI tool in combination with a "selector" (GUI file manager) would probably be possible, but limited (as I mentioned). You could of course do something like this: 1. use pdftk to split PDF input file with n pages into n PDF files, one for each page 2. use GUI file manager for preview, maybe deleting and maybe re-ordering files 3. use pdftk on n-k files to generate new PDF output file with n-k pages The actions for steps 1 and 3 can be launched from the file manager's context menu for the specific directory, so you don't even have to use a terminal here. However, this all doesn't look very convenient even when presented in pseudo code. :-) > I know "professional" PDF software such as Adobe Acrobat Pro works > but it is only compatible with Windows (and maybe GNU/Linux). I don't know if it is possible to use it with wine, it _might_ be possible; however, licensing issues and costs are significant here (check Adobe's "always online" licensing stuff if you want to get scared). Maybe you can try Gimpshop (a "Photoshop"-like variant of Gimp, which has PDF support that might be exactly what you need). Furthermore, the office applications (LibreOffice and OpenOffice, I never know which one I should name) will probably also be able to do this. > I found another proprietary PDF Professional software but it is > only available for Windows, Mac and GNU/Linux. I am on a quest > to find something for FreeBSD as I believe it to be superior OS > than the aforementioned. Using a "Windows" or a Linux program is often possible, but of course the vendors won't tell you about this, because they do not support FreeBSD as a platform, do no testing on that platform, don't care about that platform, and probably don't even know about that platform. And spending $$$$$ just to find out it doesn't work surely isn't acceptable. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...