AutoHotkey Community

It is currently May 25th, 2012, 8:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: November 29th, 2004, 7:31 pm 
Quote:
Pdftk - the pdf toolkit

If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents. Keep one in the top drawer of your desktop and use it to:

Merge PDF Documents

Split PDF Pages into a New Document

Decrypt Input as Necessary (Password Required)

Encrypt Output as Desired

Fill PDF Forms with FDF Data and/or Flatten Forms

Apply a Background Watermark

Report on PDF Metrics such as Metadata, Bookmarks, and Page Labels

Update PDF Metadata

Attach Files to PDF Pages or the PDF Document

Unpack PDF Attachments

Burst a PDF Document into Single Pages

Uncompress and Re-Compress Page Streams

Repair Corrupted PDF (Where Possible)

Pdftk allows you to manipulate PDF easily and freely. It does not require Acrobat, and it runs on Windows, Linux, Mac OS X, FreeBSD and Solaris.

[More...]

Windows Program Download
Download and unzip the following file. Move the resulting pdftk.exe to a convenient location, such as C:\windows\system32. Open a command prompt and type pdftk --help. You should get the above, usage instructions.

pdftk-1.12.exe.zip (~1.5MB)

License
My pdftk code is free software made available under the GPL.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 29th, 2004, 8:09 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Heh... everything but viewing it. Btw, what does this have to do with AHK?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 29th, 2004, 8:40 pm 
Quote:
Btw, what does this have to do with AHK?

Share your favorite scripts, subroutines, and utility software.
That's how this forum section is labeled :wink:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 29th, 2004, 9:22 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
I think if you post a utility here, it should at least have something to do with AHK. Some of the utilities you're posting here are nice, and serve a purpose, but really have no relevance with regards to AHK.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 29th, 2004, 10:07 pm 
@ jonny
Before it gets philosophically. As long as AHK provides no internal PDF features it makes sense (maybe not for you but for others, e.g. like myself).

As AHK provides a command line feature (Run, RunWait) to run whatever you like even third party tools like the recommended one (or a DOSBox, or Word, or Excel, or ...), AHK works as an interface to accomplish whatever task should be done.

If you don't like to get info about usefull tools (beside AHK) ignore it. Thx.
I don't think I won't stop to recommend usefull tools. Maybe someday that'll save someones live(time), even a bit of it :wink:.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2004, 12:41 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
i feel its nice to post about new/less-known tools here...

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2004, 1:23 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
jonny wrote:
I think if you post a utility here, it should at least have something to do with AHK. Some of the utilities you're posting here are nice, and serve a purpose, but really have no relevance with regards to AHK.
The intended scope of the Utilities forum is pretty broad. I didn't want there to be any requirement for a relationship with AHK.

