2

Edit: It seems my friend can install IrfanView if that helps.

I'm helping a friend to automate the task of printing every single image file in a folder into multiple PDFs: Each image goes to a different PDF in a windows 10 computer. My friend works in a corporate environment with strict rules regarding installation and as such there a lot of stuff that can't be installed, such as

  • not in a virtual machine
  • so far, I know he can't install imagemagick, 2pdf, foxit
  • he HAS acrobat reader and PDF-XChange Pro, though, not sure if these help, I haven't find anything helpful with this software so far
  • some of the image files to print are in these special tiff files in which a single image has multiple "pages" of images, I think it's called a mtif or multifif? When the script prints these, it only produces a PDF with the first "page". The desirable outcome would be a single multi-paged PDF file.
  • the more "in the background" the script runs, the better.

What I've done so far is a very simple batch script that takes advantage of the "Microsoft Print to PDF" virtual printer and the mspaint command line. If I could somehow activate the "Microsoft Print to PDF" printer through another command besides mspaint maybe I could at least solve the issue with printing multitif into a single PDF with all the "pages" inside. I say this because if I print the mtif using mspaint GUI I replicate the same issue. (a mtif producing a PDF with a single page").

UPDATE: It might also just be a coincidence and the issue is somehow due to being a batch operation. The /print="Microsoft Print to PDF" from IrfanView produces the same undesirable result of a single paged PDF with only the first image of said multitiff as the output of said command.

This the batch script I've made so far

@echo off
echo This script will print all the images in this foldes
echo so long as they are openable with mspaint 
echo and print in a new, unique folder inside %~dp0

for %%i in (*.jpg) do (
  mspaint /pt %%i "Microsoft Print to PDF"
)

for %%i in (*.jpeg) do (
  mspaint /pt %%i "Microsoft Print to PDF"
)

for %%i in (*.png) do (
  mspaint /pt %%i "Microsoft Print to PDF"
)

for %%i in (*.tif) do (
  mspaint /pt %%i "Microsoft Print to PDF"
)

My friend already thanked me with the script since, although the script asks for the name and destination of each pdf file, it still saves him a couple of time and clicks. I want to do better and there's still that problem regarding the mtif files.

I have code prepared to create the folder

@echo off
mkdir Img2Pdf%date:~-4,4%"-"%date:~-7,2%"-"%date:~-10,2%" - "%time:~0,2%"h"%time:~3,2%"m"%time:~6,2%"s"
pause

And I think it will be no issue for me to add the copy / moving the resulting file into the folder or adding a name to file. But the lack of printing options that I've found so far has been this quite a difficult endeavor. What are my options? I'm guessing none!

Thank you for your time reading this, if there's any way I can improve the question let me know, sorry if the code/spelling may cringe some of you since it's not the most optimized code or the most correct wording, I please ask to bear with me and be kind, if possible.

0

0

You must log in to answer this question.

Browse other questions tagged .