Jump to content

Search bookmarks in multiple PDF documents and quickly open the corresponding page.


Recommended Posts

Posted (edited)

Search PDF Bookmarks.alfredworkflow

 

Usage

 

Search bookmarks in multiple PDF files.

 

 

def.gif.732186db62488807615e09a59ffad61a.gif

 

Search bookmarks in in a specific PDF file.

 

indexin.gif.7ee03e9e6250c51b14b68d5ed33be7eb.gif

 

Download

 

https://github.com/HF706/My_Alfred_workflow


Install

 

Select a folder to store the index files.

 

1.thumb.png.13f22c88f248af10079c0968e93ebf49.png

 

This workflow requires dependencies as follows: 

  • PDF Reader - Skim, Skim supports URL schemes, which helps us to open a PDF at a specific page;
  • command-line tool PDFtk, you can install PDFtk via homebrew.
     
brew install pdftk-java

 

Indexing

 

Index PDF file via the Universal Action.

 

 

2.thumb.png.281ce54ee056e8a4f4093170c051eedb.png

 

You can also select multiple files and add them to a buffer, and then index all of these at once.

 

3.thumb.png.90284cb17c4a58b8477ce71f8ffe2d53.png

 

Search

 

Use the keyword followed by search terms. Press ↩ to open the page.

 

4.thumb.png.9ba5e6c2d2b5bd5835adfa64f4f4d543.png

 

List all indexed PDF files.

 

5.thumb.png.03c73224854b3c156a34079097870afb.png

 

You can also search bookmark in in a specific PDF file.

 

6.thumb.png.c9e6dea4de028cd301f8abe0af4b4aa9.png

 

 

7.thumb.png.6459e668be93ce13f74e10a98cc12bdc.png

Edited by toru777
Link to comment
4 hours ago, TomBenz said:

Sounds interesting. Request for English language version of this and bit more explanation on how it works. 

By using this workflow, users can easily search for information in multiple PDF documents and navigate to the corresponding page in a book. Index the PDF file using the Universal Action, which will convert the PDF bookmarks into a CSV file saved as indexes. These indexes include the following information: the path of the PDF file, the logical page number, and the physical page number. By using URL schemes, users can quickly open the page corresponding to the content of a PDF document. Skim is a free PDF reader that supports URL schemes(skim://{var:PDF_Path}#page={var:PDF_Page_Number}). Of course, you can also modify the URL schemes if you don't use Skim.

Link to comment

Deep Links Using Skim URLs

Skim allows creating special URLs to get deep links to a PDF, for instance to open a PDF at a specific page. These URLs have the scheme skim. They are based on the form of a file:// URL for the PDF file, but allow extra fragments preceded by a # to add options for opening the PDF. The typical fragment has the form page=N, where N is the one-based page number to open the file at. The URL then looks like this:

skim:///path/to/file.pdf#page=1

Apart from the page, you can also add other options. Different options are be combined using the &character. For finer navigation you can add a point=x,y option, where the coordinates are in page space, . For instance a search term, which uses the key search. Note that the value may need to have special characters like spaces percent encoded. Furthermore, you can add view options to open the PDF with. The currently supported keys are autoScales, scaleFactor (scale, zoom), displayMode (mode), displayBox (box), displayDirection (direction, horizontal), displaysAsBook (book), displaysPageBreaks (pagebreaks), displaysRTL (rtl), as well as some equivalent shorthands (the terms can be all lowercase). Most options have values 0 or 1, though displayMode allows 0, 1, 2, or 3, and scaleFactor can a floating number (not a percentage). 

Apart from this you can also link to bookmarks. In this case you use a path to the bookmark through the enclosing folder(s). The URL then looks like

skim://bookmarks/enclosing%20folder/bookmark%20name

You can easily get such URLs using the Edit > Copy URL menu item.  --- Understood, could make some python code work to open specific page. Request you to publish English version of workflow 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...