Albertxu Posted June 8, 2011 Share Posted June 8, 2011 (edited) Hi, my hard disk met with some problems and all partitions missing and so as files. I do recover large part of my docs after using Easy Recovery, but the recovered files are all in a mess --they are renamed with such names as FIL0, FIL99 etc. My question is: how can I read the titles from within the PDF document and then rename the files with title using AutoIt. I know that some of them have blank titles but at leat 60% of them have. For those who don't understand the title of the PDFs, you can just find it out as you click in Adobe Acrobat menus -File-> Property, there you can see the title along with the author. Can someone help me? Edited June 8, 2011 by Albertxu Link to comment Share on other sites More sharing options...
hannes08 Posted June 8, 2011 Share Posted June 8, 2011 Hi Albertxu, you can open the PDF with FileOpen or _FileReadToArray and look for the strings /Author and /Title. This should give you the information requested. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
water Posted June 8, 2011 Share Posted June 8, 2011 (edited) I can't find it at the moment but there seems to be an example script that lists all attibutes of a file (those that you can select as columns for the Windows Explorer).Edit: Got it! Try or to extract all file properties. Edited June 8, 2011 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
hannes08 Posted June 8, 2011 Share Posted June 8, 2011 I can't find it at the moment but there seems to be an example script that lists all attibutes of a file (those that you can select as columns for the Windows Explorer).Edit: Got it! Try or to extract all file properties.I'm not sure if there's Metadata ready for PDF files. On my XP I cannot see it in Windows Explorer. Maybe under Win Vista or 7. I think looking at the text of the file will be the easier method here. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
water Posted June 8, 2011 Share Posted June 8, 2011 (edited) Just tried it on W7 and - unfortunately - you are right! Edited June 8, 2011 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Zedna Posted June 8, 2011 Share Posted June 8, 2011 Maybe some type of COM/AcitveX library can help you with that. For example (some result of search on this forum): http://www.foolabs.com/xpdf/download.html Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ReFran Posted June 8, 2011 Share Posted June 8, 2011 Hi, because you have Adobe Acrobat you can control it via IAC (activeX) You may use the attached script. HTH, Reinhard $FilePath = "C:\Test.pdf" ;;---------------------- $App = ObjCreate("AcroExch.App") ;; start Adobe Acrobat $App.Show ;; show Acrobat or comment out for hidden mode $AVDoc = ObjCreate("AcroExch.AVDoc") ;; connect to Ac Viewer If $AVDoc.Open($FilePath,"") Then ;; open the file $title = $avDoc.getTitle ;; get the title MsgBox(0,"",$title) endif $app.exit() ;; close process ;; release objects $AvDoc = 0 $App = 0 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