このトピックに関する別の質問を見ました。試してみましたが、まだうまくいきません
私のコード:
File file = new File("C:\\Testing\\abc.pdf");
RandomAccessFile raf = new RandomAccessFile(file, "r");
ReadableByteChannel ch = Channels.newChannel(new FileInputStream(file));
FileChannel channel = raf.getChannel();
ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
PDFFile pdffile = new PDFFile(buf);
/* The rest code to convert pdf to image
* according to number of pages in pdf given above, which will not be provided here
*/
/* Closing file */
raf.close();
ch.close();
channel.close();
buf.clear();
コードが機能しません。ファイルを閉じませんでした
プログラムの実行後にファイルを削除できません。Java SE Binary Platform がこのファイルを開いていると表示されます。
PDFRenderer で開いたファイルを閉じるにはどうすればよいですか?