doucment Posted January 24, 2006 Share Posted January 24, 2006 I want to write a script about PDF. I need to OPEN PDF document in my Script,how I do it ? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 24, 2006 Share Posted January 24, 2006 I want to write a script about PDF. I need to OPEN PDF document in my Script,how I do it ?Adobe opened their definition of .pdf files so anyone can write a program to read and write them, providing certain Adobe policies are maintained, like respecting read-only settings inside the file. There now are many free/open source apps to open and create .pdf files, and of course the free Adobe Acrobat Reader too.From http://en.wikipedia.org/wiki/.pdf: Free readers for many platforms are available: the free Adobe Reader by Adobe Systems, the free Foxit Reader, and several free open source readers, including Xpdf, KPDF, GPdf, Evince, GSPdf and ViewPDF, and front-ends for many platforms to Ghostscript. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
doucment Posted January 25, 2006 Author Share Posted January 25, 2006 Xpdf 3.01pl1 was released 2005-dec-01.http://www.foolabs.com/xpdf/download.htmlNov 29, 2005: KPDF 0.5.0 releasedhttp://kpdf.kde.org/news.php#itemKPDF050released2003-07-01 jdub has just uploaded the GPdf 0.104 tarball. http://web.inf.tu-dresden.de/~mk793652/gpdf/evincehttp://www.gnome.org/projects/evince/GSPdfhttp://www.gnustep.it/enrico/gspdf/viewpdf(break)http://packages.debian.org/unstable/text/viewpdfMost of them are run on Unix or Linux. Autoit can only run on Windows.Is there acrobat reader SDK to download? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 25, 2006 Share Posted January 25, 2006 Most of them are run on Unix or Linux. Autoit can only run on Windows.Is there acrobat reader SDK to download?Google "PDF SDK" and you get more than a million hits... Also, OpenOffice.org is free and open source, has a command line interface for its macro language, and does PDF inport/export natively (not to mention ODF, DOC, etc.). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Xander Posted January 25, 2006 Share Posted January 25, 2006 Maybe we're overcomplicating the question. How about this?Run("C:\program files\adobe\reader\reader.exe pathtoPDFfile.pdf") Link to comment Share on other sites More sharing options...
ptrex Posted January 25, 2006 Share Posted January 25, 2006 Hi This shouls get you started: This Sample access the ActiveX component of the Adobe Reader. There is still a problem opening a file. But Googling your way around, you should find the solution. expandcollapse popup; Author: ptrex ; AutoIt Version: 3.1.1.103 ; Description: Very Simple example: Embedding Acrobat PDF object ; Needs: Acrobat Reader to be installed ; Date: 25 jan 2006 #include <GUIConstants.au3> #NoTrayIcon ;Vars Dim $oMyError Dim $File Dim $Version ;$File="C:\Program Files\Adobe\Acrobat 7.0\Help\ENU\Reader.pdf" ;Declare objects $oPDF = ObjCreate("AcroPDF.PDF.1"); $Version=$oPDF.GetVersions ;Main Gui GuiCreate("PDF Object", 802, 590,(@DesktopWidth-802)/2, (@DesktopHeight-590)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) ;$oPDF.LoadFile("C:\Program Files\Adobe\Acrobat 7.0\Help\ENU\Reader.pdf") $GUI_ActiveX = GUICtrlCreateObj ($oPDF, 10, 10 , 780 , 550) GUICtrlSetStyle ( $GUI_ActiveX, $WS_VISIBLE ) GUICtrlSetResizing ($GUI_ActiveX,$GUI_DOCKAUTO) ; Auto Resize Object GuiSetState() MsgBox(0,"Show Versions",$Version) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd $oPDF = "" $GUIActiveX = "" Exit ;This is SvenP 's custom error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Enjoy. Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
JKL Posted June 7, 2006 Share Posted June 7, 2006 (edited) You should use the src property of the PDF object instead of the loadfile method. ;$oPDF.LoadFile("C:\Program Files\Adobe\Acrobat 7.0\Help\ENU\Reader.pdf") $oPDF.src="C:\Program Files\Adobe\Acrobat 7.0\Help\ENU\Reader.pdf" It worked well with AutoIt v. 3.1.1.125 and c:\Program Files\Adobe\Acrobat7.0\ActiveX\AcroPDF.dll Edited June 7, 2006 by JKL Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now