Skip to content

This library extract cover from a lot of document formats from folder

Notifications You must be signed in to change notification settings

NazarK0/book-covers-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About: This package extracts first page of various documents from pointed folder and convert to jpeg picture

Return: Promise

Supported OS: GNU/Linux only( Server and desktop ).

Before usage: on machine must be installed libreoffice, calibre and djvulibre-bin. If you don`t have those, please install using package manager. For example on Debian-like machine run

apt-get update
sudo apt-get install calibre djvulibre-bin libreoffice [--no-install-recommends]

key --no-install-recommends optional, use it if you use package on server, this prevent installation of GUI for libreoffice

Supported formats:

e-book formats:

  • djvu
  • pdf
  • azw4
  • chm
  • epub
  • fb2
  • htlz
  • html
  • lit
  • lrf
  • mobi
  • odt
  • pdb
  • pml
  • rb
  • snb
  • tcr
  • txt

Office formats:

  • ppt, pptx
  • doc, docx
  • csv
  • xls, xlsx
  • dotx
  • vsd, vsdx
  • rtf

Usage:

You must specify in which folder exist documents that need to convert. In folder could exist another folders, package process all of them recursively. Source folder path could be or relative or absolute.

const CoversExtractor = require('covers-extractor');
//by default images will be stored in your home directory in folder 'paperbacks'
CoversExtractor("./books");

//also you can manually point in which folder images will be stored. You can use as absolute as relative paths. If folder don`t exist, it will be created.
CoversExtractor("./books", "/home/users/FooUser");

//multiple usage
(async () => {
  console.log("processing...");
  await CoversExtractor("~/Projects/node/books");
  console.log("done.");

  console.log("processing...");
  await CoversExtractor("~/Projects/node/books", "~/testcovers");
  console.log("done.");
})();

About

This library extract cover from a lot of document formats from folder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published