Application Directory
From nookDevs
Some of these apps may require a MicroSDHC or VNC installed to function correctly.
Want to submit your own applications? Look into it on the Submitting applications page.
Information about installing and running apps can be found on the Apps Page
Contents |
System
Title | Description | Author | Current Version | Special Requirement |
---|---|---|---|---|
Busybox | nook-specific busybox. | nookDevs/Busybox team | ||
Scripting | Android scripting for nook. | User:Matthewfl | ||
NookLibrary | App to browse, sort & search local books. | 0.1.6 | ||
Nook WiFi Locker | Simple app to lock the wifi. | 0.0.4 | ||
NookTaskManager | Task Manager for the nook | poutine/BenB | 0.0.3 | |
Nooklets | Platform for HTML/Javascript Apps | rev 3 | ||
Nook File Manager | App to browse the filesystem | 0.0.5 | ||
Nook Application Manager | Launch and uninstall applications. | Bo | ||
NookMarket | App to browse,install/uninstall apps. | User:Hari | 0.0.3 | |
Dropbear | Dropbear is a relatively small SSH 2 server and client. | Tercel | 1.0 |
|
Media player
Title | Description | Author | Current Version | Special Requirement |
---|---|---|---|---|
Pandora | Pandora... for the nook | Pandora | VNC | |
nookMedia | Media Player for the nook | craftycoder |
Reader
Title | Description | Author | Current Version | Special Requirement |
---|---|---|---|---|
FBReaderJ | FBReaderJ for Nook (support fb2 books) | FBReaderJ | Modified (nooklibrary-fb2) | |
APDFViewer | Alternate PDF viewer with zoom & landscape mode options. | Hari | 0.0.3 | |
gReader | Google Reader app for the nook | Zastrowm | 1.0 beta | List |
NookTxtReader | A txt e-book viewer | Tercel | 1.8 |
Internet
Title | Description | Author | Current Version | Special Requirement |
---|---|---|---|---|
nookBrowser | a webbrowser made for the nook! | hari_ | 0.0.9 | |
Trook | Download books from Stanza catalogs or OPDS content and general feed reader | rev 68 | ||
Twook | Post on Twitter and read the public timeline, home timeline and replies. | unchiujar,dpw13 | rev 0.0.8 | |
antivirus | Antivirus for nook eReaders, scans for apps , media , ebooks , content and systems, protect from Malware , bad files and viruses, send feedbacks to [] | droidSecurity | Beta 2.2 |
Launchers
Title | Description | Author | Current Version | Special Requirement |
---|---|---|---|---|
nooklauncher | nook optimized Android Launcher | , , | 0.1.0 | |
mynook.ru Launcher | mynook.ru Launcher with excelent icons | Korshakov Stepan (aka Ex3NDR), Sasha Nilov | 1.5.3 |
Miscellaneous
Title | Description | Author | Current Version | Special Requirement |
---|---|---|---|---|
nookNotes | A simple note-taking application. | Marco (curio) | 0.7.2 | |
nookFlashcards | An application for downloading and viewing flashcards | Alex (alex86450) | [1] | |
FileSelector | File Selector utility. Used by Crossword app to select puzzles to open. Can be used in other apps as well. | Hari, Kevin | 1.0 | |
NookSee | A simple image browser for nook. | Kelvin | 1.5 | |
NookZhuyingIME | A chinese input method for nook. | Kelvin | 1.0 |
Nooklets
Title | Description | Author | Current Version | Special Requirement |
---|---|---|---|---|
Hangman | The classical hangman game made exclusively for the nook. | User:Atomix | 0.5.4 | |
Currency converter | A simple currency converter tool, supports multi-conversion. | User:Atomix | 0.3 | |
Timer | A simple countdown timer that plays one of three mp3 files when finished. | User:NoahY | 0.1 |
Games
Title | Description | Author | Current Version | Special Requirement |
---|---|---|---|---|
nookCrossword | Crossword player for nook | Kevin, Hari | 0.0.1 | FileSelector |
nookMines | nookMines game | Kevin.vajk | 0.1 | |
nookZax |
nooZax is an Android implementation of the Zax Z-Machine interpreter optimized for the nook hardware.
nookZax can be used to play Z-Machine compatible interactive fiction games, e.g., the stories created by Infocom (Zork, Enchanter, etc.), or any (or at least most) stories created by the Inform compiler. |
William Johnson | FileSelector |
PC Apps
Command-line transfer of files onto the NOOK
Forgive me if this is not the right page for stuff like this. nookdevs has been a great resource for me, and would like to give my contribution in appreciation.
Not sure if this is useful... but I like to push content on to my nook from the PC without bothering with usb cords. I have created some bash code for the personal computer that will do this. Simply copy and paste it into a file. Name it and give the correct permissions and away you go. There is some configurations but that is all explained. Simply call the script and specify the files on the argument list, and all should be pushed onto the nook.
The script has the following requirements on the PC/Network
1) The PC has the android SDK installed
2) The PC must have a BASH shell running (linux, Mac, and Windows with cygwin)
3) The PC and Nook are in the same network subnet (ie same Local Area Network), not sure if adb works over NAT (routers) never really tried but I don't recommend it. I doubt the android sdk was meant for remote development.
The script has requirements on the Nook
1) Nook is turned on
2) Nook is connected to the wireless router
3) Nook has adb up and running (its been rooted)
Example of typical usage:
user:~>file_1 file_2 /path/to/file_3 connected to 192.168.0.102:5555 375 KB/s (62242 bytes in 0.161s) 475 KB/s (42242 bytes in 0.061s) 275 KB/s (82242 bytes in 0.261s) user:~>
Configuration notes
1) I assume you have all hacked your nook and have adb installed on your personal computer. You will need to specify the path to that in the script (see comments in the script on where to do that)
2) Make sure you edit in the IP address of your nook. Unless you like editing text files, it is a good idea to assign the nook a static IP in the DHCP server. This way the nook will always have the same IP and this script will always work.
The script:
#! /bin/bash # Add the path to the adb tool in the quotations ADB="/path/to/adb" # this is where the content is placed, it is the equivalent of the my documents folder # the expansion card is simply "/sdcard/" NOOK_HOME="/system/media/sdcard/my documents/" # INSERT NOOK IP in the quotations below # Assigning nook a static IP on the DHCP table is needed # to avoid constant updating of this file every time the IP changes NOOK_IP="IP ADDRESS ie 192.168.0.100" # Try to connect to the device $ADB connect $NOOK_IP # tests to see if we are connected if [ "$?" -ne "0" ] ; then exit ; fi # Adds each file specified on the command line for i in "$@" ; do # Note that the path name is stripped from the arguments, # so any sub folders will not be copied, it will all be placed at top level $ADB push $i "$NOOK_HOME${i##*/}" ; done # disconnect from the device $ADB disconnect
Some notes:
The script doesn't always work first time. It is usually problems with connecting to the device. Just try it multiple times. Ocasionally starting and stopping adb on the nook was required. Then in extreme events it requires reseting the nook wireless connection by forcing a reconnect on the nook and/or restarting the router itself.
The script is meant for any POSIX environment (ie Linux, MAC, etc.). Windows users you will have to run cygwin or something similar to use this script. Sorry, but I am a Linux man.
- that's not really useful to me personally, but to add to requirements - adb needs to be running over wifi. As of late 2.4.x softroot that's disabled by default. There's samba server ported to android (i dont have url but it comes up on top in google). I think it would be more beneficial to get that running on nook. I would move it to your Talk page. --Spec 08:23, 6 December 2010 (PST)
Automatically convert scanned images into a Nook Optimized PDF
This is an application created by pilotmm. Apologies, but didn't go through the trouble of uploading the source onto a repository. Truth is I do not know how to use repositories or creating application pages. However I figured it would be better to share a useful application in a messy way than to keep it all to myself.
This is a program for those that want to digitize their books and print-outs for reading on the nook. After scanning and possibly some cropping you should have a bunch of images like 1.jpg, 2.jpg etc. When one executes this program inside the directory, it will seek out all the images with the names 1.jpg 2.jpg etc. to create the document. The pdf document is optimized for Nook viewing, this means that the pdf pages are sized to the recommended dimensions for pdf viewing on the nook, furthermore the images are scaled to the resolution of the nook screen, finally there are no margins. This means that the document will use maximum space on the nook screen, and be displayed with minimal distortion.
The program has a couple requirements. These requirements are not needed at compile time, thus one can compile then pass the --help argument to learn how to use it and the requirements.
Installation calls for copying the following source code and compiling. There are three files, the first is "jpg2nook.cpp" and the source code is:
#include#include
#include #include #include #include #include #include #include #include #include using namespace std; // geometric constants const double pageW=3.54; const double pageH=4.80; const unsigned long imageW=600; const unsigned long imageH=800; // file name constants const char* latexBase="jpg2nook_latex"; const char* latexFile="jpg2nook_latex.tex"; const char* latexPdf="jpg2nook_latex.pdf"; const char* deleteFilter="jpg2nook_"; const char* defExtension=".pdf"; class command; class imageFile; // algorithm variables const char* title="Untitled"; const char* author="Unknown"; const char* name="untitled.pdf"; double width=pageW; double height=pageH; unsigned long iW=imageW; unsigned long iH=imageH; bool keepAspect=true; list preComms; list postComms; list imageList; #include "jpg2nook_helper.h" int main(int argc,char** argv) { int retVal=0; fstream latexOut; try { // process the arguments if(!processArgs(argc,argv)) throw 1; // open/create the latex source file latexOut.open(latexFile,fstream::out); if(!latexOut.is_open()) { cout << "Failed to open " << latexFile << endl; throw 1; } // Print the tex header printHeader(latexOut,width,height,title,author); // Load in all the images getImages(); // Loop through for each image name for(list ::iterator it=imageList.begin();it!=imageList.end();it++) { // create a temporary copy cp((*it).original(),(*it).custom()); // apply pre-processing commands for(list ::iterator itComm=preComms.begin();itComm!=preComms.end();itComm++) { (*itComm).exec((*it).custom()); } // resize resize((*it).custom(),iW,iH); // apply post-processing commands for(list ::iterator itComm=postComms.begin();itComm!=postComms.end();itComm++) { (*itComm).exec((*it).custom()); } // convert to pdf convert((*it).custom(),(*it).pdf()); // print the image into tex document printImage(latexOut,(*it).pdf()); } // write the tex footer printFooter(latexOut); // compile the pdf pdflatex(latexBase,6); // move the pdf to the correct places char lastName[256]; mv(latexPdf,appendExtension(name,defExtension,lastName)); } catch(int e) { retVal=e; cout << "An error has occured, exiting" << endl; } // delete all the extra files that were created clean(); latexOut.close(); latexOut.clear(); return 0; }
The next is "jpg2nook_helper.h" the source is given below:
// for writing the latex file void printHeader(ostream &out,double page_width,double page_height,const char* doc_title,const char* doc_author); void printImage(ostream &out, const char* imageName); void printFooter(ostream &out); // for the processing commands class command { private: listwordList; public: command(); command(const command& asg); command(int argc,const char** argv,int &atArg); command& operator=(const command& asg); void load(int argc,const char** argv,int &atArg); int exec(const char* fn) const ; }; // Misc help functions bool isStringSame(const char* strA,const char* strB); template void switchVariable(T &A,T &B); void cp(const char* from,const char* to); void mv(const char* from,const char* to); void rm(const char* file); void convert(const char* from,const char* to); void pdflatex(const char* file,unsigned long n=1); bool isArtifact(const char* fn); const char* appendExtension(const char* name,const char* ext,char* buffer); bool processArgs(int argc,char** argv); class imageFile { private: static unsigned long iNum; char origName[256]; char custName[256]; char pdfName[256]; char baseName[256]; void set(unsigned long num); public: imageFile(); imageFile(unsigned long i); imageFile(const imageFile &asg); imageFile& operator=(const imageFile &asg); const char* original() const ; const char* custom() const ; const char* pdf() const ; const char* base() const ; }; void readDirectory(list &files); void getImages(); void resize(const char* fn,unsigned long imW, unsigned long imH); void clean(); #include "jpg2nook_helper.cpp"
Finally the last source file is "jpg2nook_helper.cpp"
void printHeader(ostream &out,double page_width,double page_height,const char* doc_title,const char* doc_author) { out << "" << endl; out << "\\documentclass[10pt]{article}" << endl; out << "\\pagestyle{empty}" << endl; out << "\\usepackage{graphicx}" << endl; out << "\\usepackage{amsmath}" << endl; out << "\\usepackage{amssymb}" << endl; out << "\\usepackage{subfig}" << endl; out << "\\usepackage{rotating}" << endl; out << "\\usepackage{listings}" << endl; out << "\t\\lstset{language=C++,numbers=left,frame=single,xleftmargin=1cm,breaklines=true,basicstyle=\\scriptsize}" << endl; out << "% \\usepackage{amsthm}" << endl; out << "\\usepackage{array}" << endl; out << "\t\\setlength{\\extrarowheight}{0.2cm}" << endl; out << "\\usepackage{xy}" << endl; out << "\\usepackage{natbib}" << endl; out << "\\bibliographystyle{asmems4}" << endl; out << "\\usepackage[top=-1in,bottom=0in,left=-1in,right=0in,paperwidth=" << page_width << "in,paperheight=" << page_height << "in]{geometry}" << endl; out << "" << endl; out << "" << endl; out << "\\DeclareMathAlphabet{\\mathpzc}{OT1}{pzc}{m}{it}" << endl; out << "" << endl; out << "\\pdfpagewidth " << page_width << "in" << endl; out << "\\pdfpageheight " << page_height << "in" << endl; out << "\\headheight 0.0in" << endl; out << "\\headsep 0in" << endl; out << "\\textwidth " << page_width << "in" << endl; out << "\\textheight " << page_height << "in" << endl; out << "\\topmargin -1.0in" << endl; out << "\\oddsidemargin -1.0in" << endl; out << "\\evensidemargin 0in" << endl; out << "" << endl; out << "% Title Page" << endl; out << "\\title{" << doc_title << "}" << endl; out << "" << endl; out << "\\author{" << doc_author << "}" << endl; out << "" << endl; out << "\\clubpenalty=100000" << endl; out << "\\widowpenalty=100000" << endl; out << "" << endl; out << "\\begin{document}" << endl; out << "" << endl; out << "\\maketitle" << endl; out << "" << endl; } void printImage(ostream &out, const char* imageName) { out << "" << endl; out << "\\begin{figure}[htbp]" << endl; out << "\\includegraphics[width=\\textwidth,height=\\textheight,keepaspectratio]{" << imageName << "}" << endl; out << "\\end{figure}" << endl; out << "" << endl; out << "\\clearpage" << endl; out << "" << endl; } void printFooter(ostream &out) { out << "" << endl; out << "\\end{document}" << endl; out << "" << endl; } command::command() : wordList(list()) {} command::command(const command& asg) : wordList(asg.wordList) {} command::command(int argc,const char** argv,int &atArg) : wordList(list ()) { this->load(argc,argv,atArg); } command& command::operator=(const command& asg) { this->wordList=asg.wordList; return *this; } void command::load(int argc,const char** argv,int &atArg) { bool loop=true; while(loop) { if(atArg>=argc || atArg<0) { cout << "Unexpectedly beyonde the range of arguments in loading command, give a '\\;' at the end of the list" << endl; throw 1; } if((argv[atArg])[0]==';') loop=false; else wordList.push_back(argv[atArg]); atArg++; } } int command::exec(const char* fn) const { char comStr[2048]; unsigned int at=0; for(list ::const_iterator it=wordList.begin();it!=wordList.end();it++) { if((*it)[0]=='{' && (*it)[1]=='}' && (*it)[2]==0) { unsigned long atChar=0; while(fn[atChar]!=0) comStr[at++]=fn[atChar++]; } else { unsigned long atChar=0; while((*it)[atChar]!=0) comStr[at++]=(*it)[atChar++]; } comStr[at++]=' '; } comStr[at++]=0; return system(comStr); } bool isStringSame(const char* strA,const char* strB) { unsigned long i=0; while(strA[i]!=0 && strB[i]!=0) { if(strA[i]!=strB[i]) return false; i++; } return (strA[i]==strB[i]); } template void switchVariable(T &A,T &B) { T tmp; tmp=A; A=B; B=tmp; } void cp(const char* from,const char* to) { unsigned long atComm=0; unsigned long at; char commStr[2048]; commStr[atComm++]='c'; commStr[atComm++]='p'; commStr[atComm++]=' '; at=0; while(from[at]!=0) commStr[atComm++]=from[at++]; commStr[atComm++]=' '; at=0; while(to[at]!=0) commStr[atComm++]=to[at++]; commStr[atComm]=0; system(commStr); } void mv(const char* from,const char* to) { unsigned long atComm=0; unsigned long at; char commStr[2048]; commStr[atComm++]='m'; commStr[atComm++]='v'; commStr[atComm++]=' '; at=0; while(from[at]!=0) commStr[atComm++]=from[at++]; commStr[atComm++]=' '; at=0; while(to[at]!=0) commStr[atComm++]=to[at++]; commStr[atComm]=0; system(commStr); } void rm(const char* file) { unsigned long atComm=0; unsigned long at; char commStr[2048]; commStr[atComm++]='r'; commStr[atComm++]='m'; commStr[atComm++]=' '; at=0; while(file[at]!=0) commStr[atComm++]=file[at++]; commStr[atComm]=0; system(commStr); } void convert(const char* from,const char* to) { unsigned long atComm=0; unsigned long at; char commStr[2048]; commStr[atComm++]='c'; commStr[atComm++]='o'; commStr[atComm++]='n'; commStr[atComm++]='v'; commStr[atComm++]='e'; commStr[atComm++]='r'; commStr[atComm++]='t'; commStr[atComm++]=' '; at=0; while(from[at]!=0) commStr[atComm++]=from[at++]; commStr[atComm++]=' '; at=0; while(to[at]!=0) commStr[atComm++]=to[at++]; commStr[atComm]=0; system(commStr); } void pdflatex(const char* file,unsigned long n) { unsigned long atComm=0; unsigned long at; char commStr[2048]; // commStr[atComm++]='o'; // commStr[atComm++]='p'; // commStr[atComm++]='e'; // commStr[atComm++]='n'; // commStr[atComm++]='o'; // commStr[atComm++]='u'; // commStr[atComm++]='t'; // commStr[atComm++]='_'; // commStr[atComm++]='a'; // commStr[atComm++]='n'; // commStr[atComm++]='y'; // commStr[atComm++]='='; // commStr[atComm++]='a'; // commStr[atComm++]=' '; commStr[atComm++]='p'; commStr[atComm++]='d'; commStr[atComm++]='f'; commStr[atComm++]='l'; commStr[atComm++]='a'; commStr[atComm++]='t'; commStr[atComm++]='e'; commStr[atComm++]='x'; commStr[atComm++]=' '; at=0; while(file[at]!=0) commStr[atComm++]=file[at++]; commStr[atComm]=0; for(unsigned long i=0;i =argc) break; } // -S nookSideways if(isStringSame(argv[atArg],"-S")) { atArg++; double scl=height/width; width=scl*width; height=scl*height; iW=scl*iW; iH=scl*iH; valid=true; if(atArg>=argc) break; } // -2 double size if(isStringSame(argv[atArg],"-2")) { atArg++; double scl=2; width=scl*width; height=scl*height; iW=scl*iW; iH=scl*iH; valid=true; if(atArg>=argc) break; } // -pre preprocessor command if(isStringSame(argv[atArg],"-pre")) { atArg++; preComms.push_back(command(argc,const_cast (argv),atArg)); valid=true; if(atArg>=argc) break; } // -post postprocessor command if(isStringSame(argv[atArg],"-post")) { atArg++; postComms.push_back(command(argc,const_cast (argv),atArg)); valid=true; if(atArg>=argc) break; } // -W doc width if(isStringSame(argv[atArg],"-W")) { atArg++; double wArg=atof(argv[atArg++]); double scl=wArg/width; width=scl*width; iW=scl*iW; if(keepAspect) { height=scl*height; iH=scl*iH; keepAspect=false; } valid=true; if(atArg>=argc) break; } // -H doc height if(isStringSame(argv[atArg],"-H")) { atArg++; double hArg=atof(argv[atArg++]); double scl=hArg/height; height=scl*height; iH=scl*iH; if(keepAspect) { width=scl*width; iW=scl*iW; keepAspect=false; } valid=true; if(atArg>=argc) break; } // -T title if(isStringSame(argv[atArg],"-T")) { atArg++; title=argv[atArg++]; valid=true; if(atArg>=argc) break; } // -A author if(isStringSame(argv[atArg],"-A")) { atArg++; author=argv[atArg++]; valid=true; if(atArg>=argc) break; } // -n name if(isStringSame(argv[atArg],"-n")) { atArg++; name=argv[atArg++]; valid=true; if(atArg>=argc) break; } // -h or --help if(isStringSame(argv[atArg],"-h") || isStringSame(argv[atArg],"--help")) { atArg++; cout << "This program creates pdf document for reading on the NOOK e-reader. The program assumes that each page" << endl; cout << "will be given as an image. The assumed image names are '1.jpg' for the first page, '2.jpg' for the" << endl; cout << "second, 'n.jpg' for every other subsequent page." << endl; cout << "" << endl; cout << "This program relies on the imagemagic 'convert' and 'mogrify' commands." << endl; cout << "See 'www.imagemagick.org' to install." << endl; cout << "" << endl; cout << "This program also relies on the 'pdflatex' command to convert the document into a pdf." << endl; cout << "See 'www.tug.org/applications/pdftex/' for more information" << endl; cout << "" << endl; cout << "This program also relies on the 'rm', 'mv' and 'cp' commands to process various files." << endl; cout << "These are standard commands on any POSIX complient system, see administrator if they are not there" << endl; cout << "" << endl; cout << "-L Create in landscape." << endl; cout << "-S Create to read with nook sideways (scales all by l/w)." << endl; cout << "-2 Doubles size." << endl; cout << "-pre preprocessor_command Apply an image processing command before resize." << endl; cout << " All arguments up to '\\;' are interpreted as a command and arguments." << endl; cout << " The end argument '\\;' must be given to signify the end of the command." << endl; cout << " The argument '{}' is reserved as a placeholder for the image name." << endl; cout << "-post postprocessor_command apply an image processing command after resize." << endl; cout << " All arguments up to '\\;' are interpreted as a command and arguments." << endl; cout << " The end argument '\\;' must be given to signify the end of the command." << endl; cout << " The argument '{}' is reserved as a placeholder for the image name." << endl; cout << "-W document_width Specify a custom document width in inches. If only -W is given then" << endl; cout << " then the aspect ratio is preserved" << endl; cout << "-H document height Specify a custom document height in inches. If only -H is given then" << endl; cout << " then the aspect ratio is preserved" << endl; cout << "-T title Give a title for the pdf document" << endl; cout << "-A author Give and author for the pdf document" << endl; cout << "-n name Give a name for the final pdf." << endl; cout << " The '.pdf' extension automatically appended if not given." << endl; cout << "-h or --help Shows a list of options" << endl; return false; } if(!valid) { cout << argv[atArg] << " is not recognized as an option. Use '-h' or '--help' to see a list of options" << endl; return false; } } return true; } void imageFile::set(unsigned long num) { stringstream ss; ss << num; const char* numStr=ss.str().c_str(); unsigned long at=0; while(numStr[at]!=0 && at<255) { origName[at]=numStr[at]; at++; } if(at==255) { cout << "File name too long" << endl; throw 1; } origName[at++]='.'; origName[at++]='j'; origName[at++]='p'; origName[at++]='g'; origName[at]=0; at=0; while(deleteFilter[at]!=0 && at<255) { custName[at]=deleteFilter[at]; pdfName[at]=deleteFilter[at]; baseName[at]=deleteFilter[at]; at++; } if(at==255) { cout << "File name too long" << endl; throw 1; } unsigned long atNum=0; while(numStr[atNum]!=0 && at<255) { custName[at]=numStr[atNum]; pdfName[at]=numStr[atNum]; baseName[at]=numStr[atNum]; atNum++; at++; } if(at==251) { cout << "File name too long" << endl; throw 1; } unsigned long atNow=at; at=atNow; custName[at++]='.'; custName[at++]='j'; custName[at++]='p'; custName[at++]='g'; custName[at]=0; at=atNow; pdfName[at++]='.'; pdfName[at++]='p'; pdfName[at++]='d'; pdfName[at++]='f'; pdfName[at]=0; at=atNow; baseName[at]=0; return; } imageFile::imageFile() { this->set(iNum++); } imageFile::imageFile(unsigned long i) { this->set(i); } imageFile::imageFile(const imageFile &asg) { *this=asg; } imageFile& imageFile::operator=(const imageFile &asg) { strcpy(this->origName,asg.origName); strcpy(this->custName,asg.custName); strcpy(this->pdfName,asg.pdfName); strcpy(this->baseName,asg.baseName); return *this; } const char* imageFile::original() const { return origName; } const char* imageFile::custom() const { return custName; } const char* imageFile::pdf() const { return pdfName; } const char* imageFile::base() const { return baseName; } unsigned long imageFile::iNum=1; unsigned long readDirectory(list &files) { // Read the current directory contents unsigned long cnt=0; DIR *dp; struct dirent *ep; dp = opendir("./"); if(dp==NULL) { cout << "Failed to open local directory" << endl; return 1; } while((ep=readdir(dp))!=NULL) { string file=ep->d_name; files.push_back(file); cnt++; } closedir(dp); return cnt; } void getImages() { list files; readDirectory(files); bool fnd=true; unsigned long atImage=1; while(fnd) { fnd=false; for(list ::iterator it=files.begin();it!=files.end();it++) { imageFile next=imageFile(atImage); if(isStringSame(next.original(),(*it).c_str())) { imageList.push_back(next); fnd=true; break; } } atImage++; } } void resize(const char* fn,unsigned long imW, unsigned long imH) { stringstream ss; ss << "mogrify -resize " << imW << 'x' << imH << "\\> " << fn; system(ss.str().c_str()); } void clean() { list files; readDirectory(files); for(list ::iterator it=files.begin();it!=files.end();it++) { if(isArtifact((*it).c_str())) rm((*it).c_str()); } }
Installation requires one to copy and past the above text into the files and give those files the same names as explained above. Then one can compile is by executing the command:
g++ jpg2nook.cpp -o jpg2nook
Then one can move the new executable "jpg2nook" to the ~/bin/ directory to make it available in all directories.
The options and requirements as given by --help option:
This program creates pdf document for reading on the NOOK e-reader. The program assumes that each page will be given as an image. The assumed image names are '1.jpg' for the first page, '2.jpg' for the second, 'n.jpg' for every other subsequent page. This program relies on the imagemagic 'convert' and 'mogrify' commands. See 'www.imagemagick.org' to install. This program also relies on the 'pdflatex' command to convert the document into a pdf. See 'www.tug.org/applications/pdftex/' for more information This program also relies on the 'rm', 'mv' and 'cp' commands to process various files. These are standard commands on any POSIX complient system, see administrator if they are not there -L Create in landscape. -S Create to read with nook sideways (scales all by h/w). -2 Doubles size. -pre preprocessor_command Apply an image processing command before resize. All arguments up to '\;' are interpreted as a command and arguments. The end argument '\;' must be given to signify the end of the command. The argument '{}' is reserved as a placeholder for the image name. -post postprocessor_command apply an image processing command after resize. All arguments up to '\;' are interpreted as a command and arguments. The end argument '\;' must be given to signify the end of the command. The argument '{}' is reserved as a placeholder for the image name. -W document_width Specify a custom document width in inches. If only -W is given then then the aspect ratio is preserved -H document height Specify a custom document height in inches. If only -H is given then then the aspect ratio is preserved -T title Give a title for the pdf document -A author Give and author for the pdf document -n name Give a name for the final pdf. The '.pdf' extension automatically appended if not given. -h or --help Shows a list of options
Finally, below is an example of typical usage. Note that the -pre argument is increasing the contrast of the scanned images.
jpg2nook -T "Optimum aerodynamic design using the Navier-Stokes equations" -A "A. Jameson, N. A. Pierce, L. Martinelli" -n "Optimum_aerodynamic_design_using_the_Navier_Stokes_equations"-pre mogrify -contrast-stretch 0%x100% {} \;
Hope you all enjoy.... Bold text