837183 writes

I’m sure I’m stupid to even ask that, and it’s not a bug, but a question:

I use Evince for PDFs, and Evince manages the window size for you, it’s never maximized for a newly opened document and they give you no option to set a default for a window size.

Now, from Windows 7 Enterprise cmd, this opens an Evince instance that is maximized:

start /max evince

But when put in mimeview, in example:

#!python

[view]

application/pdf = start /max evince %f

Recoll says "start is not found", why might that be?..

medoc writes

Hi !

This is far from a future question ! What happens here is that start is a windows command shell command, so the proper way to do this would probably be to execute something like: "c:/Windows/System32/cmd /c start …"

Now, the thing is, I never got this to to work (I guess that I’m missing something elementary that someone with real Windows knowledge would see).

Recoll on Windows actually uses a small auxiliary executable to start default viewers (it’s named rclstartw and the source is in the windows/ directory of the recoll tree if you are curious).

I just changed this small program to accept an option (-m 1) to start the viewer maximized. This will be in the next release, meanwhile, I’ve put a copy under http://www.lesbonscomptes.com/recoll/files/rclstartw.zip

If you want to use this, you should copy it at the same place where recoll.exe is (usually C:\Program Files (x86)\Recoll), replacing the original version.

Then you should be able to start the pdf viewer maximized by adding application/pdf to the "Exceptions to desktop preferences" list, and using rclstartw -m 1 %f for application/pdf

Now, this does not help if you want to use a non-default application, or if you want to pass special options (such as the page number or a request for maximisation) to the application, as rclstartw only accepts the document file name as argument.

Happily enough, in the case of evince, it has a -f option to start fullscreen, so that I have found that using something like the following works for me:

c:/path/to/evince -f -i %p %f

It seems that forward slashes are needed, and I could not find a way to pass the search string option, it does not appear to exist for the Windows version.

I hope that this answers your need. If it does not, please tell what’s wrong, I’m really interested in getting this kind of thing right, and I’m not a Windows user myself, so I don’t see the issues.

837183 writes

Hi Medoc :)

Yeah, I later read the mimeview examples where you noted cmd not working.

Also, these are the results of my research : there are very few PDF readers that can take the page and search term as values, Acrobat Reader can but it’s quite bad at it, it will open the PDF at the page, and will start an Advanced Search for the term, you won’t have the term highlighted on the page, and the search does not start from the current page downwards but from the first page, it’s not so good.

Evince is the only program that I know that works REALLY well with Recoll (by well I mean = utilize all of Recoll’s abilities, passing parameters), only thing is that every available Evince Windows version contains this bug (Confirmed bug) that new documents are opened in a un-maximized window.

Now, there’s the full screen option, but fullscreen is not the same as maximized.

I’d just like to say that I use Recoll on both Linux (home PC) and Windows (work PC) and it has been a gift to have such a tool for free, It lets me achieve so much more than I would’ve without it.

As a software tester, I need access to all the specification documents ever written about the product, all the official documentation, etc'

These are masses of data, and with Recoll I can breeze through them and find what I need in under 5 minutes.

With that said, the added option to rclstartw seems cool :) but %s and %p are really really useful, if I have to choose between:

  1. Un-maximized instances of Evince, at the hit’s page and with the search term highlighted.

  2. Maximized instances of Evince, without passing the search term and page number.

The I’ll choose option 1, without a doubt :)

edit:

OK, a small addition:

"It seems that forward slashes are needed, and I could not find a way to pass the search string option, it does not appear to exist for the Windows version."

If you put Evince’s bin directory in the PATH Windows system variable then you don’t need to give the full path, so the slashes are not needed.

Here’s my mimeview that passes Evince the page and the search string:

#!python
application/pdf = evince --page-index=%p -l %s %f

Here’s one for Adobe Acrobat Reader:

#!python

application/pdf = AcroRd32 /A "search=%s&page=%p" %f

medoc writes

About fullscreen and maximised: yes, I see the technical difference, but, in practise, what is the problem with using fullscreen instead of maximised ? This is not to get out of trying to find a way to make maximized work, as many apps probably have no command line fullscreen switch, so this is not a general solution anyway, but I’m curious.

As we’re using start or its equivalent in rclstartw with a document parameter, to let Windows choose the default application, there is no possibility of passing application switches, as we don’t know what app we’re dealing with (so no page numbers or search strings possible this way).

So the only possible approach would be to start the application explicitely and add the maximized switch as a directive to recoll itself. There is already a provision in mimeview for passing such switches, so the only problem would be to deal with the intricacies of Windows CreateProcess(). I’ll give it a try.

About the search string option etc.: I found that I was using the wrong option to evince, it’s now working for me. I’d prefer to avoid as much as possible telling the user to modify with their PATH, so I’ll see if I can handle the backslashes. And thanks for the acrobat command line !

medoc writes

I have added an attribute to the viewer definitions line. If you set the definition as:

application/pdf = evince --... ; maximize=1

Recoll will make an effort to start the app maximized. In my tests, this seems to work most of the time.

I’ve uploaded an updated setup file if you want to give it a try: http://www.lesbonscomptes.com/recoll/windows/recoll-setup-1.23.0-ed3efc-20161205.exe

Please tell me how this works for you !

837183 writes

If the search string is more than one term, Recoll passes to the PDF-reader just one..

When evince is opened in fullscreen mode, you don’t see the search box, hitting Ctrl+G will highlight the search term in the page.

[See screen-shot here](https://i.imgbox.com/E7EYYZE9.png)

The 20161205 version does not maximize Evince windows.

Actually, in the 20161205 version, evince’s --fullscreen switch does not work.

But the same switch works in another version. Is that possible? one machine is Windows 7, the other is Windows Server 2008…

medoc writes

I just noticed that the positioning of search terms only works when opening from the snippets window ? The code did not work for the main Open link. If you see otherwise, I’d be interested to know. A line of code somehow got lost going from 1.21 to 1.22 (and .23 followed). I’ll fix it. This is true for both the Windows and Linux versions.

Then how would I pass multiple terms to --find ? This would only make sense for a simple phrase search ? What recoll does is try to choose the most significant term in the query and set this for evince.

You are right that maximize does not seem to work. Maybe I did something wrong while building the release (I’m quite sure that I did test the change). Unfortunately, I can’t produce another build till next week (maybe, might be january too, depending on circumstances). I’ll look into this as soon as I can.

medoc writes

I uploaded a new version (2012-12-16, this is now the one pointed from the web page) http://www.lesbonscomptes.com/recoll/pages/recoll-windows.html

I checked that adding a maximize=1 option to the command line did open a maximized evince on windows 7.

Here follows the mimeview entry I use:

C:/Users/Bill/AppData/Local/Apps/Evince-2.32.0.145/bin/evince --page-index=%p --find=%s %f ; maximize=1

I don’t think that I can do anything more about this issue at this point.

837183 writes

Hey

"The code did not work for the main Open link"

Huh..I always assumed that was on purpose.

" If you see otherwise, I’d be interested to know."

No, since I started using Recoll, from any OS, opening the PDF not from a snippet - does not pass the search term to the viewer.

"Then how would I pass multiple terms to --find ?"

Not sure?..like..technically?

I’ve tested 2012-12-16 in Windows Server 2008 R2 Enterprise and it works perfectly.!

Now I’ll install it on my work PC (Windows 7 Enterprise) so anything funny looking I’ll report

But it seems to work great! amazing, thanks :) improves the usability of PDFs so much..