思路:base64 -> multipartFile - > pdf
base64 -> multipartFile
/**
* 将 图片base64 - > MultipartFile
* @param base64
* @return
*/
public static MultipartFile base64MultipartFile(String base64) {
try {
String[] baseStr = base64.split(",");
BASE64Decoder base64Decoder = new BASE64Decoder();
byte[] b;
b = base64Decoder.decodeBuffer(baseStr[1]);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {
b[i] += 256;
}