Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

World cup college
Hide

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for:

Hide

News

2010-03-18 - Top 10 commands explained
There's a great article by Peteris Krumins explaining the current top 10 commands: http://www.catonmat.net/blog/top-ten-one-liners-from-commandlinefu-explained/
2010-03-03 - Commandlinefu @ SXSW 2010
Am going to be at SXSW this year, in case you want to submit any CLI nuggets or suggestions to me in person. Ping me on the @codeinthehole Twitter account.
2009-09-12 - Email updates now available
You can now enable email updates to let you know each time you're command is commented on.
2009-07-11 - API and javascript blog widget now available
A simple API has been released, allowing commands to be retrieved in various formats. This also allows commands to be embedded on blogs/homepages.
Hide

Tags

Hide

Functions

Remove embedded fonts from a pdf.

Terminal - Remove embedded fonts from a pdf.
gs -sDEVICE=pswrite -sOutputFile=- -q -dNOPAUSE With-Fonts.pdf -c quit | ps2pdf - > No-Fonts.pdf
2009-03-25 03:46:00
User: qubyte
Functions: gs
2
Remove embedded fonts from a pdf.

It's sometimes useful to strip the embedded fonts from a pdf, for importing into something like Inkscape. Be warned, this will increase the size of a pdf substantially.

I tried this with only gs writing with -sDEVICE=pdfwrite but it doesn't seem to work, so I just pipe postscript output to ps2pdf for the same effect.

Know a better way?

If you can do better, submit your command here.

What others think

On my ubuntu/debian system, there is a pdf2ps command (a script), which invokes gs in a similar manner. So you could possibly try this instead:

pdf2ps With-Fonts.pdf | ps2pdf - > No-Fonts.pdf

I'm somewhat of a novice at this stuff, but I think the "stripping" happens only because postscript *cannot* embed fonts. Usually I want to embed fonts for submission of papers in PDF.

Comment by bwoodacre 75 weeks and 1 day ago

I'm pretty sure postscript embeds fonts. If you look in a ps or eps file you can actually read bits, so like pdf the specification must include standard fonts.

I'm not entirely sure how mine works, although I do get the individual flags. I really just added the pipe. It's based on a one liner I saw a long time ago that spat out postscript from postscript.

Comment by qubyte 75 weeks and 1 day ago

I've looked through the manpage for gs 8.61 and can't see how the specified options are asking the postscript interpreter to discard font information. This just seems more like a side effect to me rather than deliberate program action.

Comment by bwoodacre 75 weeks ago

Yup. That's pretty much the conclusion that I came to. It could be that you need to add a flag to preserve fonts and that's what's going on. Either way, it's worked for me for years and I've found it very useful.

I should note (and sorry this is confusing!) that when I say `remove embeded fonts' what I really mean is turn all the letters into normal vector graphics. This way the file is composed without any reference to text. The obvious side effects are that text in the pdf becomes unselectable and the file size goes up. I do this because Inkscape seems to fall over when it has to handle pdf fonts, and this fixes it.

Comment by qubyte 75 weeks ago

I updated it to get rid of a couple of needless bits.

Comment by qubyte 75 weeks ago

Your point of view

You must be signed in to comment.

Related sites and podcasts