I have a folder containing some .doc,.docx documents. I am able to convert these to *.pdf using powershell
$wdDocument.ExportAsFixedFormat( ..... )
I have another folder having*.pdf documents. I want to convert *.PDF to .doc/.docx using powershell and Acrobat PRO?
Acrobat PRO( 10 ) is installed in the system(I don't know how to call Acrobat from powershell).
OS: Windows 7 Pro(x64) MS-Office : 2010
You can try opening the document in Word, and then saving as. I'm not sure of what (if any) Acrobat APIs are available, but Word is pretty smart about opening PDF documents that conform to the PDF ISO Standard, which Adobe submitted in I think 2006 to become a standard. That's not your question though!
$filePath = "C:\Temp\MyPdfDocument.pdf"
$wd = New-Object -ComObject Word.Application
$wd.Visible = $true
$txt = $wd.Documents.Open(
$filePath,
$false,
$false,
$false)
$wd.Documents[1].SaveAs("C:\Temp\MyPdfDocument.docx")
$wd.Documents[1].Close()
Don't forget to kill off the Word interop after that... I'm not sure if this is the BEST way, but it ought to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With