Wednesday, March 28, 2012

Optimizing pdf files for Kindle and Smartphone

If you have ebook reader like Amazon Kindle, Sony PRC or other (even for smartphone), sometimes it is confusing to read the paper, novel, or ebooks in those kinds of ebook reader. The better way is to convert the pdf files into kindle display size using k2opt given in the following link,
www.willus.com/k2pdfopt
How to use the command prompt. First, follow the instructions in that link how to install the program, then you can use the following command in Ubuntu and other Linux-based OS distribution,
k2pdfopt inputfile.pdf
For other option, you can choose after that command.
Here a sample of page conversion using k2pdfopt

Sample of conversion result using k2pdfopt (source: https://www.makeuseof.com/tag/how-to-optimize-pdf-for-kindle/)

Very high ratio and fast pdf files compression

One day, I send some scanned files in pdf format by email. Due to the large size of those files, the attached files cannot be received in the email sent. This problem disturbed me as I take multidimensional processing course and one of the chapters in the course is about image processing and file compression. After short time searching, I found the very high ratio and fast pdf files compressing from Ubuntu forum.
Here is the code:
  #!/bin/bash

DPI=150
PDF_DESTINATION=""

help() {
echo "optimize_pdf help"
echo "-h : show this help"
echo "-d : (optional) output pdf document resolution, by default : 150"
echo "-s : pdf source file, this file must exist"
echo "-o : pdf output file"
}



full_path() {
if [ -z $1 ]; then
exit;
else
if [ `expr substr ${1:-a} 1 2` != "/" ]; then
FULL_FILE=`pwd`"/"$1
fi
fi
echo $FULL_FILE
}

isNumeric(){ echo "$@" | grep -q -v "[^0-9]" ;}

while getopts "s:o:d:h" flag
do
case $flag in
#Source : source file
"s")
PDF_FILE=`full_path $OPTARG`
if [ ! -e $PDF_FILE ]; then
echo "Please provide a valid source file"
exit=1
fi
;;
#Output : output file
"o")
PDF_DESTINATION=$OPTARG
;;
#Dpi : desired resolution
"d")
if [ -z `isNumeric $OPTARG` ]; then
DPI=$OPTARG
else
echo "Please provide a numeric value for your DPI"
exit=1
fi
;;
"h")
exit=1
;;
esac
done

#Is there a target file?
if [ -z $PDF_DESTINATION ]; then
echo "Please provide a file name for output"
exit=1
fi

#At least one error, we're not going any further
if [ $exit ]; then
help
exit
fi

pdftops \
-paper match \
-nocrop \
-noshrink \
-nocenter \
-level3 \
-q \
"$PDF_FILE" - \
| ps2pdf14 \
-dEmbedAllFonts=true \
-dUseFlateCompression=true \
-dOptimize=true \
-dProcessColorModel=/DeviceRGB \
-dUseCIEColor=true \
-r72 \
-dDownsampleGrayImages=true \
-dGrayImageResolution=$DPI \
-dAutoFilterGrayImages=false \
-dGrayImageDownsampleType=/Bicubic \
-dDownsampleMonoImages=true \
-dMonoImageResolution=$DPI \
-dMonoImageDownsampleType=/Bicubic \
-dDownsampleColorImages=true \
-dColorImageResolution=$DPI \
-dAutoFilterColorImages=false \
-dColorImageDownsampleType=/Bicubic \
-dPDFSETTINGS=/prepress \
- "$PDF_DESTINATION"

  
Let's copy that code in /usr/local/bin and save as optimized_pdf.sh or another name. Then try to compress pdf file like in the following,
optimized_pdf.sh -s input_file.pdf -o output_file.pdf
 where input_file.pdf is your current file to be compressed (signed by -s) and output_file.pdf is the new compressed pdf files. When I use this command, I got 300 Kb from 3000 Kb of pdf file size (1/10 of compression ration). That's work for me!

*) Please note, that is not my code, but I got it from Ubuntuforum.org

Tuesday, March 27, 2012

