Tuesday, October 28, 2014

pdftk in Mac OS X with tips

Download pdftk for Mac.

tips:

1. Split multi-page PDFs into single page PDFs
$ pdftk my_multi_page.pdf burst
$ pdftk my_multi_page.pdf burst output my_directory/page_%02d.pdf

2. Pull some pages out of a PDF but keep the rest
$ pdftk my.pdf cat 1-5 13-21 24-end output my_edited.pdf

3. Concatenate (that’s join!) multiple pdfs into one big pdf
$ pdftk part0.pdf part1.pdf cat output the_whole_book.pdf

4. Get all of the images and other attachments out of a PDF and put them in a folder
$ pdftk my.pdf unpack_files output ~/attachments_from_my_pdf/

5. Print stats and metadata about a PDF
$ pdftk my.pdf dump_data

6. Add a background watermark (or a foreground overlay) to a pdf

- For a background
$ pdftk my.pdf background bg.pdf output my_watermarked.pdf

- For an overlay
$ pdftk my.pdf stamp overlay.pdf output my_overlayed.pdf
Read more ...

Wednesday, October 22, 2014

Copy file or folder path to the clipboard in Mac OS X

Link.


  1. Launch Automator
  2. Double-click the Service icon
  3. Toward the top of the right column, you’ll see this line of text: “Service receives selected _____ in _____”. Choose “Files or Folders” from the first menu and “Finder” from the second.
  4. Click on Utilities in the Actions library on the left side. Double-click “Copy to Clipboard” in the middle column.
  5. Go to File > Save in the menu bar and name your service Copy File Path.
  6. Launch System Preferences and go to the Keyboard pane. Click on the Keyboard Shortcuts tab.
  7. Select “Application Shortcuts” from the list on the left. Next, click on the + button at the bottom of the list.
  8. A small window will come up with a few options that need to be set. Select “Finder” from the Application menu, type Copy File Path as the Menu Title, and create your own Keyboard Shortcut. If you don’t know what to put here, you can just press Shift+Command+C on your keyboard. Click Add and we’re done!


If you’re not keen on keyboard shortcuts, the service you created is also accessible when you right-click on an item in Finder and select Services > Copy File Path from the contextual menu. The actual file we created for this service is located in: ~/Library/Services in case you ever want to delete it or copy it to put on another Mac.
Read more ...

Tuesday, October 14, 2014

Terminal command to check used memory in OS X

top -l 1 | head -n 10 | grep PhysMem
Read more ...