| View previous topic :: View next topic |
| Author |
Message |
biotech as guest Guest
|
Posted: Tue Jan 15, 2008 3:51 pm Post subject: PDF command line tool |
|
|
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
|
Posted: Tue Jan 15, 2008 4:06 pm Post subject: |
|
|
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 |
|
 |
neXt
Joined: 19 Mar 2007 Posts: 429
|
Posted: Tue Jan 15, 2008 4:34 pm Post subject: |
|
|
| where do u type that? I tried CMD but had no luck, it's not recorgnizing pdftk as a valid command. |
|
| Back to top |
|
 |
biotech as guest Guest
|
Posted: Tue Jan 15, 2008 4:52 pm Post subject: |
|
|
| thanks! |
|
| Back to top |
|
 |
biotech as guest Guest
|
|
| Back to top |
|
 |
neXt
Joined: 19 Mar 2007 Posts: 429
|
Posted: Tue Jan 15, 2008 5:52 pm Post subject: |
|
|
omg, this is sooooooo coooooooool .
Thanks! |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1143 Location: Denmark
|
Posted: Tue Jan 15, 2008 6:09 pm Post subject: |
|
|
Sorry, forgot link  _________________ 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 |
|
 |
neXt
Joined: 19 Mar 2007 Posts: 429
|
Posted: Tue Jan 15, 2008 9:08 pm Post subject: |
|
|
| shot in the dark, but does anyone know of a utility that will allow me to crop pdf pages with cmd? |
|
| Back to top |
|
 |
williamsharkey
Joined: 06 Oct 2007 Posts: 52 Location: Philadelphia
|
Posted: Tue Jan 15, 2008 9:12 pm Post subject: |
|
|
| 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 |
|
 |
Andreone
Joined: 20 Jul 2007 Posts: 257 Location: Paris, France
|
Posted: Tue Jan 15, 2008 9:53 pm Post subject: |
|
|
| 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 |
|
 |
neXt
Joined: 19 Mar 2007 Posts: 429
|
Posted: Tue Jan 15, 2008 10:10 pm Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1143 Location: Denmark
|
Posted: Tue Jan 15, 2008 10:38 pm Post subject: |
|
|
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 |
|
 |
neXt
Joined: 19 Mar 2007 Posts: 429
|
Posted: Tue Jan 15, 2008 11:31 pm Post subject: |
|
|
| 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 |
|
 |
biotech as guest Guest
|
Posted: Fri Jan 18, 2008 6:48 pm Post subject: |
|
|
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
|
Posted: Fri Jan 18, 2008 7:10 pm Post subject: |
|
|
| 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 |
|
 |
|