You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Stirling-PDF Team,
When I use the pdf to img function, if the name of the pdf file I upload contains Chinese, at this time, I will get a file named "download" instead of the "download.zip" file, although I can manually add ".zip" to make it work.
The text was updated successfully, but these errors were encountered:
While4
changed the title
The file name does not support Chinese characters
Converting pdf to img file name containing Chinese failed
Apr 5, 2024
Use URLEncoder to solve errors caused by non-ASCII characters. You need to add file name modifications to the last else branch in the interface /pdf/img. The specific code is as follows
` // support Chinese file names
String encodedFilename =
URLEncoder.encode(filename, StandardCharsets.UTF_8.toString())
.replaceAll("\\+", "%20");
// return the Resource in the response
return ResponseEntity.ok()
.header(
HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename=" + encodedFilename + "_convertedToImages.zip")
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.contentLength(resource.contentLength())
.body(resource);`
Hi Stirling-PDF Team,
When I use the pdf to img function, if the name of the pdf file I upload contains Chinese, at this time, I will get a file named "download" instead of the "download.zip" file, although I can manually add ".zip" to make it work.
The text was updated successfully, but these errors were encountered: