2

I have a folder with .jpg files I want to send all this images to a printer.

I tried with ShellExecute, with two files :

UnicodeString filePath1 = "something1.jpg";
UnicodeString filePath2 = "something2.jpg";
UnicodeString cmd = "print";


ShellExecute(Form1->Handle, cmd.c_str(), filePath1.c_str(), NULL, NULL, SW_SHOWNORMAL);
ShellExecute(Form1->Handle, cmd.c_str(), filePath2.c_str(), NULL, NULL, SW_SHOWNORMAL);

But 2 instances of the Windows printer are created. One for each file. I would like to have a single instance, with the two files : one image per file.

I also tried filePath = "something1.jpg something2.jpg" but its not working.

Thanks.

macTAR
  • 83
  • 12
  • This problem is much bigger than you think it is. You need a utility that can open multiple files and print them at once, then use that program rather than the "print" verb. – Mark Ransom May 19 '17 at 16:29
  • you can list directory programaticaly or use TFileList from win 3.11 VCL components and use Printing from VCL to send all images one by one ... see [Blurry print with legacy borland software](http://stackoverflow.com/a/31021608/2521214) and [There is no default printer selected” error when Windows default printer is not set up](http://stackoverflow.com/a/42384425/2521214) for the printing stuff and [Display an array of color in C](http://stackoverflow.com/a/21699076/2521214) , [Image output in C](http://stackoverflow.com/a/22779808/2521214) for rendering and jpg – Spektre May 20 '17 at 06:15

0 Answers0