AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PDF command line tool
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources
View previous topic :: View next topic  
Author Message
biotech as guest
Guest





PostPosted: Tue Jan 15, 2008 3:51 pm    Post subject: PDF command line tool Reply with quote

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.
Back to top
tonne



Joined: 06 Jun 2006
Posts: 1143
Location: Denmark

PostPosted: Tue Jan 15, 2008 4:06 pm    Post subject: Reply with quote

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 ]
_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
neXt



Joined: 19 Mar 2007
Posts: 429

PostPosted: Tue Jan 15, 2008 4:34 pm    Post subject: Reply with quote

where do u type that? I tried CMD but had no luck, it's not recorgnizing pdftk as a valid command.
Back to top
View user's profile Send private message
biotech as guest
Guest





PostPosted: Tue Jan 15, 2008 4:52 pm    Post subject: Reply with quote

thanks!
Back to top
biotech as guest
Guest





PostPosted: Tue Jan 15, 2008 5:22 pm    Post subject: Reply with quote

http://www.accesspdf.com/article.php/20041130153545577
Back to top
neXt



Joined: 19 Mar 2007
Posts: 429

PostPosted: Tue Jan 15, 2008 5:52 pm    Post subject: Reply with quote

omg, this is sooooooo coooooooool Shocked .
Thanks!
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1143
Location: Denmark

PostPosted: Tue Jan 15, 2008 6:09 pm    Post subject: Reply with quote

Sorry, forgot link Shocked
_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
neXt



Joined: 19 Mar 2007
Posts: 429

PostPosted: Tue Jan 15, 2008 9:08 pm    Post subject: Reply with quote

shot in the dark, but does anyone know of a utility that will allow me to crop pdf pages with cmd?
Back to top
View user's profile Send private message
williamsharkey



Joined: 06 Oct 2007
Posts: 52
Location: Philadelphia

PostPosted: Tue Jan 15, 2008 9:12 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Tue Jan 15, 2008 9:53 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
neXt



Joined: 19 Mar 2007
Posts: 429

PostPosted: Tue Jan 15, 2008 10:10 pm    Post subject: Reply with quote

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. Very Happy
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1143
Location: Denmark

PostPosted: Tue Jan 15, 2008 10:38 pm    Post subject: Reply with quote

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
_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
neXt



Joined: 19 Mar 2007
Posts: 429

PostPosted: Tue Jan 15, 2008 11:31 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
biotech as guest
Guest





PostPosted: Fri Jan 18, 2008 6:48 pm    Post subject: Reply with quote

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.
Back to top
neXt



Joined: 19 Mar 2007
Posts: 429

PostPosted: Fri Jan 18, 2008 7:10 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group