Hi,
this is rather time-sensitive...
Is there a leak or restriction in your library for opening a bigger amount of documents?
I tested it with pdfs and with images (loaded into an empty pdf).
Everytime it reaches 150 i've got the EMFILE-Exception "Too Many Files opened"
Example:
Load 200 bitmaps in 200 documents. crashes at 150.
final int TESTSIZE = 200;
for(int i = 0; i < TESTSIZE; i++) {
Document doc = new Document();
doc.Create(tempPdf);
doc.SetCache(cache);
Page page = doc.NewPage(0, 200, 200);
PageContent content = new PageContent();
content.Create();
//set alpha for both fill and stroke
DocGState dgs = doc.NewGState();
dgs.SetFillAlpha(0x80);//set alpha value to 0.5
dgs.SetStrokeAlpha(0x80);//set alpha value to 0.5
ResGState rgs = page.AddResGState(dgs);
content.GSSet(rgs);
//write a bitmap
content.GSSave();
dgs = doc.NewGState();
dgs.SetFillAlpha(255);//set alpha value to 1
dgs.SetStrokeAlpha(255);//set alpha value to 1
rgs = page.AddResGState(dgs);
content.GSSet(rgs);
Bitmap bmp = Bitmap.createBitmap(300, 600, Config.ARGB_8888);//must be ARGB_8888
Bitmap bit=BitmapFactory.decodeFile(directoryPlusThumbnail);
bmp = bit;
DocImage dimg = doc.NewImage(bmp, true);
bmp.recycle();
ResImage rimg = page.AddResImage(dimg);
Matrix mat = new Matrix( 200, 200, 0, 0 );
content.GSSetMatrix(mat);
mat.Destroy();
content.DrawImage(rimg);
content.GSRestore();
page.AddContent(content, true);
content.Destroy();
page.Close();
}