print files

Features wanted...
Post Reply
lian00
Posts: 429
Joined: 09 Jul 2014 17:12

print files

Post by lian00 »

Hello,
I wanted to print some images and I did not find any way to do so in XYplorer. Did I miss something ?
Windows 10 64 bits

highend
Posts: 14954
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: print files

Post by highend »

Code: Select all

    $files    = "<get SelectedItemsPathNames |>";
    $printers = replace(regexmatches(runret("wmic path win32_printer get name /format:list"), "Name=.*?$", "|"), "Name=");
    $printer  = quote(popupmenu($printers, -1, -1, , , 0, "|"));
    foreach($file, $files) {
        $file = quote($file);
        run "rundll32.exe %SystemRoot%\System32\shimgvw.dll,ImageView_PrintTo /pt $file $printer", "<curpath>", 0, 0;
    }
One of my scripts helped you out? Please donate via Paypal

lian00
Posts: 429
Joined: 09 Jul 2014 17:12

Re: print files

Post by lian00 »

OK, thank you. Too bad it's not in the core. Will it work in 64 bits ?
Windows 10 64 bits

highend
Posts: 14954
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: print files

Post by highend »

Yeah, I'm using it on Windows Server 2012 R2 (x64)...
One of my scripts helped you out? Please donate via Paypal

lian00
Posts: 429
Joined: 09 Jul 2014 17:12

Re: print files

Post by lian00 »

It works ! Thanks a lot.
Windows 10 64 bits

admin
Site Admin
Posts: 66361
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: print files

Post by admin »

I say WOW. :shock: :appl:

lian00
Posts: 429
Joined: 09 Jul 2014 17:12

Re: print files

Post by lian00 »

admin wrote:I say WOW. :shock: :appl:
So it could be put in core :-)
Windows 10 64 bits

admin
Site Admin
Posts: 66361
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: print files

Post by admin »

It could. Not sure about the demand though.

lian00
Posts: 429
Joined: 09 Jul 2014 17:12

Re: print files

Post by lian00 »

admin wrote:It could. Not sure about the demand though.
Well, as it's a very good image browser - I used XYplorer as image browser - this could be a nice feature. But if I'm fhe fist one asking for such a feature, I suppose there is not a lot of people interested in...
Windows 10 64 bits

ColdNose
Posts: 36
Joined: 16 Jun 2017 09:21
Location: Win11, 3 monitors: (1) 1920x1200 @ 125%, (2) 3840x2160 @ 175%

Re: print files

Post by ColdNose »

highend wrote: 28 Aug 2015 18:44

Code: Select all

    $files    = "<get SelectedItemsPathNames |>";
    $printers = replace(regexmatches(runret("wmic path win32_printer get name /format:list"), "Name=.*?$", "|"), "Name=");
    $printer  = quote(popupmenu($printers, -1, -1, , , 0, "|"));
    foreach($file, $files) {
        $file = quote($file);
        run "rundll32.exe %SystemRoot%\System32\shimgvw.dll,ImageView_PrintTo /pt $file $printer", "<curpath>", 0, 0;
    }
Highend, is there way to modify this to print any filetype (.pdf, .docx, etc.)? If not any filetypes, how about just .pdfs?

I think shimgvw.dll only works with image files, right?

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: print files

Post by jupe »

You definitely can't print PDFs with the above method, but if you use SumatraPDF you can print them via command line, I gave a small example how here:

viewtopic.php?t=19957#p166324

Post Reply