打印功能代码提交

master
郑明梁 2 years ago
parent 4bee6cf615
commit 15fc762c53

@ -90,4 +90,29 @@ public class DownloadController {
}
}
@GetMapping(value = "/udiwms/donwload/printFile")
public void printFile(HttpServletResponse response, @RequestParam String fileName) throws IOException {
String url="D:\\udi\\udiwms\\udiwmsfile\\pdf\\template\\"+fileName;
OutputStream os = null;
try {
FileInputStream input = new FileInputStream(new File(url));
OutputStream out = response.getOutputStream();
byte[] b = new byte[2048];
int len;
while ((len = input.read(b)) != -1) {
out.write(b, 0, len);
}
input.close();
} catch (IOException e) {
} finally {
if (os != null) {
os.flush();
os.close();
}
}
}
}

Loading…
Cancel
Save