Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Thursday, January 6, 2011

Code Example to use ThreadPoolExecutor in Java

// to create Thread Pooling use
private ThreadPoolExecutor pool=null;

pool=new ThreadPoolExecutor(DEFAULT_THREAD_COUNT,MAX_THREAD_COUNT,20,TimeUnit.SECONDS, new ArrayBlockingQueue(1000),new CallerBlocksPolicy());
        pool.prestartCoreThread();


// now repeatedly use

WorkerThread thread=new WorkerThread(pdfUri,cs);
 pool.execute(thread); // will submit new thread into the que.

// to shutdown

pool.awaitTermination(15,TimeUnit.SECONDS);
pool.shutdown();

Friday, December 24, 2010

Java PDF Library - Apache's PDFBox

Apache PDFBox is an open source Java PDF library for working with PDF documents. This project allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents. Apache PDFBox also includes several command line utilities.

Features

  • PDF to text extraction
  • Merge PDF Documents
  • PDF Document Encryption/Decryption
  • Lucene Search Engine Integration
  • Fill in form data FDF and XFDF
  • Create a PDF from a text file
  • Create images from PDF pages
  • Print a PDF
  • Source http://pdfbox.apache.org