Robert Vojta http://www.robertvojta.com Highly irregular posts here only ;-) posterous.com Sun, 29 Jan 2012 12:25:52 -0800 Reduce PDF file size http://www.robertvojta.com/reduce-pdf-file-size http://www.robertvojta.com/reduce-pdf-file-size

Sometimes I work on documents where high resolution photos are used and when I create PDF files they are way too large. For example - 9 page document with several photos was saved to 310 MB PDF file. Do you wonder how to make it smaller without byuing additional applications? The answer is - ColorSync Utility.

1. Create custom Quartz filters

  • start ColorSync Utility and switch to Filters tab
  • click on + button (bottom left) to create and name your custom filter
  • click on the triangle button on the right side of your filter and select Add Image Effects Component - Image Compression and Add Image Effects Component - Color Image Sampling
  • Image Sampling allows you to change Scale, Resolution (DPI), Max/Min pixels and Quality
  • Image Compression allows you to change Mode and Quality

Personally I have 4 filters - 110, 150, 300 and 600 DPI. Image Compression Mode set to JPEG and Quality set to 95 % approximately.

BTW or use triangle to duplicate already existing filter.

2. How to apply Quartz filter

2.1. Preview application

Open PDF file in Preview application, select File - Export... and select appropriate filter in Quartz Filter field. As you can see custom filters are not there. To make them visible open Terminal application and run this command:

cp ~robertvojta/Library/Filters/* /Library/PDF\ Services/

You need to run this command as root and replace robertvojta with your user name.

2.2. ColorSync Utility

This is better solution if you do not want to fiddle with system filters. Right click on your PDF file in Finder and select Open With ... - ColorSync Utility.

Bottom bar contains Filter with combo box and Apply button. Select appropriate filter and click on the Apply button. Don't be affraid, original file isn't modified until you select File - Save.

Select File - Save As... and save your reduced PDF file.

3. Comparison

He are some rough results on one of my PDF files.

  • original file - 310 MB
  • applied 300 DPI filter with 95 % JPEG compression - 6.3 MB
  • applied 110 DPI filter with 95 % JPEG compression - 1.9 MB

4. Automation

Too complicated. There's much better way if your filters are ready.

  • create folder Reduce PDF - 300 DPI on your desktop
  • start Automator and create Folder Action
  • choose Reduce PDF - 300 DPI folder
  • drag Library - PDFs - Apply Quartz Filter to PDF Documents
  • decide if you want to modify original file or create a copy
  • select your filter, let's say it's named PDF - 300 DPI
  • select File - Save...

And that's all. Find some PDF file and drag & drop it to your desktop folder. Automator automatically applies your Quartz filter. Wait few seconds and you can find smaller PDF file in your desktop folder.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1512151/P1000350.jpg http://posterous.com/users/hgWhbTlHhsmBI Robert Vojta robertvojta Robert Vojta
Sat, 01 Oct 2011 09:32:00 -0700 B&W MM-1 Small & Quick Review http://www.robertvojta.com/bw-mm-1-small-quick-review http://www.robertvojta.com/bw-mm-1-small-quick-review

I wanted to replace my speakers with something new and much better. Was reading reviews, asking, ... and finally made a decission - B&W MM-1.

Is MM-1 price tag worth? Read ...

Pro

  • small, decent speakers with beautiful design, something I do expect from Apple when unpacking new gears,
  • music reproduction is really great and these speakers can fill your working space with music equally, really good, everything what I had so far sucks,
  • DAC is superb and you can bypass your builtin sound card via USB connection, simply try to connect your headphones to Mac sound output and then compare with headphones output on MM-1, not comparable,
  • USB, AC and left speaker connectors are placed at the bottom of the right speaker, pretty nice solution,
  • design rocks,
  • remote control does work perfectly, well designed and you can control volume, mute, next/previous song, play/pause and you can switch them off too,

Con

  • constant hiss, I'm sorry, but this is really annoying, I hear it even when my Mac Pro, UPS, ..., are running (and they're pretty loud) and this is not acceptable, you can hear it when you pause your music, nothing is playing, I have never heard this degree of noise,
  • right speaker temperature - top of this speaker is really hot, I read somewhere that they shutdown themselves when temperature is too high, didn't happen yet, but if this happens I'm going to return them, I want to listen to music,
  • AUX input and headphones output are at the back of the right speaker, so, you have to touch your polished speaker, turn it around, connect headphones and turn it back, actually it's not a big con, because of design rules, but ...,

... just one more note to already mentioned hiss. If you want to use them for music only and then you are going to switch them off, they're perfect. If you are going to use them as main speakers for everything, an example - AIM notifications without music playback - it's really annoying and I'm sure you'll throw them through window soon.

Verdict

Hard to judge after 24 hours. Okay, reproduction is superb at all volume levels. Yes, they can be pretty loud. But I can't stand the hiss. Sorry B&W, it's really loud. According to all forums, B&W did respond that it's normal. Hmm, when I hear it, something's wrong ...

How do I use them so far? For music only. If I'm not listening they are switched off and all notifications (AIM, Skype, ...) are routed via internal Mac Pro speaker. Awful, but much better than the hiss and it's enough to be notified about whatever.

Would I buy them again? So far yes. We'll see after few weeks. They rocks!

P.S. Also when you switch them off, B&W MM-1 disappears from Mac Sound Output devices, so, playback is automatically routed via previous device. When you do switch them on again, they appear in Sound Output devices and playback is again routed via B&W MM-1. Which is cool.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1512151/P1000350.jpg http://posterous.com/users/hgWhbTlHhsmBI Robert Vojta robertvojta Robert Vojta
Thu, 29 Sep 2011 10:02:00 -0700 sqlite3 integrity check before CoreData raises exception http://www.robertvojta.com/sqlite3-integrity-check-before-coredata-raise http://www.robertvojta.com/sqlite3-integrity-check-before-coredata-raise

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
+ (BOOL)checkIntegrity {
  NSString *databasePath = [self databaseFilePath];
  
  // File not exists = okay
  if ( ! [[NSFileManager defaultManager] fileExistsAtPath:databasePath] ) {
    return YES;
  }
  
  const char *filename = ( const char * )[databasePath cStringUsingEncoding:NSUTF8StringEncoding];
  sqlite3 *database = NULL;
  
  if ( sqlite3_open( filename, &database ) != SQLITE_OK ) {
    sqlite3_close( database );
    return NO;
  }

  BOOL integrityVerified = NO;
  sqlite3_stmt *integrity = NULL;
  
  if ( sqlite3_prepare_v2( database, "PRAGMA integrity_check;", -1, &integrity, NULL ) == SQLITE_OK ) {
    
    while ( sqlite3_step( integrity ) == SQLITE_ROW ) {
      const unsigned char *result = sqlite3_column_text( integrity, 0 );
      if ( result && strcmp( ( const char * )result, (const char *)"ok" ) == 0 ) {
        integrityVerified = YES;
        break;
      }
    }
    
    sqlite3_finalize( integrity );
  }
  
  sqlite3_close( database );
  
  return integrityVerified;
}

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1512151/P1000350.jpg http://posterous.com/users/hgWhbTlHhsmBI Robert Vojta robertvojta Robert Vojta
Tue, 27 Sep 2011 11:06:00 -0700 Hummer http://www.robertvojta.com/hummer http://www.robertvojta.com/hummer

I was thinking how did I come to my hobby = off road cars. And finally found it in my Aperture library! Hummer present ;-)

P1000350

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1512151/P1000350.jpg http://posterous.com/users/hgWhbTlHhsmBI Robert Vojta robertvojta Robert Vojta
Tue, 27 Sep 2011 00:40:00 -0700 UPS for Mac Pro http://www.robertvojta.com/ups-for-mac-pro http://www.robertvojta.com/ups-for-mac-pro

I was looking for some good UPS for my Mac Pro, because I was worried about my RAID array, data on it, etc. Tried to find some power consumption figures, but wasn’t able to find some real numbers. After some research, I gave a try to APC Smart-UPS 3000VA LCD 230V. Here are some numbers, so, you can get a clue what do you really need.

Power Consumption Figures

Following numbers were read from UPS LCD panel. 24” LCD Dell U2410 consumes about 80 W, 27” LCD Dell U2711 consumes about 90 W and finally Mac Pro consumes about 160 W.

It’s not enough to say Mac Pro, you also need to know what’s inside. Here’s the short list - Quad-Core Intel Xeon, 16 GB of RAM, 4x HDD, ATI Radeon HD 4870 and NVIDIA GeForce GT 120.

Power Outage

When I disconnect UPS from power, it says it can feed my Mac Pro and all accessories for almost 2 (yes, two) hours. Never tried it, but I assume it will be for 90 minutes. It’s nice and not expected.

Average UPS load is 11 %.

Mac OS X Integration

No need to worry. It’s enough to connect UPS via USB cable to your Mac and that’s all. Then you can visit System Preferences - Energy Saver and play with UPS settings.

Hope that helps to someone to make a right decision about UPS. This on is pretty solid and have lot of power.

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1512151/P1000350.jpg http://posterous.com/users/hgWhbTlHhsmBI Robert Vojta robertvojta Robert Vojta
Tue, 27 Sep 2011 00:37:00 -0700 AppCode http://www.robertvojta.com/appcode http://www.robertvojta.com/appcode
I’ve been developing for Mac OS X and iOS for a long time and I can’t say that I’m really happy with Xcode 4. It’s like ambivalent love. Sometimes I love it, sometimes I really hate it. I always do remember my experience with other IDEs from Borland, Microsoft, Eclipse Foundation, … and I tend to cry. I feel that Apple tries to add as many as possible features to make it more comfortable for nowadays developers and I’m not sure it’s a good direction.

But I’m quite happy now, because I found AppCode. It’s an Objective-C IDE, which is based on really great IDE named IntelliJ IDEA. And do you know what’s really great too? It’s Czech company. Okay, owned by two people from Russia, but who cares, me not.

It’s written in Java, but I don’t see a difference in speed. Sometimes it’s much more faster compared to Xcode with beach ball.

No final verdict yet, but I like it very much. I feel I do use real IDE where I have more control. Try it yourself and you’ll see. It’s currently in Beta stage and you can also subscribe for 50 % discount to get it for less than 45 € later.

P.S. I look forward for how long they survive, because I never thought it has sense to develop something like AppCode. Good luck guys, I’ll buy one license for sure.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1512151/P1000350.jpg http://posterous.com/users/hgWhbTlHhsmBI Robert Vojta robertvojta Robert Vojta