However, it would be preferable that anyone posting a utility have personal experience with it, so that they can vouch for it (unless it's something unusual or obviously useful, such as the PDF toolkit).


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 29th, 2004, 7:01 am 
Has somebody already made an ahk script for pdftk? If not, perhaps I could try.


Report this post
Top
  
Reply with quote  
 Post subject: Gui for pdftk
PostPosted: February 14th, 2005, 6:40 am 
Here is a GUI for pdftk, made using autohotkey, covering the basic functions. Keep it in the same directory as pdftk.exe and run it.
Code:
IfNotExist, pdftk.exe
  {
  MsgBox, pdftk.exe not found in same directory
  ExitApp
  }
Gui, Add, Radio, vOpt, Decrypt PDF file (password should be known)
Gui, Add, Radio, , Encrypt PDF file 128 bit, withhold all permissions
Gui, Add, Radio, , Encrypt PDF file 128 bit, allow printing, `nwithhold other permissions
Gui, Add, Radio, , Encrypt PDF file 128 bit, user needs password to open, `nwithhold all permissions
Gui, Add, Radio, , Encrypt PDF file 128 bit, user needs password to open, `nallow printing, withhold other permissions
Gui, Add, Radio, , Join 2 unencrypted PDF files
Gui, Add, Radio, , Join all unencrypted PDF files in a folder
Gui, Add, Radio, , Remove a page from an unencrypted file
Gui, Add, Radio, , Burst an unencrypted pdf file into single pages
Gui, Add, Radio, , None of the above
Gui, Add, Radio, , About this Gui
Gui, Add, Button, ,OK
Gui, Show, x250 y150, PDF Tool Kit Graphical User Interface
Return

ButtonOK:
Gui, Submit

if Opt=1
  {
  FileSelectFile, arg1,,,"Choose file to decrypt",*.pdf
  InputBox, foopass,,Enter Password, HIDE,
  FileSelectFile, arg2,,,"Choose output file",*.pdf
  RunWait, pdftk.exe %arg1%  input_pw %foopass% output %arg2%.pdf
  }
else if Opt=2
  {
  FileSelectFile, arg1,,,"Choose file to encrypt",*.pdf
  InputBox, foopass,,Enter Password, HIDE,
  FileSelectFile, arg2,,,"Choose output file",*.pdf
  RunWait, pdftk.exe %arg1%  output %arg2%.pdf owner_pw %foopass%
  }
else if Opt=3
  {
  FileSelectFile, arg1,,,"Choose file to encrypt",*.pdf
  InputBox, foopass,,Enter Password, HIDE,
  FileSelectFile, arg2,,,"Choose output file",*.pdf
  RunWait, pdftk.exe %arg1%  output %arg2%.pdf owner_pw %foopass% allow printing
  }
else if Opt=4
  {
  FileSelectFile, arg1,,,"Choose file to encrypt",*.pdf
  InputBox, foopass,,Enter Owner Password, HIDE,
  loop
    {
    InputBox, baz,,Enter User Password, HIDE,
    If baz=%foopass%
      {
      MsgBox, User password should not be owner password
      }
    else
      {
      break
      }
    }
  FileSelectFile, arg2,,,"Choose output file",*.pdf
  RunWait, pdftk.exe %arg1%  output %arg2%.pdf owner_pw %foopass% user_pw %baz%
  }
else if Opt=5
  {
  FileSelectFile, arg1,,,"Choose file to encrypt",*.pdf
  InputBox, foopass,,Enter Owner Password, HIDE,
  loop
    {
    InputBox, baz,,Enter User Password, HIDE,
    If baz=%foopass%
      {
      MsgBox, User password should not be owner password
      }
    else
      {
      break
      }
    }
  FileSelectFile, arg2,,,"Choose output file",*.pdf
  RunWait, pdftk.exe %arg1%  output %arg2%.pdf owner_pw %foopass% user_pw %baz% allow printing
  }
else if Opt=6
  {
  FileSelectFile, in1,,,"Choose first file to join",*.pdf
  FileSelectFile, in2,,,"Choose second file to join",*.pdf
  FileSelectFile, out1,,,"Choose output file",*.pdf
  RunWait, pdftk.exe %in1% %in2% cat output %out1%.pdf
  }
else if Opt=7
  {
  FileSelectFolder, inf,,,"Select folder containing the pdf files"
  FileSelectFile, out1,,,"Choose output file",*.pdf
  RunWait, pdftk.exe %inf%\*.pdf cat output %out1%.pdf
  }
else if Opt=8
  {
  FileSelectFile, arg1,,,"Choose file from which page to be removed",*.pdf
  InputBox, pr,,Give page number to be removed
  FileSelectFile, out1,,,"Choose output file",*.pdf
  pb=%pr%
  pb-=1
  pn=%pr%
  pn+=1
  RunWait, pdftk.exe %arg1% cat 1-%pb% %pn%-end output %out1%.pdf
  }
else if Opt=9
  {
  FileSelectFile, in1,,,"Choose file to burst",*.pdf
  RunWait, pdftk.exe %in1% burst
  }
else if Opt=10
  {
  MsgBox, "Sorry, your requirement is not yet included"
  }
else
  {
  MsgBox, This script developed by Dhanish`nwww.dhanish.150m.com/software.html`nFor PDF tool kit, visit http://www.accesspdf.com/pdftk/
  }
GuiClose:
GuiEscape:
ExitApp
A compiled version can be downloaded from www.dhanish.150m.com/software.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2005, 8:39 am 
Quote:
A compiled version can be downloaded from www.dhanish.150m.com/software.html
and directly from here (without being bothered by an "wanna install an AddWare?"-Popup) request) [PDFTKgui]

@ pbd
Thx for sharing it. Much appreciated.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2005, 8:44 am 
:shock: My above advise/link won't work as pbd's web account isn't enabled for "Hotlinking". Sorry folks. :oops:

Quote:
A Hotlinking Error Has Occured!

We have detected a hotlinking error. Hotlinking is when you link to images or NON html files on 150m.com from another host. Hotlinking is not allowed for our FREE Accounts. Hotlinking is allowed for our paid accounts. Your account can be upgraded in the user section when you have logged in.


Report this post
Top
  
Reply with quote  
 Post subject: A correction
PostPosted: February 22nd, 2005, 6:41 am 
Oops, the above script will not work if the path / filename contains blank spaces. This can be overcome by adding inverted commas for the variable names.

But this will not work for option 7 while selecting a directory with *.pdf. Can AutoHotkey capture shortnames of directory paths?

The compiled version has been corrected.


Report this post
Top
  
Reply with quote  
 Post subject: Re: A correction
PostPosted: February 22nd, 2005, 10:21 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
pbd wrote:
Can AutoHotkey capture shortnames of directory paths?
A way was recently added:
Code:
Loop %MyFileName%
    ShortPath = %A_LoopFileShortPath%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2005, 4:51 am 
I have not tried pdftk, but use xpdf a lot. it probably doesn't do all
what pdftk says it does, but it does what i need, like pdftotext.

http://www.foolabs.com/xpdf


Report this post
Top
  
Reply with quote  
 Post subject: repair multiple pdfs ???
PostPosted: August 13th, 2007, 9:11 pm 
Hi all,

I want to repair pdfs in my file structure, we have very big files structure.
I'm trying to use pdftk.exe tool, which is very cool, but I want to use it for multiple pfds, and typing:

pdftlk.exe file1.pdf output file1good.pdf | pdftlk.exe file2.pdf output file2good.pdf | pdftlk.exe file3.pdf output file3good.pdf ...

is not something that I want to do every time. Can someone help me with developing some script for using pdftk.exe to repair all *.pdf in current "dir" ??

pdftk.exe *.pdf output *.pdf
doesn't work

thanks.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 5 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