You are here    Forums    Manual installations    Pass arguments to PDF-XChange Viewer fr

The forum

Pass arguments to PDF-XChange Viewer

Author Replies
DeHollaender Saturday 18 October 2014 at 23:24
DeHollaender Anonymous

Hello,

Since I installed PDFXChange viewer according to this site with playonlinux, it runs perfectly on my system.

A registration system for writing articles (docear.org) needs to parse arguments to PDFXChange viewer for letting pdf's open on a specific page. I have to specify the command how to do that. According to the documentation of PdfXChange Viewer I have to do this with something like /A "page=20":

playonlinux --run "PDFXCview" test.pdf /A '"page=20"'

This results in opening the file but not on page 20. playonlinux does not seem to redirect the page-argument correctly to the application. Can somebody help me with parsing multiple arguments to PDFXChange viewer using playonlinux?

 

I'm using Ubuntu 14.04 (Gnome)

 

Greetings,
DeHollaender

Edited by DeHollaender

petch Sunday 19 October 2014 at 0:28
petch
Developer

If I read the code correctly, playonlinux script calls bash/document_reader script, that interprets its first argument as shortcut name, second one as unix path (that it converts to "Windows path"), and it discards extra arguments.

Maybe bash/document_reader can be fixed like

#!/usr/bin/env bash

# Copyright (C) 2007-2010 PlayOnLinux Team
# Copyright (C) 2007 Pâris Quentin

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

WorkingDirectory="$PWD"
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

app="$1"
doc="$2"
shift 2

if [ ! -e "$POL_USER_ROOT/shortcuts/$app" ]; then
    POL_SimpleMessage "$app is not installed."
    echo "$app is not installed."
    exit
fi

if [ "$doc" ]; then
    POL_Debug_Message "App to run: $app"
    POL_Debug_Message "File to run: $doc"

    if [ "${doc::1}" != "/" ]; then
        doc="$WorkingDirectory/$doc"
    fi
    pref="$(POL_Shortcut_GetPrefix "$app")"
    POL_Wine_SelectPrefix "$pref"    
    realpath="$(POL_Wine winepath -w "$doc")"
fi
exec bash "$POL_USER_ROOT/shortcuts/$app" "$realpath" "$@"


I wonder if the problem (lifting the ambiguities around filename parameters) could be solved in a more elegant way...

DeHollaender Wednesday 12 November 2014 at 4:54
DeHollaender Anonymous

Thanks for the response! I do not know what you mean with "document_reader"-script. Where can I find it? This issue has definitely to do with passing multiple arguments to the windows application via playonlinux.

 

The following threads have contributed (unsatisfactory) to this problem:

http://www.playonmac.com/en/topic-989.html

http://www.playonmac.com/en/topic-995.html

http://www.playonmac.com/en/topic-2941.html

 

I tried the command in windows installed on a VM and the exactly command should look like this:

PDFXCview.exe /A "page=3" pdffile.pdf

 

Greetings!

Edited by DeHollaender

Ronin DUSETTE Wednesday 12 November 2014 at 5:49
Ronin DUSETTE
Admin

GitHub, sir. ;)

 

https://github.com/PlayOnLinux/POL-POM-4/blob/master/bash/document_reader


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
qwerty_user1983 Monday 29 May 2017 at 6:36
qwerty_user1983 Anonymous

Sorry for answering 3 yo problems. :)

A friends solve this problem here. 

http://lapraszerelt.blogspot.co.id/2016/01/started-exploring-docear-httpwww.html

playonlinux*--run*PDFXCview*/A*page=$PAGE*`winepath -w "$FILE"`

it should be modified according to your current installer calling style though.

In my case, the shortcut is

/usr/share/playonlinux/playonlinux --run "PDF-Xchange Viewer" %F

So my setting became

/usr/share/playonlinux/playonlinux*--run*PDF-Xchange Viewer*/A*page=$PAGE*`winepath -w "$FILE"`

I hope this helps. :)