webOS Nation Forums >  webOS Discussion >  Open webOS General Discussion > Print on any webos phone using dropbox
Print on any webos phone using dropbox
  Reply
 
Thread Tools Display Modes
Old 02/18/2012, 04:29 AM   #1 (permalink)
Member
 
Posts: 154
yeah thats right !!! we can print our documents on any of our webOS phone (or for that matter any smartphone )using dropbox , using one simple VB script. pl visit below link.

How to Print Files from any Mobile Phone using Dropbox


i wish ,i could copy files from one folder to another directly in my dropbox app ,any suggestion friends??
tovivekmishra is offline   Reply With Quote
Old 09/06/2012, 05:39 AM   #2 (permalink)
Member
 
Posts: 199
I tried the linux script and I get a Syntax error!? Can anyone tell me what the error is?

Error:
Quote:
/usr/sbin/dropprint.sh: Zeile 5: Syntaxfehler beim unerwarteten Wort `lpr'
/usr/sbin/dropprint.sh: Zeile 5: ` lpr -o fit-to-page -o fitplot ${PrintQueue}/${PrintFile};'

Using OpenSuSE 12.1.

Script:
Quote:
#!/bin/bash
export PrintQueue="/home/marcel/Dropbox/PrintQueue2";
IFS=$'\n'
for PrintFile in $(/bin/ls -1 ${PrintQueue}) do
lpr -o fit-to-page -o fitplot ${PrintQueue}/${PrintFile};
done
Starting the lpr line manually works great!
mgmft is offline   Reply With Quote
Old 09/06/2012, 11:32 AM   #3 (permalink)
Member
 
Posts: 78
I think the problem is the for/do statements. put do on the next line by itself or put a semicolon in front of it.

for PrintFile in $(/bin/ls -1 ${PrintQueue})
do
...
done
crabbz is offline   Reply With Quote
Old 09/06/2012, 12:21 PM   #4 (permalink)
Member
 
lagoldste's Avatar
 
Posts: 111
What crabbz said. The problem is that the way it's written originally, the word "do" becomes part of the list of files to print, which breaks the syntax of the loop. There's also some bits that can be removed from the script because ls(1) will just Do The Right Thing:

#!/bin/bash
export PrintQueue="/home/marcel/Dropbox/PrintQueue2";
for PrintFile in `/bin/ls ${PrintQueue}`
do
lpr -o fit-to-page -o fitplot ${PrintQueue}/${PrintFile};
done
lagoldste is offline   Reply With Quote
Old 09/25/2012, 01:34 AM   #5 (permalink)
Member
 
Posts: 199
Thanks guys! That worked!!!
mgmft is offline   Reply With Quote
Old 09/25/2012, 04:48 AM   #6 (permalink)
Member
 
Posts: 199
Hi,

I just modified the script to have the choice of printing in different paper sizes. A4 or A3

Quote:
#!/bin/bash
export PrintQueue="/home/marcel/Dropbox/PrintQueue2/A4";
IFS=$'\n'
for PrintFile in $(/bin/ls -1 ${PrintQueue})
do
lpr -r -o fit-to-page -o fitplot -o media=A4 ${PrintQueue}/${PrintFile};
done

export PrintQueue="/home/marcel/Dropbox/PrintQueue2/A3";
IFS=$'\n'
for PrintFile in $(/bin/ls -1 ${PrintQueue})
do
lpr -r -o fit-to-page -o fitplot -o media=A3 ${PrintQueue}/${PrintFile};
done
mgmft is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0