[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

check corrupt PDF file

Flaming Flamingo

1/24/2008 9:02:00 AM

Hi,
I'm making a script that check's if a pdf file is corrupt or not.

require 'watir'
require 'win32ole'
require 'pdf/writer'

oPDF = WIN32OLE.new('AcroExch.App')
oPDFDoc = WIN32OLE.new('AcroExch.AVDoc')

if (oPDFDoc.Open("c:\\tempcor.pdf","") !=true)
puts "false" #problem...press enter
else
puts "true"
end

Now, the problem is, when opening a corrupt pdf, a message appears in
Adobe.
Does anyone know how to check it without the message or get the message
out of the way?

cheers.
FF
--
Posted via http://www.ruby-....

1 Answer

Flaming Flamingo

1/24/2008 9:37:00 AM

0

oke, fixed it with this:

Before opening the pdf I call this def:

def startClicker(waitTime = 3)
sleepTime = waitTime
puts "in clicker"
@wsh = WIN32OLE.new('Wscript.Shell')
@wsh.SendKeys('{enter}')
end

Any better idea's are welcom (don't like sendkeys solutions that
much...)
--
Posted via http://www.ruby-....