Gifu Masjid (Bab al-Islam Masjid)


Bab al-islam Gifu Masjid & The Muslim Culture Center are located in Gifu-city, near by Gifu University. Established by Nagoya Mosque Construction started on October 25, 2007 & be completed on June 30, 2008. The first mosque in Gifu prefecture Near to Gifu University, so convenient to Muslim students A center of knowledge about Islam in a non Muslim Society. An unity among Muslim ummah. 

Address: Furuichiba Higashimachida 8, Gifu-ken Gifu-shi
               (岐阜県岐阜市古市場東町田8番)
Gifu Masjid, Gifu-shi, Gifu-Ken, Japan

Monday, March 26, 2012

Kasugai Masjid (Kasugai Islamic Centre)

The third masjid I visited in Japan is Kasugai Masjid, or Kasugai Islamic Center. Kasugai masjid is located in Kasugai City, Aichi Prefecture, Japan. The detailed address is below,

English address: 

Aichi-Prefecture 1382 Kagiyacho Kasugai shi (Postal Code:480-0304)
Japanese address: 〒480-0304愛知県春日井市神屋町1382


This Masjid is our base camp during "Kumamoto Masjid Project Campaign" in Nagoya. Totally, we visits six Masjids around Nagoya city, and this masjid is one of the beautiful places.

The following is some pictures of this Masjid. Please visits this Masjid if you have time in Aichi Ken or Nagoya-shi.


Interior of Kasugai Masjid

Monday, March 19, 2012

Butterfly Effect: Busway JKT Vs Subway Japan

Sebuah pagi yang cerah di medio Maret 2012, di Nagoya Station (stasiun Subway) terlihat orang-orang berjubel menunggu kedatangan kereta yang akan membawa mereka ke tempat kerja masing-masing. Tak berapa lama, sebuah kereta datang, puluhan bahkan ratusan orang berhamburan keluar kereta yang dibalas pula dengan ratusan orang lainnya berhamburan masuk ke dalam kereta tersebut.
Subway di Nagoya


Dalam benak saya, kejadian ini hampir mirip seperti orang-orang di Jakarta yang sedang menunggu Busway pada saat office hour. Ramai, tergesa, dan berdesakan. Namun, ada yang berbeda.


Busway Jakarta

Friday, March 16, 2012

Dar Al-Arqam (Asakusa) Mosque, Central Tokyo, Japan


While in Asakusa Kanno Temple (Sensou-ji), in the left you'll see the famous Tokyo sky tree, and on the right, the red temple was seen handsomely. That's Asakuksa, one of the famous place in Tokyo, Japan. But, where is the mosque?

This is second Masjid I visited in Japan namely Darul Arqam or Dar Al-Arqam Masjid. Dar Al-Arqam Masjid, located in central Tokyo was established in 1998. The four story building has a library on its ground floor which has a variety of books in various languages. 

Major activities of the Dar al Arqam Masjid are :
  • Five times Salat , salatul Jumma, Salatul Taraweeh 
  • Performing Nikkah (marriage) 
  • Library 
  • Shahdah & issuance of Shahada certificate 
  • Quran classes for children & Adults 
  • Janazah & Gussl of Mayyah (Gusul of dead bodies)
Information regarding Dar Al-Arqam Masque (Masjid)

Location:
111-0025,Tokyo, Taito-ku, 1-9-12 Higashi Asakusa.
Tel: 81-3-3871-6061 Fax: 81-3-3871-6062

Contact:
Br. Ehsan (in 2011)
Mobile : 090-7256-3528

Nearest Metro Stations:
  1. Minami Senju ....Hibya line. & Jr Joban line ..13 minutes walk or 6 minutes by bus 
  2. Asakusa ….Ginza line….13 minutes walk or 5 minutes by bus
Lihat postingan ini di Instagram

#asakusa #mosque #masjid #tokyo

Sebuah kiriman dibagikan oleh Bagus Tris Atmaja (@bagustris) pada


Related Posts Plugin for WordPress, Blogger...