diff -Naur claws-mail-4.0.0-orig/src/plugins/pdf_viewer/poppler_viewer.c claws-mail-4.0.0/src/plugins/pdf_viewer/poppler_viewer.c
--- claws-mail-4.0.0-orig/src/plugins/pdf_viewer/poppler_viewer.c	2021-07-10 10:47:13.000000000 +0200
+++ claws-mail-4.0.0/src/plugins/pdf_viewer/poppler_viewer.c	2021-07-21 00:57:53.877710072 +0200
@@ -1339,7 +1339,7 @@
 				tmpfile = get_tmp_file();
 				cmdline = g_strdup_printf(
 					"gs -dSAFER -dCompatibilityLevel=1.2 -q -dNOPAUSE -dBATCH "
-					  "-sDEVICE=pdfwrite -sOutputFile=%s -c .setpdfwrite -f \"%s\"",
+					  "-sDEVICE=pdfwrite -sOutputFile=%s -c 3000000 setvmthreshold -f \"%s\"",
 					tmpfile, viewer->filename);
 				result = execute_command_line(cmdline, FALSE, NULL);
 				if (result == 0) {
