Forum moved here!

# Home / How to open online pdf files

Greetings
I tried using windows cmd with command line arguments in documentation.

Have anyone tried to do it before

GitHubRulesOK

THUS no way to avoid upload or download the PDF HAS TO BE stored in the local device where you can modify, read or extract its contents without running embeded code for viewing.

You can call for a remote file within SumatraPDF and it will be invisibly downloaded to your browser cache where it will be stored while you view it but may after your done be deleted by the browsers system settings.

GitHubRulesOK

Hmm that is different to simply either opening or printing an existing file so the windows system does not allow for that “missing” local file in one cmd (a LAN file on local \\server\file.pdf should work). You should get something like

or similar

You need two separate actions first to download to %temp% so assuming you have Windows 10/11 (different for windows 7/8 as it does not have curl)

curl -o "%temp%\temp.pdf" "https://www.cyberciti.biz/files/sticker/sticker_book.pdf"


then

"C:\Program Files\SumatraPDF\SumatraPDF.exe" -print-to-default "%temp%\temp.pdf"


you can combine into one line using &&

curl -o "%temp%temp.pdf" "https://www.cyberciti.biz/files/sticker/sticker_book.pdf
" && "C:\Program Files\SumatraPDF\SumatraPDF.exe" -print-to-default "%temp%\temp.pdf"

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
100 1591k  100 1591k    0     0   470k      0  0:00:03  0:00:03 --:--:--  470k


thanks
I did the same but using autohotkey

^q::
Input, OutputVar, B L1, {LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{CapsLock}{NumLock}{PrintScreen}{Pause}
if OutputVar is not integer
{
return
}
if (errorlevel = 1)
{
return
}
else if FileExist("localpath")
{
clipboard := ""
RunWait SumatraPDF.exe /print-to-default /print-settings %OutputVar%x "localpath"
Loop
{
Sleep 1000
FileDelete, "localpath"
if (errorlevel > 0)
break
if (errorlevel < 1)
continue
}
}
return


could you please change the url = i posted it by mistake
since I don’t have the privilege to post it

thanks alot

GitHubRulesOK

Ok changed to use previous example