summaryrefslogtreecommitdiff
path: root/pdf.c
diff options
context:
space:
mode:
Diffstat (limited to 'pdf.c')
-rw-r--r--pdf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pdf.c b/pdf.c
index c31542b..ebd6ab5 100644
--- a/pdf.c
+++ b/pdf.c
@@ -110,13 +110,14 @@ static int pdf_extract_pages(char filename[PATH_MAX],
{
char gscommand[4095];
char filename_arg[PATH_MAX], first_arg[50], last_arg[50];
+ int fd;
_log("Extracting pages %d through %d\n", first, last);
snprintf(filename, PATH_MAX, "%s/foomatic-XXXXXX", temp_dir());
- mktemp(filename);
- if (!filename[0])
+ if ((fd = mkstemp(filename)) == -1)
rip_die(EXIT_STARVED, "Unable to create temporary file!\n");
+ close (fd);
snprintf(filename_arg, PATH_MAX, "-sOutputFile=%s", filename);
snprintf(first_arg, 50, "-dFirstPage=%d", first);
@@ -125,7 +126,7 @@ static int pdf_extract_pages(char filename[PATH_MAX],
else
first_arg[0] = '\0';
- snprintf(gscommand, 4095, "%s -q -dNOPAUSE -dBATCH -dPARANOIDSAFER"
+ snprintf(gscommand, 4095, "%s -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -dNOINTERPOLATE"
"-sDEVICE=pdfwrite %s %s %s %s",
gspath, filename_arg, first_arg, last_arg, pdffilename);