微笑向暖mj 2019-09-06 16:14 采纳率: 0%
浏览 356

已经得到pdf文件地址,怎么用java代码将其转换成压缩包格式,并传给前端?

@RequestMapping("/makeUserWB")
public Response<?> makeUserWB(@RequestParam("userIds")String userIds, @RequestParam("subjectId")int subjectId){

    try {
        String[] us=userIds.split(",");

        List<String> list = new ArrayList<String>();

        for(String userId : us) {
            Long userId1 = DataTypeUtil.toLong(userId);
            String path = wrongBookService.productDateRangPdfA4(userId1, subjectId, null, null, 1);
            list.add(path);
        }

        //如果分割后大于1,打成压缩包
        if(list.size()>1) {

        }else {
            Long userId1 = DataTypeUtil.toLong(userIds);
            String path = wrongBookService.productDateRangPdfA4(userId1, subjectId, null, null, 1);
            return Response.success("生成成功!", path);
        }       
    } catch (Exception e) {
        logger.error("", e);
        return Response.error(e);
    }
    return null;
}

问题已解决,已发表在我的博客中https://blog.csdn.net/mj94520/article/details/101201317

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-09-06 16:54
    关注
    评论

报告相同问题?

悬赏问题

  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致