Search Results

Search found 16 results on 1 pages for 'pdftk'.

Page 1/1 | 1 

  • PDFtk Password Protection Help

    - by Dave W.
    I am using Ubuntu 11.10 and am looking for a solution to password protect a bunch of pdf files in a directory in batch. I came across PDFtk and it looks like it might do what I need, but I've reviewed the command line PDFtk examples and can't figure out if there is a way to do it in batch without having to individually specify the output file name for every file. I'm hoping a command-line guru can take a look at the PDFtk syntax and tell me if there is some trick / command that will allow me to password protect a directory of pdf files (e.g., *.pdf) and overwrite the existing files using the same name, or consistently rename the individual output files without having to specify each output name individually. Here's a link to the PDFtk command line examples page: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ Thanks for your help. I think I've answered my own question. Here's a bash script that appears to do the trick. I'd welcome help evaluating why the code I've commented out doesn't work... #!/bin/bash # Created by Dave, 2012-02-23 # This script uses PDFtk to password protect every PDF file # in the directory specified. The script creates a directory named "protected_[DATE]" # to hold the password protected version of the files. # # I'm using the "user_pw" parameter, # which means no one will be able to open or view the file without # the password. # # PDFtk must be installed for this script to work. # # Usage: ./protect_with_pdftk.bsh [FILE(S)] # [FILE(S)] can use wildcard expansion (e.g., *.pdf) # This part isn't working.... ignore. The goal is to avoid errors if the # directory to be created already exists by only attempting to create # it if it doesn't exists # #TARGET_DIR="protected_$(date +%F)" #if [ -d "$TARGET_DIR" ] #then #echo # echo "$TARGET_DIR directory exists!" #else #echo # echo "$TARGET_DIR directory does not exist!" #fi # mkdir protected_$(date +%F) for i in *pdf ; do pdftk "$i" output "./protected_$(date +%F)/$i" user_pw [PASSWORD]; done echo "Complete. Output is in the directory: ./protected_$(date +%F)"

    Read the article

  • pdftk issue after updating Ubuntu from 9.04 to 9.10

    - by Crazydog
    We upgraded our server to 9.10 from 9.04 the other day, and it all went well except for one rather important program. We're using pdftk to automatically generate filled out pdf forms. On 9.04, it worked just fine. After updating to 9.10, the pdf forms would no longer be filled out - they'd just be empty. I discovered that if I try to create an fdf file via pdftk from my PDF form, it just creates an empty fdf with no fields. On windows, pdftk generates the fdf file just fine. Any ideas? Thanks.

    Read the article

  • Merge PDF's with PDFTK with Bookmarks?

    - by Jason
    Using pdftk to merge multiple pdf's is working well. However, any easy way to make a bookmark for each pdf merged? I don't see anything on the pdftk docs regarding this so I don't think it's possible with pdftk. All of our files merged will be 1 page, so wondering if there's any other utility that can add in bookmarks afterwards? Or another linux based pdf utility that will allow to merge while specifying a bookmark for each individual pdf.

    Read the article

  • pdftk utility and batch file

    - by duhaas
    I cant for the life of me figure out what I'm missing. I have the following batch file: As you can see, when I run this batch file from my desk against a mapped drive it runs just fine: When I run the same exact batch file on the server itself, the place where the mapped drive is located on, it doesnt run and makes me think I have a syntax problem: I just dont understand whats going on, and my eyes are having a hard time keeping track of what might be diff. The server where it isnt working is windows 2003, my desktop where the same batch file is working is Windows 7. Here is the batch file, nothing crazy: FOR /D /r %%G in ("*") DO pdftk "%%G\*.pdf" cat output "%%G\Report.pdf"

    Read the article

  • What is a "good" tool to password-protect .pdf files?

    - by Marius Hofert
    What is a "good" tool to encrypt (password protect) .pdf files? (without being required to buy additional software; the protection can be created under linux but the password query should work on Windows, too) I know that zip can do it: zip zipfile_name_without_ending -e files_to_encrypt.foo What I don't like about this is that for a single file, you have to use Winzip to open the zip and then click the file again. I rather would like to be prompted for a password when opening the .pdf (single file case). I know that pdftk can do this: pdftk foo.pdf output foo_protected.pdf user_pw mypassword. The problem here is that the password is displayed in the terminal -- even if you use ... user_pw PROMPT. But in the end you get a password-protected .pdf and you are prompted for the password when opening the file.

    Read the article

  • Path is present, Permissions are okay, but still getting error

    - by N e w B e e
    I recently installed pdftk using instruction provided at stack overflow I installed it, and run the commanded whereis pdftk the result was /usr/local/bin/pdftk /usr/bin/pdftk I have the powerpannel access and I saw it through it that pdftk actually exists at the location i run the command pdftk --version, it was okay but when in php i use <?php $command = "pdftk --help"; system("PATH=/usr/local/bin/ && $command",$response); if ($response===FALSE){ echo 'sorry error occured'; } else{ echo $response; } ?> the output is 127 the version i am using is 1.41 and the output '127' is something that i cant understand can somebody guide me?

    Read the article

  • How to combine "|" character in run () command in powerbuilder in order to read an txt file as metad

    - by sgian76
    Could you please tell me how to use "pdftk mypdf.pdf dump data | findstr NumberOfPages in powerbuilder run command and save this metadata in a file by using the following code like this: string ls_runinput, ls_outputfile ls_outputfile = "c:\test.exe" ls_runinput = "c:\pdftk\pdftk.exe mypdf.pdf dump_data | findstr NumberOfPages >"+ls_outputfile Run(ls_runinput,Minimized!) li_fileopen = FileOpen(ls_outputfile ,TextMode!, Read!, Shared!) The problem is that Run command is executed, the file is created, but fileopen return -1 ? Is it maybe that run cannot recognize the "|" character? What should you propose me to write the right code? Iam using powerbuilder 10.5.2 , Thanks very much in advance

    Read the article

  • What is causing Unity to be slow on startup?

    - by To Do
    A few days ago I noticed that after I login in, the top panel and the dash took a bit more time to load and I noticed more disc activity than usual. I thought that it might have been caused by some update or by the installation of pdftk. So I removed pdftk but the "problem" persists. Is there a way to know what is using the disc (read/write operations) on startup? If it were at a later time, I would use iotop but I can only launch iotop after I get control of the desktop. I'm on Ubuntu 12.10 amd64.

    Read the article

  • merge two parts of pdf in one

    - by Yurij73
    I have two searchable pdf documents say even.pdf and odd.pdf which contains respectively even and odd pages of a book. I can decompile each pdf to separate files 001.pdf 002.pdf oo3.pdf ....The question is how to merge them? They are both even and odd sequences numbered 1,2,3. If it where other numbering on decompile stage with pdftk for even 1,3,5 and for odd 2,4,6 instead of existing order 1,2,3, 4.. i coulde simple merge them, but i ignore this method of numbering with pdftk. May be i need to do the task in other way?

    Read the article

  • How can I totally flatten a PDF in Mac OS on the command line?

    - by Matthew Leingang
    I use Mac OS X Snow Leopard. I have a PDF with form fields, annotations, and stamps on it. I would like to freeze (or "flatten") that PDF so that the form fields can't be changed and the annotations/stamps are no longer editable. Since I actually have many of these PDFs, I want to do this automatically on the command line. Some things I've tried/considered, with their degree of success: Open in Preview and Print to File. This creates a totally flat PDF without changing the file size. The only way to automate seems to be to write a kludgy UI-based AppleScript, though, which I've been trying to avoid. Open in Acrobat Pro and use a JavaScript function to flatten. Again, not sure how to automate this on the command line. Use pdftk with the flatten option. But this only flattens form fields, not stamps and other annotations. Use cupsfilter which can create PDF from many file formats. Like pdftk this flattened only the form fields. Use cups-pdf to hook into the Mac's printserver and save a PDF file instead of print. I used the macports version. The resulting file is flat but huge. I tried this on an 8MB file; the flattened PDF was 358MB! Perhaps this can be combined with a ghostscript call as in Ubuntu Tip:Howto reduce PDF file size from command line. Any other suggestions would be appreciated.

    Read the article

  • How to edit pdf metadata from command line?

    - by bdr529
    I need a command line tool for editing metadata of pdf-files. I'm using a Aiptek MyNote Premium tablet for writing my notes and minutes on this device, import them later and convert them to pdf automatically with a simple script using inkscape and ghostscript. Is there any command line tool to add some categories to the pdf's metadata, so i can find the pdf later (e.g. with gnome-do) by categories? Update: I tried the solution with pdftk and it works, but it seems that gnome-do doesn't take care of pdf-metadata. Is there a way to get gnome-do to do that?

    Read the article

  • Why do packages fail to install from command line

    - by calebB
    Every once in a while I can't install packages in Ubuntu 11.04. I'll try to run the software center and it and it will pop up then disappear. If I call it from the command line it says it seg-faults. And then trying to install anything from the command line I get this: sudo apt-get install pdftk Reading package lists... Done And thats all I get for anything I try. Usually restarting fixes the problem but its very annoying.

    Read the article

  • Merge two PDF files containing even and odd pages of a book

    - by Yurij73
    I have two searchable PDF documents, say even.pdf and odd.pdf which contain even and odd pages of a book, respectively. I can decompile each PDF to separate files 001.pdf 002.pdf 003.pdf, et cetera. The question is how to merge them? They are both even and odd sequences numbered 1, 2, 3. If the numbering in the decompile process with pdftk were different, e.g. 1, 3, 5 for even and 2, 4, 6 for odd instead of 1, 2, 3, 4, I could simply merge them. Can I do this any other way?

    Read the article

  • How can I programmatically renumber pages in a PDF?

    - by Andrew
    As a graduate student, I come across PDFs of articles and book chapters on a daily basis. Sometimes these PDFs are paginated correctly internally (that is, if an article starts on page 67, the PDF starts on page 67 as well; not on page 1). When they aren't, I have to open the file in Acrobat and renumber the pages in the "Page Thumbnails" panel. I would love to be able to automate this whole process with a script (bash, Python, AppleScript, whatever) that lets me pass the first actual page number... something like fixpagination example.pdf 67. However, I cannot find any terminal-based program that can re-paginate PDFs. Neither pdftk nor PyPDF seem to be able to deal with pagination. Are there any scriptable programs that can internally re-paginate PDF files?

    Read the article

  • Are there tools available for trimming PDF margins?

    - by Charles Duffy
    I have an ebook I'm trying to read in PDF format on a Kindle. Unfortunately, the page headers and footers have some content (page number and copyright info, respectively) preventing the device from scaling the actual text to match its usable area viewing area, thus leaving the actual content too small to read. Various tools are available which will trim off whitespace, but the Kindle already does this; my goal, by contrast, is to remove printed matter outside of a defined bounding box, and the only tool I've found for the purpose is moderately expensive commercial software. I could probably generate a mask in Inkscape; split out the individual pages using pdftk, apply the mask to each page individually (outputting to postscript), and recombine the numerous postscript files into a single PDF. However, this decode/reencode steps would be pretty unfortunate in terms of document size; something able to operate with a bit more finesse would be ideal. I have all major operating systems handy (Windows, several modern Linux distros, a Mac, etc) so solutions don't need to be constrained by platform. Suggestions? (I've reported the issue to the author, who mentioned it to his editor, who hasn't done anything about the issue over the course of more than a month, making the zero-work approach evidently nonproductive).

    Read the article

  • Removing PDF attachments via itext

    - by r00fus
    I'm trying to remove attachments from a number of my pdf files (I can extract via pdftk, so preserving them is not an issue). I coded the following based on an example found from a google search: import java.io.FileOutputStream; import java.io.IOException; import com.lowagie.text.*; import com.lowagie.text.pdf.*; class pdfremoveattachment { public static void main(String[] args) throws IOException, DocumentException { if (args.length < 2) { System.out.println("Usage: java PDFremoveAttachments source.pdf target.pdf"); System.exit(1); } PdfReader sourcePDF = new PdfReader(args[0]); removeAttachments(sourcePDF); FileOutputStream targetFOS = new FileOutputStream(args[1]); PdfStamper targetPDF = new PdfStamper(sourcePDF,targetFOS); targetPDF.close(); } public static void removeAttachments(PdfReader reader) { PdfDictionary catalog = reader.getCatalog(); // System.out.println(catalog.getAsDict(PdfName.NAME)); // this would print "null" PdfDictionary names = (PdfDictionary)PdfReader.getPdfObject(catalog.get(PdfName.NAMES)); // System.out.println(names.toString()); //this returns NPE if( names != null) { PdfDictionary files = (PdfDictionary) PdfReader.getPdfObject(names.get(PdfName.FILEATTACHMENT)); if( files!= null ){ for( Object key : files.getKeys() ){ files.remove((PdfName)key); } files = (PdfDictionary) PdfReader.getPdfObject(names.get(PdfName.EMBEDDEDFILES)); } if( files!= null ){ for( Object key : files.getKeys() ){ files.remove((PdfName)key); } reader.removeUnusedObjects(); } } } } If anyone knows how I might be able to remove attachments, I'd greatly appreciate a reply.

    Read the article

1