Hi team
I’m using JCIS for reading pdf file, but I have some problem with pdf file contains the image
The saved file can’t open, But it still works fine with a pdf without images
Here my sourecode :
Configuration config = new PropertyConfiguration(new Properties());
CIFSContext baseContext = new BaseContext(config);
CIFSContext contextWithCred = baseContext.withCredentials(new NtlmPasswordAuthenticator("localhost", "test", "test"));
SmbFile share = new SmbFile("smb://locahost/sharedD3/2.pdf", contextWithCred);
if (!share.exists())
{
share.mkdirs();
}
InputStream in = share.getInputStream();
byte[] data = new byte[(int) share.length()];
in.read(data);
in.close();
share.close();
File file = new File("2.pdf");
FileOutputStream fos = null;
fos = new FileOutputStream(file);
fos.write(data);