public final void openPdfFileFromStream(final Object filename,final String password) throws PdfException {
  closeOnExit=false;
  if (filename instanceof ImageInputStream) {
    final ImageInputStream iis=(ImageInputStream)filename;
    if (isOpen) {
      closePdfFile();
    }
    isOpen=false;
    this.filename="ImageInputStream" + System.currentTimeMillis();
    org.jpedal.DevFlags.currentFile=this.filename;
    res.flush();
    res.flushObjects();
    objectStoreRef.storeFileName(this.filename);
    currentPdfFile=new PdfObjectReader(password);
    currentPdfFile.openPdfFile(iis);
    openPdfFile();
  }
 else {
    throw new RuntimeException(filename + " not currently an option");
  }
}

public final void openPdfFileFromStream ( final Object filename , final String password ) throws PdfException { closeOnExit = false ; if ( filename instanceof ImageInputStream ) { final ImageInputStream iis = ( ImageInputStream ) filename ; if ( isOpen ) { closePdfFile ( ) ; } isOpen = false ; this . filename = "ImageInputStream" + System . currentTimeMillis ( ) ; org . jpedal . DevFlags . currentFile = this . filename ; res . flush ( ) ; res . flushObjects ( ) ; objectStoreRef . storeFileName ( this . filename ) ; currentPdfFile = new PdfObjectReader ( password ) ; currentPdfFile . openPdfFile ( iis ) ; openPdfFile ( ) ; } else { throw new RuntimeException ( filename + " not currently an option" ) ; } }
routine to open pdf file and extract key info from pdf file so we can decode any pages which also sets password . does not actually decode the pages themselves . also reads the form data . you must explicitly close your stream ! !
