Sunday, November 13, 2011

PDF play

Last few months, I have been scanning a lot of documents. Also converting word to pdf, merging pdf files, splitting them etc. In this process, I have found few good programs for this task.

I have an HP Deskjet F4288 All-in-One scanner-printer-copier at home. If you scan a document, by default, it starts an HP utility for managing the scan, which is buggy, big-time and tedious to use too. So, began my search for the ultimate tool. Enter Softi Scan to PDF. Though it is a 30-day trial, if you uninstall it and install again, it restarts the 30 day trial..;)..so gr8. This app has a simple scan button. It has settings where you can select the scan document size, the compression ratio that is needed. This helps when you want the scanned pdf file size to be very small and the quality of scan does not bother you..esp. when upload sites limit the file size. If it is a multi-file pdf, just keep pressing "scan" after each document and it keeps appending the pages and when you are done with all pages, click on "Save PDF". Simple.

Some of my documents to be scanned were of the A3 size and could not be scanned at home since my scanner supports A4 only. Got it scanned from a print/xerox shop and the size of the files that he created were enormous. 16MB for 10 pages. I tried opening the file and printing it again using CutePDF. I thought it will compress the file in the process. No change. Then, me and google started another search and we found "Bullzip PDF". Excellent utility. Similar to CutePDF. But with this, when I tried printing the 16MB file to PDF again, it reduced the size to 5MB. That was great compression and without any visible loss of quality. Now it has also replaced CutePDF as my word-to-PDF converter. I fondly call it "Bull#$%@ PDF"..hehe.

I had all my documents separately scanned and converted to pdf. Now came the requirement of merging/splitting different PDF files together/apart as per requirement. Again...google to the rescue with freely available "PDFSAM (PDF split and merge)". Though it calls itself "Split and merge", it does much more. The feature I love the most is "Visual reorder". You can see the thumbnail view of all pages within a document, delete certain pages if you wish, rotate specific pages, change the order of pages according to their importance and after you are done, just save it as another PDF file.

Let me know if you have heard of any good ones.....

Sunday, November 6, 2011

Changing Grub Splash screen in Debian 6.0.3

Recently changed my MTNL plan from the Rs. 748 plan (2 Mbps, 5GB download limit) to the newly introduced Happy Hours plan Unlimited 666 (Rs. 666 service charges, 320 kbps during the day and 1 Mbps after 8 pm, unlimited download). This after receiving a hefty bill of Rs. 4500 last month accompanied by a severe dressing down from mom and dad. We concluded after an experiment that Skype was the culprit. Anyways, this brought good along. I am now free to download any file size and have already downloaded and installed the latest Ubuntu 11.10 and Debian 6.0.3 (Squeeze) in the last few days.

So coming back to the topic, I was always curious about changing the boring splash screen that we get at startup. I knew it was and is easy. But just wanted to tick another point in my "to-do" list.

First of all, where does Debian store all the pre-login wallpapers? The location is 

/usr/share/images/desktop-base/       (was actually trying to TAB my way while typing this...:D)

All the grub configuration gets stored in the grub.cfg file. The exact location is 

/boot/grub/grub.cfg

This is an auto generated config file that uses the templates from the /etc/grub.d and settings from /etc/default/grubWhen you want to change the timeout of the splash screen or the default boot selection of the OS list, the /etc/default/grub is the file to use. It has variables defined as GRUB_DEFAULT and GRUB_TIMEOUT for the same. Root privileges are required for these changes and also for the steps that follow. The 05_debian_theme file in /etc/grub.d is the brain behind deciding the grub background that goes into the grub.cfg file. Now after studying the 05_debian_theme file, I have found there are 3 ways of setting the desktop background:


1. Simplest: Just copy the required image into the /boot/grub/ folder and run "update-grub". Done. This method has second priority.


2. Define a variable GRUB_BACKGROUND in the /etc/default/grub file and provide the path of the image as its value.


GRUB_BACKGROUND = /usr/share/images/desktop-base/james_bond.jpg


(Yes, I have Daniel Craig as my splash screen..:D)

Save and exit. Then run "update-grub".


This method is given the highest priority. So if you have defined the one image as a variable and also pasted another image in the /boot/grub/ folder, the variable value will be considered.


3. The next method is using another file grub_background.sh. This method has third priority. In the file /usr/share/desktop-base/grub_background.sh, just define the variable WALLPAPER as the path of the image.

WALLPAPER = /usr/share/images/desktop-base/james_bond.jpg

Save and exit. Then run "update-grub".


If the 05_debian_theme file finds none of the above images or defined variables, it will load the default desktop background "desktop-grub.png". If it does not find the desktop-grub.png file too, it will load the default theme, which is just a black background and a blue foreground for the text.

After any change in the grub configuration, the command "update-grub" is necessary. While this command runs, it shows that it has accepted the background image. This command actually generates the updated grub.cfg file (auto-generated, as I have mentioned before) which is used during the booting process. You can check the updated file for confirmation.

Now just give the "poweroff" command and reboot again (Prior to power off, save any other open files). Noted one more thing, this release behaves differently on the "reboot" command. When you say "reboot", it actually assumes that you will be back into Debian and so you do not even see the OS selection grub menu and boot directly into Debian. Hence, I mentioned using the "poweroff" command.

So, there you go, my PC is now dressed to kill...even before the OS boots..:D