MS Word configurator
MS Word configurator
Does anyone know if the MS Word configurator supports multi-thread? I have over 1000 Word files to convert to PDF but it is taking forever in Switch.
Re: MS Word configurator
You could give openoffice headless a try. Another option would be to use a cloud service like cloudconvert.com
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Re: MS Word configurator
With a Powershell script via Execute Command you probably won’t even notice it’s already done
Re: MS Word configurator
Nope I'm using a lot of xlsx to csv and reversed but not doc. However I created this one for you.
This is something we don't need to reinvent, I got most of this script @ https://stackoverflow.com/questions/165 ... ocx-to-pdf.
Edit: tested with a job folder as input!
Code: Select all
#
# Script: docToPdf, Save Word files as pdf
#
# Last edit: 30-07-2018 by Sander, Drukkerij Wihabo
#
# Sources: https://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf
#
param(
[string]$1 = "", # Switch %1: the absolute path of the input file/job folder
[string]$2 = "", # Switch %2: the absolute path of the output file/job folder (which does not yet exist) including filename and extension
[string]$3 = "" # Switch %3: the absolute path of a folder (which does exist) in which output or temp files may be placed
)
<# test
$3 = "d:\tempOut"
$1 = "d:\temp"
$log = "d:\temp\log.log"
Add-Content -path $log -Value $1
Add-Content -path $log -Value $2
Add-Content -path $log -Value $3
#>
$word = New-Object -ComObject Word.Application
Get-ChildItem -Path $1 -Filter *.doc? | ForEach-Object {
$doc = $word.Documents.Open($_.FullName)
$outPdf = "$3\$($_.BaseName).pdf"
# Add-Content -path $log -Value $outPdf
$doc.SaveAs([ref] $outPdf, [ref] 17)
$doc.Close()
}
# Quit Word The Scripting Guy way, just to be sure we can remove all temp files.
$word.Quit()
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($word)
Remove-Variable Word
EXIT 0
Command: C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
Argument: -NoLogo -WindowStyle hidden -executionpolicy bypass -file D:\Scripts\PowerShell\docToPdf.ps1 -1 "%1" -2 "%2" -3 "%3"
Hope this helps
Sander
Re: MS Word configurator
If you have them, I would be really interested in numbers showing how much faster this is compared to the configurator
Re: MS Word configurator
Hi;
Thank you very much for this. I need to test it and see how it works, as it is not so much about processing a ready folder with hundreds or thousands of Word Docs, as about individual ones, which cue up in the standard Word configurator, when processed on "per file" basis. So if I have lets say (just for you to envisage the situation) 20-30 word docs cued in front of the configurator, while Switch is doing some other things or processing other files, it takes significant amount time with the configurator to convert it to PDF.
So I am looking for an alternative, which goes quicker via the CLI, on a 'per file' basis.
But I'll see if this is going to do the trick.
Thank you very much for this. I need to test it and see how it works, as it is not so much about processing a ready folder with hundreds or thousands of Word Docs, as about individual ones, which cue up in the standard Word configurator, when processed on "per file" basis. So if I have lets say (just for you to envisage the situation) 20-30 word docs cued in front of the configurator, while Switch is doing some other things or processing other files, it takes significant amount time with the configurator to convert it to PDF.
So I am looking for an alternative, which goes quicker via the CLI, on a 'per file' basis.
But I'll see if this is going to do the trick.