Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

PDF command line tool


  • Please log in to reply
19 replies to this topic
biotech as guest
  • Guests
  • Last active:
  • Joined: --
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.

tonne
  • Members
  • 1654 posts
  • Last active: May 06 2014 06:22 PM
  • Joined: 06 Jun 2006
pdftk my.pdf dump_data output my_report.txt

my_report.txt contains
NumberOfPages: 12

[ Moderator! : <!-- m -->http://www.autohotke...opic.php?t=1446<!-- m --> ]

neXt
  • Members
  • 549 posts
  • Last active: May 20 2015 02:38 AM
  • Joined: 18 Mar 2007
where do u type that? I tried CMD but had no luck, it's not recorgnizing pdftk as a valid command.

biotech as guest
  • Guests
  • Last active:
  • Joined: --
thanks!

biotech as guest
  • Guests
  • Last active:
  • Joined: --
http://www.accesspdf...041130153545577

neXt
  • Members
  • 549 posts
  • Last active: May 20 2015 02:38 AM
  • Joined: 18 Mar 2007
omg, this is sooooooo coooooooool :shock: .
Thanks!

tonne
  • Members
  • 1654 posts
  • Last active: May 06 2014 06:22 PM
  • Joined: 06 Jun 2006
Sorry, forgot link :shock:

neXt
  • Members
  • 549 posts
  • Last active: May 20 2015 02:38 AM
  • Joined: 18 Mar 2007
shot in the dark, but does anyone know of a utility that will allow me to crop pdf pages with cmd?

williamsharkey
  • Members
  • 49 posts
  • Last active: Mar 14 2013 06:16 AM
  • Joined: 06 Oct 2007

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.

Andreone
  • Members
  • 257 posts
  • Last active: Mar 19 2008 05:30 PM
  • Joined: 20 Jul 2007

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)

neXt
  • Members
  • 549 posts
  • Last active: May 20 2015 02:38 AM
  • Joined: 18 Mar 2007
Question, i can't get it to work with AHK, here is what i have tried:
run %comspec% pdftk ENT.pdf dump_data output pages.txt
run %comspec% /c pdftk ENT.pdf dump_data output pages.txt
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:
run pdftk.exe ENT.pdf dump_data output pages.txt
Any ideas?
Thanks. :D

tonne
  • Members
  • 1654 posts
  • Last active: May 06 2014 06:22 PM
  • Joined: 06 Jun 2006
Having a.pdf and pdftk.exe in the same directory, this worked for me:
run pdftk a.pdf dump_data output a.txt
The file a.txt was created

neXt
  • Members
  • 549 posts
  • Last active: May 20 2015 02:38 AM
  • Joined: 18 Mar 2007
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.

biotech as guest
  • Guests
  • Last active:
  • Joined: --
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.

neXt
  • Members
  • 549 posts
  • Last active: May 20 2015 02:38 AM
  • Joined: 18 Mar 2007
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:
runwait %comspec% /c pdftk ENT.pdf dump_data output pages.txt,,hide