AutoHotkey Community

It is currently May 26th, 2012, 2:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: PDF command line tool
PostPosted: January 15th, 2008, 3:51 pm 
does anybody know of command tool that can retrieve the page number from the pdf document. small and free. it has to be something like that
the case is that i wasnt able to find it.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 4:06 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
pdftk my.pdf dump_data output my_report.txt

my_report.txt contains
NumberOfPages: 12

[ Moderator! : http://www.autohotkey.com/forum/viewtopic.php?t=1446 ]

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 4:34 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
where do u type that? I tried CMD but had no luck, it's not recorgnizing pdftk as a valid command.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 4:52 pm 
thanks!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 5:22 pm 
http://www.accesspdf.com/article.php/20041130153545577


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 5:52 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
omg, this is sooooooo coooooooool :shock: .
Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 6:09 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Sorry, forgot link :shock:

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 9:08 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
shot in the dark, but does anyone know of a utility that will allow me to crop pdf pages with cmd?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 9:12 pm 
Offline

Joined: October 6th, 2007, 2:28 am
Posts: 49
Location: Philadelphia
Quote:
shot in the dark, but does anyone know of a utility that will allow me to crop pdf pages with cmd?


No. But, (another shot in the dark), maybe you could change printer margin settings, and in that way, "crop" the pdfs @ print-time.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 9:53 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
neXt wrote:
shot in the dark, but does anyone know of a utility that will allow me to crop pdf pages with cmd?
That should help: PDF Split and Merge (java - open source)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 10:10 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
Question, i can't get it to work with AHK, here is what i have tried:
Code:
run %comspec% pdftk ENT.pdf dump_data output pages.txt

Code:
run %comspec% /c pdftk ENT.pdf dump_data output pages.txt

Code:
runwait %comspec% /c pdftk ENT.pdf dump_data output pages.txt


If i test it through cmd it works just fine, how do i make it work?
I even tried running it from the same directory:
Code:
run pdftk.exe ENT.pdf dump_data output pages.txt

Any ideas?
Thanks. :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 10:38 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Having a.pdf and pdftk.exe in the same directory, this worked for me:
Code:
run pdftk a.pdf dump_data output a.txt
The file a.txt was created

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2008, 11:31 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
My bad, running %comspec% from AHK automatically sets working directory to scripts folder, i though i was working in "documents and settings". Everything is good now, thatnks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2008, 6:48 pm 
please can anybody post a working example of how we can execute this command line program from the script?

i tried and succeeded to start from command line but when i try from script
i dont have any results.

the script and pdftk.exe are in the same folder and pdf file as well
how do i get this to work pdftk final.pdf dump_data output final.txt

thanks in advance.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2008, 7:10 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
Code:
runwait %comspec% /c pdftk ENT.pdf dump_data output pages.txt

comspec in AHK is cmd. Switch /c will run command and exit after it's done, if you have problems replace it with /k it will show you what error you have.

this will run cmd in hidden mode:
Code:
runwait %comspec% /c pdftk ENT.pdf dump_data output pages.txt,,hide


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group