summaryrefslogtreecommitdiff
path: root/pdf.c
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2011-08-02 17:55:17 +0200
committerDidier Raboud <odyx@debian.org>2011-08-02 17:55:17 +0200
commit8010f81b0350b5c4beafc260171c18f3852d4f7f (patch)
tree5a868e73685ab409d4fca1ad1e7ca23c85db56de /pdf.c
parent2661b89e144cf6a036276ceef0317269aff22e4a (diff)
Imported Upstream version 4.0.8upstream/4.0.8
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);