gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master f1a8f93: Library is now in charge of writing E


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master f1a8f93: Library is now in charge of writing EPS and PDF files
Date: Sun, 18 Mar 2018 12:39:50 -0400 (EDT)

branch: master
commit f1a8f932df850a23cf026380124e6fcfd31f2a6f
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Library is now in charge of writing EPS and PDF files
    
    Until now, only the ConvertType program had the capabilities to write EPS
    and PDF files. The respective functions are now brought out of ConvertType
    and moved to the libraries to be accessible by all progarms and library
    users.
    
    Since the number of sections on the different (non-FITS) file formats in
    the Gnuastro library chapter was getting too much, all the non-FITS formats
    are now moved within a single section.
---
 NEWS                     |   7 +
 bin/convertt/Makefile.am |   4 +-
 bin/convertt/convertt.c  |  14 +-
 bin/convertt/eps.c       | 472 -----------------------------------------------
 bin/convertt/eps.h       |  41 ----
 bin/convertt/ui.c        |  25 +--
 configure.ac             |  23 ++-
 doc/gnuastro.texi        | 325 ++++++++++++++++++++++----------
 lib/Makefile.am          |  28 +--
 lib/eps.c                | 438 +++++++++++++++++++++++++++++++++++++++++++
 lib/gnuastro/eps.h       |  75 ++++++++
 lib/gnuastro/pdf.h       |  72 ++++++++
 lib/pdf.c                | 125 +++++++++++++
 13 files changed, 997 insertions(+), 652 deletions(-)

diff --git a/NEWS b/NEWS
index 0c2967b..f53ebb3 100644
--- a/NEWS
+++ b/NEWS
@@ -28,10 +28,17 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   Libraries:
     gal_array_read: read from file with all known formats (FITS, TIFF, etc).
     gal_array_read_to_type: similar to `gal_array_read', but to given type.
+    gal_eps_name_is_eps: Returns 1 if given filename is EPS.
+    gal_eps_suffix_is_eps: Returns 1 if given suffix is EPS.
+    gal_eps_to_pt: Converts dataset size to PostScript points.
+    gal_eps_write: Writes a dataset into an EPS file.
     gal_jpeg_name_is_jpeg: Returns 1 if given filename is JPEG.
     gal_jpeg_suffix_is_jpeg: Returns 1 if given suffix is JPEG.
     gal_jpeg_read: Reads input JPEG image into `gal_data_t'.
     gal_jpeg_write: Writes a `gal_data_t' into a JPEG file.
+    gal_pdf_name_is_pdf: Returns 1 if given filename is PDF.
+    gal_pdf_suffix_is_pdf: Returns 1 if given suffix is PDF.
+    gal_pdf_write: Writes a dataset into an PDF file.
     gal_tiff_name_is_tiff: check if name contains a TIFF suffix.
     gal_tiff_suffix_is_tiff: check if suffix is a TIFF suffix.
     gal_tiff_dir_string_read: convert a string to a TIFF directory number.
diff --git a/bin/convertt/Makefile.am b/bin/convertt/Makefile.am
index 807597b..847d8ba 100644
--- a/bin/convertt/Makefile.am
+++ b/bin/convertt/Makefile.am
@@ -30,9 +30,9 @@ bin_PROGRAMS = astconvertt
 
 astconvertt_LDADD = -lgnuastro
 
-astconvertt_SOURCES = main.c ui.c convertt.c eps.c
+astconvertt_SOURCES = main.c ui.c convertt.c
 
-EXTRA_DIST = main.h authors-cite.h args.h ui.h convertt.h eps.h
+EXTRA_DIST = main.h authors-cite.h args.h ui.h convertt.h
 
 
 
diff --git a/bin/convertt/convertt.c b/bin/convertt/convertt.c
index 81e3ddd..7ed7ebf 100644
--- a/bin/convertt/convertt.c
+++ b/bin/convertt/convertt.c
@@ -29,6 +29,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <stdlib.h>
 
+#include <gnuastro/eps.h>
+#include <gnuastro/pdf.h>
 #include <gnuastro/txt.h>
 #include <gnuastro/fits.h>
 #include <gnuastro/jpeg.h>
@@ -39,8 +41,6 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "eps.h"
-
 
 
 
@@ -345,11 +345,17 @@ convertt(struct converttparams *p)
       gal_jpeg_write(p->chll, p->cp.output, p->quality, p->widthincm);
       break;
 
-    /* EPS/PDF. */
+    /* EPS. */
     case OUT_FORMAT_EPS:
+      convertt_scale_to_uchar(p);
+      gal_eps_write(p->chll, p->cp.output, p->widthincm, p->borderwidth,
+                    p->hex, 0);
+      break;
+
+    /* PDF */
     case OUT_FORMAT_PDF:
       convertt_scale_to_uchar(p);
-      eps_write_eps_or_pdf(p);
+      gal_pdf_write(p->chll, p->cp.output, p->widthincm, p->borderwidth);
       break;
 
     /* Not recognized. */
diff --git a/bin/convertt/eps.c b/bin/convertt/eps.c
deleted file mode 100644
index 699f240..0000000
--- a/bin/convertt/eps.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/*********************************************************************
-ConvertType - Convert between various types of files.
-ConvertType is part of GNU Astronomy Utilities (Gnuastro) package.
-
-Original author:
-     Mohammad Akhlaghi <address@hidden>
-Contributing author(s):
-Copyright (C) 2015-2018, Free Software Foundation, Inc.
-
-Gnuastro is free software: you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation, either version 3 of the License, or (at your
-option) any later version.
-
-Gnuastro is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
-**********************************************************************/
-#include <config.h>
-
-#include <stdio.h>
-#include <errno.h>
-#include <error.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gnuastro-internal/timing.h>
-#include <gnuastro-internal/checkset.h>
-
-#include "main.h"
-
-
-
-
-
-
-/*************************************************************
- **************      Acceptable EPS names      ***************
- *************************************************************/
-int
-nameiseps(char *name)
-{
-  size_t len;
-  len=strlen(name);
-  if ( ( len>=3 && strcmp(&name[len-3], "eps") == 0 )
-       || ( len>=3 && strcmp(&name[len-3], "EPS") == 0 )
-       || ( len>=4 && strcmp(&name[len-4], "epsf") == 0 )
-       || ( len>=4 && strcmp(&name[len-4], "epsi") == 0 ) )
-    return 1;
-  else
-    return 0;
-}
-
-
-
-
-
-int
-nameisepssuffix(char *name)
-{
-  if (strcmp(name, "eps") == 0 || strcmp(name, ".eps") == 0
-      || strcmp(name, "EPS") == 0 || strcmp(name, ".EPS") == 0
-      || strcmp(name, "epsf") == 0 || strcmp(name, ".epsf") == 0
-      || strcmp(name, "epsi") == 0 || strcmp(name, ".epsi") == 0)
-    return 1;
-  else
-    return 0;
-}
-
-
-
-
-
-int
-nameispdf(char *name)
-{
-  size_t len;
-  len=strlen(name);
-  if (strcmp(&name[len-3], "pdf") == 0
-      || strcmp(&name[len-3], "PDF") == 0)
-    return 1;
-  else
-    return 0;
-}
-
-
-
-
-
-int
-nameispdfsuffix(char *name)
-{
-  if (strcmp(name, "pdf") == 0 || strcmp(name, ".pdf") == 0
-      || strcmp(name, "PDF") == 0 || strcmp(name, ".PDF") == 0)
-    return 1;
-  else
-    return 0;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*************************************************************
- **************       Write an EPS image        **************
- *************************************************************/
-static int
-eps_is_binary(struct converttparams *p)
-{
-  gal_data_t *channel;
-  unsigned char *i, *fi;
-
-  /* Go through all the channels. */
-  for(channel=p->chll; channel!=NULL; channel=channel->next)
-    {
-      /* Go through all the values and see they are 0 and break out of the
-         loop as soon as you get to a pixel that is not 0 or `maxbyte'. */
-      fi = (i=p->chll->array) + p->chll->size;
-      do
-        if(*i!=p->maxbyte && *i!=0) break;
-      while(++i<fi);
-
-      /* If we didn't get to the end of the channel, then we have a
-         non-binary image. */
-      if(i!=fi)
-        return 0;
-    }
-
-  /* If we get to this point, then all the channels were binary, so return
-     success. */
-  return 1;
-}
-
-
-
-
-
-/* Show the bit values in a uint8_t variable. It is included here as a
-   test in debugging problems with blackandwhite. To test it use a
-   very small valued input to make the outputs reasonable. For example
-   I am now testing it with an input text array of 12 elements (while
-   calling the --invert option):
-
-   1 0 1 0 0 0
-   0 0 0 1 0 1
-*/
-void
-eps_show_bits(uint8_t x)
-{
-  int i;
-
-  for(i=7;i>=0;--i)
-    (x&(1<<i)) ? putchar('1') : putchar('0');
-  putchar('\n');
-}
-
-
-
-
-
-
-/* Convert the channels into into a 0 and 1 bit stream. This function is
-   only called when the image is binary (has only two values). NOTE: each
-   row has to have an integer number of bytes, so when the number of pixels
-   in a row is not a multiple of 8, we'll add one. */
-size_t
-eps_convert_to_bitstream(struct converttparams *p)
-{
-  gal_data_t *channel;
-  size_t i, j, k, bytesinrow, bytesinimg;
-  unsigned char *bits, byte, curbit, *in;
-  size_t s0=p->chll->dsize[0], s1=p->chll->dsize[1];
-
-  /* Find the size values and allocate the array. */
-  if( s1 % 8 ) bytesinrow = s1/8 + 1;
-  else         bytesinrow = s1/8;
-  bytesinimg = bytesinrow*s0;
-
-  /* Go over all the channels. */
-  for(channel=p->chll; channel!=NULL; channel=channel->next)
-    {
-      /* Allocate the array. */
-      bits=gal_data_malloc_array(GAL_TYPE_UINT8, bytesinimg, __func__,
-                                 "bits");
-
-      /* Put the values in. */
-      in=channel->array;
-      for(i=0;i<s0;++i)
-        {
-          for(j=0;j<bytesinrow;++j)
-            {                  /* i*s0+j is the byte, not bit position. */
-              byte=0;          /* Set the 8 bits to zero.               */
-              curbit=0x80;     /* Current bit position, starting at:    */
-              for(k=0;k<8;++k)
-                {
-                  if( j*8+k < s1 )
-                    {
-                      if(in[i*s1+j*8+k])
-                        byte |= curbit;
-                      curbit >>= 1;
-                    }
-                  else break;
-                }
-              /*eps_show_bits(byte);*/
-              bits[i*bytesinrow+j]=byte;
-            }
-        }
-      free(channel->array);
-      channel->array=bits;
-      channel->type=GAL_TYPE_BIT;
-    }
-
-  /* Return the total number of bytes in the image. */
-  return bytesinimg;
-}
-
-
-
-
-
-void
-eps_write_hex(struct converttparams *p, FILE *fp, size_t size)
-{
-  unsigned char *in;
-  gal_data_t *channel;
-  size_t i=0, j, elem_for_newline=35;
-
-  for(channel=p->chll; channel!=NULL; channel=channel->next)
-    {
-      if(channel->status)       /* A blank channel has status==1. */
-        fprintf(fp, "{<00>} %% Channel %zu is blank\n", i);
-      else
-        {
-          in=channel->array;
-          fprintf(fp, "{<");
-          for(j=0;j<size;++j)
-            {
-              fprintf(fp, "%02X", in[j]);
-              if(j%elem_for_newline==0) fprintf(fp, "\n");
-            }
-          fprintf(fp, ">}\n");
-        }
-      ++i;
-    }
-}
-
-
-
-
-
-void
-eps_write_ascii85(struct converttparams *p, FILE *fp, size_t size)
-{
-  unsigned char *in;
-  gal_data_t *channel;
-  uint32_t anint, base;
-  size_t i=0, j, k, elem_for_newline=15;   /* 15*5=75 */
-
-  for(channel=p->chll; channel!=NULL; channel=channel->next)
-    {
-      if(channel->status)
-        fprintf(fp, "{<00>} %% Channel %zu is blank\n", i);
-      else
-        {
-          in=channel->array;
-          fprintf(fp, "{<~");
-          for(j=0;j<size;j+=4)
-            {
-              /* This is the last four bytes */
-              if(size-j<4)
-                {
-                  anint=in[j]*256*256*256;
-                  if(size-j>1)  anint+=in[j+1]*256*256;
-                  if(size-j==3) anint+=in[j+2]*256;
-                }
-              else
-                anint=( in[j]*256*256*256 + in[j+1]*256*256
-                        + in[j+2]*256     + in[j+3]         );
-
-              /* If all four bytes are zero, then just print `z'. */
-              if(anint==0) fprintf(fp, "z");
-              else
-                {
-                  /* To check, just change the fprintf below to printf:
-                     printf("\n\n");
-                     printf("%u %u %u %u\n", in[i], in[i+1],
-                            in[i+2], in[i+3]);
-                  */
-                  base=85*85*85*85;
-                  /* Do the ASCII85 encoding: */
-                  for(k=0;k<5;++k)
-                    {
-                      fprintf(fp, "%c", anint/base+33);
-                      anint%=base;
-                      base/=85;
-                    }
-                }
-              /* Go to the next line if on the right place: */
-              if(j%elem_for_newline==0) fprintf(fp, "\n");
-            }
-          fprintf(fp, "~>}\n");
-        }
-      ++i;
-    }
-}
-
-
-
-
-
-static void
-eps_write_image(struct converttparams *p, FILE *fp)
-{
-  int bpc=8;
-  size_t i, size, *dsize=p->chll->dsize;
-
-  /* Set the number of bits per component. */
-  if( p->numch==1 && eps_is_binary(p) )
-    {
-      bpc=1;
-      size=eps_convert_to_bitstream(p);
-    }
-  else size=p->chll->size;
-
-  switch(p->numch)
-    {
-    case 1: fprintf(fp, "/DeviceGray setcolorspace\n"); break;
-    case 3: fprintf(fp, "/DeviceRGB setcolorspace\n");  break;
-    case 4: fprintf(fp, "/DeviceCMYK setcolorspace\n"); break;
-    default:
-      error(EXIT_FAILURE, 0, "%s: a bug! The number of channels (%zu) is not "
-            "1, 3 or 4. Please contact us so we can find the issue and fix it",
-            __func__, p->numch);
-    }
-  fprintf(fp, "<<\n");
-  fprintf(fp, "  /ImageType 1\n");
-  fprintf(fp, "  /Width %zu\n", dsize[1]);
-  fprintf(fp, "  /Height %zu\n", dsize[0]);
-  fprintf(fp, "  /ImageMatrix [ %zu 0 0 %zu 0 0 ]\n", dsize[1], dsize[0]);
-  fprintf(fp, "  /MultipleDataSources true\n");
-  fprintf(fp, "  /BitsPerComponent %d\n", bpc);
-  fprintf(fp, "  /Decode[");
-  for(i=0;i<p->numch;++i) {fprintf(fp, " 0 1");} fprintf(fp, " ]\n");
-  fprintf(fp, "  /Interpolate false\n");
-  fprintf(fp, "  /DataSource [\n");
-  if(p->hex) eps_write_hex(p, fp, size);
-  else eps_write_ascii85(p, fp, size);
-  fprintf(fp, "  ]\n");
-  fprintf(fp, ">>\n");
-  fprintf(fp, "image\n\n");
-}
-
-
-
-
-void
-eps_write_eps_or_pdf(struct converttparams *p)
-{
-  FILE *fp;
-  float hbw;
-  char command[20000], *epsfilename=NULL;
-  size_t winpt, hinpt, *dsize=p->chll->dsize;
-
-
-  /* Find the bounding box  */
-  winpt=p->widthincm*72.0f/2.54f;
-  hinpt=(float)( dsize[0] * winpt )/(float)(dsize[1]);
-  hbw=(float)p->borderwidth/2.0f;
-
-
-  /* EPS filename */
-  if(p->outformat==OUT_FORMAT_EPS)
-    {
-      epsfilename=p->cp.output;
-      gal_checkset_writable_remove(epsfilename, 0, p->cp.dontdelete);
-    }
-  else if (p->outformat==OUT_FORMAT_PDF)
-    {
-      gal_checkset_writable_remove(p->cp.output, 0, p->cp.dontdelete);
-      epsfilename=gal_checkset_automatic_output(&p->cp, p->cp.output, ".ps");
-    }
-  else
-    error(EXIT_FAILURE, 0, "%s: a bug! code %d not recognized for "
-          "`p->outformat'", __func__, p->outformat);
-
-
-  /* Open the output file and write the top comments. */
-  errno=0;
-  fp=fopen(epsfilename, "w");
-  if(fp==NULL)
-    error(EXIT_FAILURE, errno, "%s", p->cp.output);
-  fprintf(fp, "%%!PS-Adobe-3.0 EPSF-3.0\n");
-  fprintf(fp, "%%%%BoundingBox: 0 0 %zu %zu\n", winpt+2*p->borderwidth,
-          hinpt+2*p->borderwidth);
-  fprintf(fp, "%%%%Creator: %s\n", PROGRAM_STRING);
-  fprintf(fp, "%%%%CreationDate: %s", ctime(&p->rawtime));
-  fprintf(fp, "%%%%LanuageLevel: 3\n");
-  fprintf(fp, "%%%%EndComments\n\n");
-  if(p->outformat==OUT_FORMAT_EPS)
-    fprintf(fp, "gsave\n\n");
-
-
-  /* Commands to draw the border: */
-  if(p->borderwidth)
-    {
-      fprintf(fp, "%% Draw the border:\n");
-      fprintf(fp, "0 setgray\n");
-      fprintf(fp, "%d setlinewidth\n", p->borderwidth);
-      fprintf(fp, "%.1f %.1f moveto\n", hbw, hbw);
-      fprintf(fp, "0 %zu rlineto\n", hinpt+p->borderwidth);
-      fprintf(fp, "%zu 0 rlineto\n", winpt+p->borderwidth);
-      fprintf(fp, "0 -%zu rlineto\n", hinpt+p->borderwidth);
-      fprintf(fp, "closepath\n");
-      fprintf(fp, "stroke\n\n");
-    }
-
-
-
-  /* Write the image: */
-  fprintf(fp, "%% Draw the image:\n");
-  fprintf(fp, "%d %d translate\n", p->borderwidth, p->borderwidth);
-  fprintf(fp, "%zu %zu scale\n", winpt, hinpt);
-  eps_write_image(p, fp);
-
-
-
-  /* Ending of the EPS file: */
-  if(p->outformat==OUT_FORMAT_EPS)
-    fprintf(fp, "grestore\n");
-  else
-    fprintf(fp, "showpage\n");
-  fprintf(fp, "%%%%EOF");
-  fclose(fp);
-
-
-
-  if(p->outformat==OUT_FORMAT_PDF)
-    {
-      sprintf(command, "gs -q -o %s -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=%zu"
-              " -dDEVICEHEIGHTPOINTS=%zu -dPDFFitPage %s", p->cp.output,
-              winpt+2*p->borderwidth, hinpt+2*p->borderwidth, epsfilename);
-      if(system(command))
-        error(EXIT_FAILURE, 0, "the command to convert a PostScript file to "
-              "PDF (`%s') was not successful! The PostScript file (%s) is "
-              "left if you want to convert or use it through any other "
-              "means", command, epsfilename);
-      sprintf(command, "rm %s", epsfilename);
-      if(system(command))
-        error(EXIT_FAILURE, 0, "The PDF output (%s) was created, but the "
-              "PostScript file which was used to make it (%s) could not be"
-              "removed", p->cp.output, epsfilename);
-      free(epsfilename);
-    }
-}
diff --git a/bin/convertt/eps.h b/bin/convertt/eps.h
deleted file mode 100644
index b9eba01..0000000
--- a/bin/convertt/eps.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*********************************************************************
-ConvertType - Convert between various types of files.
-ConvertType is part of GNU Astronomy Utilities (Gnuastro) package.
-
-Original author:
-     Mohammad Akhlaghi <address@hidden>
-Contributing author(s):
-Copyright (C) 2015-2018, Free Software Foundation, Inc.
-
-Gnuastro is free software: you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation, either version 3 of the License, or (at your
-option) any later version.
-
-Gnuastro is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
-**********************************************************************/
-#ifndef EPS_H
-#define EPS_H
-
-int
-nameiseps(char *name);
-
-int
-nameisepssuffix(char *name);
-
-int
-nameispdf(char *name);
-
-int
-nameispdfsuffix(char *name);
-
-void
-eps_write_eps_or_pdf(struct converttparams *p);
-
-#endif
diff --git a/bin/convertt/ui.c b/bin/convertt/ui.c
index 94cd70d..0df8390 100644
--- a/bin/convertt/ui.c
+++ b/bin/convertt/ui.c
@@ -28,8 +28,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <stdio.h>
 #include <string.h>
 
+#include <gnuastro/eps.h>
 #include <gnuastro/txt.h>
 #include <gnuastro/wcs.h>
+#include <gnuastro/pdf.h>
 #include <gnuastro/list.h>
 #include <gnuastro/fits.h>
 #include <gnuastro/jpeg.h>
@@ -46,7 +48,6 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include "main.h"
 
 #include "ui.h"
-#include "eps.h"
 #include "authors-cite.h"
 
 
@@ -474,18 +475,18 @@ ui_make_channels_ll(struct converttparams *p)
 
 
       /* EPS:  */
-      else if ( nameiseps(name->v) )
+      else if ( gal_eps_name_is_eps(name->v) )
         error(EXIT_FAILURE, 0, "EPS files cannot be used as input. Since "
-              "EPS files are not raster graphics, they are only used as "
-              "output");
+              "EPS files are not raster graphics. EPS is only an output "
+              "format");
 
 
 
       /* PDF:  */
-      else if ( nameispdf(name->v) )
+      else if ( gal_pdf_name_is_pdf(name->v) )
         error(EXIT_FAILURE, 0, "PDF files cannot be used as input. Since "
-              "PDF files are not raster graphics, they are only used as "
-              "output");
+              "PDF files are not raster graphics. PDF is only an output "
+              "format");
 
 
       /* Text: */
@@ -683,18 +684,18 @@ ui_set_output(struct converttparams *p)
             PACKAGE_BUGREPORT);
 
   /* EPS */
-  else if(nameiseps(cp->output))
+  else if(gal_eps_name_is_eps(cp->output))
     {
       p->outformat=OUT_FORMAT_EPS;
-      if( nameisepssuffix(cp->output) )
+      if( gal_eps_suffix_is_eps(cp->output) )
         ui_add_dot_use_automatic_output(p);
     }
 
   /* PDF */
-  else if(nameispdf(cp->output))
+  else if(gal_pdf_name_is_pdf(cp->output))
     {
       p->outformat=OUT_FORMAT_PDF;
-      if( nameispdfsuffix(cp->output) )
+      if( gal_pdf_suffix_is_pdf(cp->output) )
         ui_add_dot_use_automatic_output(p);
     }
 
@@ -735,7 +736,7 @@ ui_set_output(struct converttparams *p)
         }
     }
 
-  /* Check if the output already exists. */
+  /* Check if the output already exists and remove it if allowed. */
   gal_checkset_writable_remove(cp->output, 0, cp->dontdelete);
 }
 
diff --git a/configure.ac b/configure.ac
index 77b2559..3c61a77 100644
--- a/configure.ac
+++ b/configure.ac
@@ -354,9 +354,9 @@ AC_DEFINE_UNQUOTED([GAL_CONFIG_GNULIBTOOL_EXEC], 
["$gnulibtool_exec"],
 
 
 
-# Check Ghostscript: "-dPDFFitPage" option to Ghostscript, used by
-# ConvertType to convert from EPS to PDF, has been introduced in
-# Ghostscript 9.10.  Make sure we have at least that version.
+# Check Ghostscript: "-dPDFFitPage" option to Ghostscript, used by the
+# library to convert from EPS to PDF, has been introduced in Ghostscript
+# 9.10.  Make sure we have at least that version.
 #
 # Below, only when Ghostscript exists, we check its version and only if its
 # version is larger than 9.10, does Gnuastro finally assume the existence
@@ -658,22 +658,26 @@ AS_IF([test x$enable_guide_message = xyes],
       [
         AS_ECHO(["Configuration warning(s):"])
         AS_ECHO([])
+
         AS_IF([test "x$has_libjpeg" = "xno"],
               [AS_ECHO(["  - libjpeg, could not be linked with in your library 
search path."])
-               AS_ECHO(["    If JPEG inputs/outputs are given to ConvertType, 
it will warn"])
-               AS_ECHO(["    you and abort with an error."])
+               AS_ECHO(["    If JPEG inputs/outputs are requested, the 
respective tool will"])
+               AS_ECHO(["    inform you and abort with an error."])
                AS_ECHO([]) ])
+
         AS_IF([test "x$has_libtiff" = "xno"],
               [AS_ECHO(["  - libtiff, could not be linked with in your library 
search path."])
-               AS_ECHO(["    If TIFF inputs/outputs are given to ConvertType, 
it will warn"])
-               AS_ECHO(["    you and abort with an error."])
+               AS_ECHO(["    If TIFF inputs/outputs are requested, the 
respective tool will"])
+               AS_ECHO(["    inform you and abort with an error."])
                AS_ECHO([]) ])
+
         AS_IF([test "x$has_libgit2" = "x0"],
               [AS_ECHO(["  - libgit2, could not be linked with in your library 
search path."])
                AS_ECHO(["    When present, Git's describe output will be 
stored in the"])
                AS_ECHO(["    output files if Gnuastro's programs were called 
within a Git"])
                AS_ECHO(["    version controlled directory to help in 
reproducibility."])
                AS_ECHO([]) ])
+
         AS_IF([test "x$has_gnulibtool" = "xno"],
               [AS_ECHO(["  - GNU Libtool, could not be found in your search 
path."])
                AS_ECHO(["    Gnuastro's BuildProgram uses GNU libtool to link 
your source code"])
@@ -691,12 +695,14 @@ AS_IF([test x$enable_guide_message = xyes],
                       AS_ECHO([])
                      ])
               ])
+
         AS_IF([test "x$has_ghostscript" = "xno"],
               [AS_ECHO(["  - GPL GhostScript version 9.10 or later, with the 
executable"])
                AS_ECHO(["    name \`gs', was not found in your PATH 
environment variable."])
-               AS_ECHO(["    If PDF outputs are desired from ConvertType, it 
will abort"])
+               AS_ECHO(["    If PDF outputs are desired, the respective tool 
it will abort"])
                AS_ECHO(["    with an EPS output which you can convert to PDF 
by other means."])
                AS_ECHO([]) ])
+
         # The last two scenarios described below are taken from
         # 
https://unix.stackexchange.com/questions/65700/is-it-safe-to-add-to-my-path-how-come
         AS_IF([test "x$path_warning" = "xyes"],
@@ -713,6 +719,7 @@ AS_IF([test x$enable_guide_message = xyes],
                AS_ECHO(["    installing Gnuastro to learn more about PATH:"])
                AS_ECHO(["        $ info gnuastro \"Installation directory\""])
                AS_ECHO([]) ])
+
         AS_ECHO(["  All checks related to the warning(s) above will be 
skipped."])
         AS_ECHO([])
       ]
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 605aae7..6fbd54e 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -557,9 +557,7 @@ Gnuastro library
 * Array input output::          Reading and writing images or cubes.
 * Table input output::          Reading and writing table columns.
 * FITS files::                  Working with FITS data.
-* TIFF files::                  Reading and writing TIFF files.
-* JPEG files::                  Reading and writing JPEG files.
-* Text files::                  Reading and writing Text files.
+* File input output::
 * World Coordinate System::     Dealing with the world coordinate system.
 * Arithmetic on datasets::      Arithmetic operations on a dataset.
 * Tessellation library::        Functions for working on tiles.
@@ -608,6 +606,14 @@ FITS files (@file{fits.h})
 * FITS arrays::                 Reading and writing FITS images/arrays.
 * FITS tables::                 Reading and writing FITS tables.
 
+File input output
+
+* Text files::                  Reading and writing from/to plain text files.
+* TIFF files::                  Reading and writing from/to TIFF files.
+* JPEG files::                  Reading and writing from/to JPEG files.
+* EPS files::                   Writing to EPS files.
+* PDF files::                   Writing to PDF files.
+
 Tessellation library (@file{tile.h})
 
 * Independent tiles::           Work on or check independent tiles.
@@ -19104,9 +19110,7 @@ documentation will correspond to your installed version.
 * Array input output::          Reading and writing images or cubes.
 * Table input output::          Reading and writing table columns.
 * FITS files::                  Working with FITS data.
-* TIFF files::                  Reading and writing TIFF files.
-* JPEG files::                  Reading and writing JPEG files.
-* Text files::                  Reading and writing Text files.
+* File input output::
 * World Coordinate System::     Dealing with the world coordinate system.
 * Arithmetic on datasets::      Arithmetic operations on a dataset.
 * Tessellation library::        Functions for working on tiles.
@@ -21491,7 +21495,7 @@ saying that the @code{filename} has been created.
 
 
 
address@hidden FITS files, TIFF files, Table input output, Gnuastro library
address@hidden FITS files, File input output, Table input output, Gnuastro 
library
 @subsection FITS files (@file{fits.h})
 
 @cindex FITS
@@ -22063,8 +22067,133 @@ formats, see @ref{Table input output}.
 
 
 
address@hidden TIFF files, JPEG files, FITS files, Gnuastro library
address@hidden TIFF files (@file{tiff.h})
address@hidden File input output, World Coordinate System, FITS files, Gnuastro 
library
address@hidden File input output
+
+The most commonly used file format in astronomical data analysis is the
+FITS format (see @ref{Fits} for an introduction), therefore Gnuastro's
+library provides a large and separate collection of functions to read/write
+data from/to them (see @ref{FITS files}). However, FITS is not well
+recognized outside the astronomical community and cannot be imported into
+documents or slides. Therefore, in this section, we discuss the other
+different file formats that Gnuastro's library recognizes.
+
address@hidden
+* Text files::                  Reading and writing from/to plain text files.
+* TIFF files::                  Reading and writing from/to TIFF files.
+* JPEG files::                  Reading and writing from/to JPEG files.
+* EPS files::                   Writing to EPS files.
+* PDF files::                   Writing to PDF files.
address@hidden menu
+
address@hidden Text files, TIFF files, File input output, File input output
address@hidden Text files (@file{txt.h})
+
+The most universal and portable format for data storage are plain text
+files. They can be viewed and edited on any text editor or even on the
+command-line. This section are describes some functions that help in
+reading from and writing to plain text files.
+
+Lines are one of the most basic buiding blocks (delimiters) of a text
+file. Some operating systems like Microsoft Windows, terminate their ASCII
+text lines with a carriage return character and a new-line character (two
+characters, also known as CRLF line terminators). While Unix-like operating
+systems just use a single new-line character. The functions below that read
+an ASCII text file are able to identify lines with both kinds of line
+terminators.
+
+Gnuastro defines a simple format for metadata of table columns in a plain
+text file that is discussed in @ref{Gnuastro text table format}. The
+functions to get information from, read from and write to plain text files
+also follow those conventions.
+
+
address@hidden Macro GAL_TXT_LINESTAT_INVALID
address@hidden Macro GAL_TXT_LINESTAT_BLANK
address@hidden Macro GAL_TXT_LINESTAT_COMMENT
address@hidden Macro GAL_TXT_LINESTAT_DATAROW
+Status codes for lines in a plain text file that are returned by
address@hidden Lines which have a @key{#} character as their
+first non-white character are considered to be comments. Lines with nothing
+but white space characters are considered blank. The remaining lines are
+considered as containing data.
address@hidden deffn
+
address@hidden int gal_txt_line_stat (char @code{*line})
+Check the contents of @code{line} and see if it is a blank, comment, or
+data line. The returned values are the macros that start with
address@hidden
address@hidden deftypefun
+
address@hidden {gal_data_t *} gal_txt_table_info (char @code{*filename}, size_t 
@code{*numcols}, size_t @code{*numrows})
+Store the information of each column in @code{filename} into an array of
+data structures with @code{numcols} elements (one data structure for each
+column) see @ref{Arrays of datasets}. The total number of rows in the table
+is also put into the memory that @code{numrows} points to.
+
+This function is just for column information. Therefore it only stores
+meta-data like column name, units and comments. No actual data (contents of
+the columns for example the @code{array} or @code{dsize} elements) will be
+allocated by this function. This is a low-level function particular to
+reading tables in plain text format. To be generic, it is recommended to
+use @code{gal_table_info} which will allow getting information from a
+variety of table formats based on the filename (see @ref{Table input
+output}).
address@hidden deftypefun
+
address@hidden {gal_data_t *} gal_txt_table_read (char @code{*filename}, size_t 
@code{numrows}, gal_data_t @code{*colinfo}, gal_list_sizet_t @code{*indexll}, 
size_t @code{minmapsize})
+Read the columns given in the list @code{indexll} from a plain text table
+into a linked list of data structures, see @ref{List of size_t} and
address@hidden of gal_data_t}. If the necessary space for each column is larger
+than @code{minmapsize}, don't keep it in the RAM, but in a file on the
+HDD/SSD, see the description under the same name in @ref{Generic data
+container}.
+
+Note that this is a low-level function, so the output data list is the
+inverse of the input indexs linked list. It is recommended to use
address@hidden for generic reading of tables in any format, see
address@hidden input output}.
address@hidden deftypefun
+
address@hidden {gal_data_t *} gal_txt_image_read (char @code{*filename}, size_t 
@code{minmapsize})
+Read the 2D plain text dataset in @code{filename} into a dataset and return
+the dataset. If the necessary space for the image is larger than
address@hidden, don't keep it in the RAM, but in a file on the HDD/SSD,
+see the description under the same name in @ref{Generic data container}.
address@hidden deftypefun
+
address@hidden void gal_txt_write (gal_data_t @code{*cols}, gal_list_str_t 
@code{*comment}, char @code{*filename})
+Write @code{cols} in a plain text file @code{filename}. @code{cols} may
+have one or two dimensions which determines the output:
+
address@hidden @asis
address@hidden 1D
address@hidden is treated as a column and a list of datasets (see @ref{List of
+gal_data_t}): every node in the list is written as one column in a
+table.
+
address@hidden 2D
address@hidden is a two dimensional array, it cannot be treated as a list
+(only one 2D array can currently be written to a text file). So if
address@hidden>next!=NULL} the next nodes in the list are ignored and will not
+be written.
address@hidden table
+
+If @code{filename} already exists this function will abort with an error
+and will not write over the existing file. Please make sure if the file
+exists or not and take the appropriate action before calling this
+function. If @code{comments!=NULL}, a @code{#} will be put at the start of
+each node of the list of strings and will be written in the file before the
+column meta-data in @code{filename} (see @ref{List of strings}).
+
+This is a low-level function for tables. It is recommended to use
address@hidden for generic writing of tables in a variety of
+formats, see @ref{Table input output}.
address@hidden deftypefun
+
+
address@hidden TIFF files, JPEG files, Text files, File input output
address@hidden TIFF files (@file{tiff.h})
 
 @cindex TIFF format
 Outside of astronomy, the TIFF standard is arguably the most commonly used
@@ -22114,8 +22243,8 @@ directory's image contains multiple channels, the 
output will be a list
 
 
 
address@hidden JPEG files, Text files, TIFF files, Gnuastro library
address@hidden JPEG files (@file{jpeg.h})
address@hidden JPEG files, EPS files, TIFF files, File input output
address@hidden JPEG files (@file{jpeg.h})
 
 @cindex JPEG format
 The JPEG file format is one of the most common formats for storing and
@@ -22169,117 +22298,115 @@ through @code{widthincm}.
 
 
 
address@hidden Text files, World Coordinate System, JPEG files, Gnuastro library
address@hidden Text files (@file{txt.h})
address@hidden EPS files, PDF files, JPEG files, File input output
address@hidden EPS files (@file{eps.h})
 
-FITS files are the primary data container in astronomy. FITS indeed as many
-useful features, but the most universal and portable format for data
-storage are plain text files. They can be viewed and edited on any text
-editor or even on the command-line. Therefore the functions in this section
-are defined to simplify reading from and writing to plain text files.
+The Encapsulated PostScript (EPS) format is commonly used to store images
+(or individual/single-page parts of a document) in the PostScript
+documents. For a more complete introduction, please see @ref{Recognized
+file formats}. To provide high quality graphics, the Postscript language is
+a vectorized format, therefore pixels (elements of a ``rasterized'' format)
+aren't defined in their context.
 
-Lines are one of the most basic buiding blocks (delimiters) of a text
-file. Some operating systems like Microsoft Windows, terminate their ASCII
-text lines with a carriage return character and a new-line character (two
-characters, also known as CRLF line terminators). While Unix-like operating
-systems just use a single new-line character. The functions below that read
-an ASCII text file are able to identify lines with both kinds of line
-terminators.
-
-Gnuastro defines a simple format for metadata of table columns in a plain
-text file that is discussed in @ref{Gnuastro text table format}. The
-functions to get information from, read from and write to plain text files
-also follow those conventions.
+To display rasterized images, PostScript does allow arrays of
+pixels. However, since the over-all EPS file may contain many vectorized
+elements (for example borders, text, or other lines over the text) and
+interpretting them is not trivial or necessary within Gnuastro's scope,
+Gnuastro only provides some functions to write a dataset (in the
address@hidden format, see @ref{Generic data container}) into EPS.
 
address@hidden {int} gal_eps_name_is_eps (char @code{*name})
+Return @code{1} if @code{name} has an EPS suffix. This can be used to make
+sure that a given input file is EPS. See @code{gal_eps_suffix_is_eps} for a
+list of recognized suffixes.
address@hidden deftypefun
 
address@hidden Macro GAL_TXT_LINESTAT_INVALID
address@hidden Macro GAL_TXT_LINESTAT_BLANK
address@hidden Macro GAL_TXT_LINESTAT_COMMENT
address@hidden Macro GAL_TXT_LINESTAT_DATAROW
-Status codes for lines in a plain text file that are returned by
address@hidden Lines which have a @key{#} character as their
-first non-white character are considered to be comments. Lines with nothing
-but white space characters are considered blank. The remaining lines are
-considered as containing data.
address@hidden deffn
address@hidden {int} gal_eps_suffix_is_eps (char @code{*name})
+Return @code{1} if @code{suffix} is a recognized EPS suffix. The recognized
+suffixes are @code{.eps}, @code{.EPS}, @code{.epsf}, @code{.epsi}.
address@hidden deftypefun
 
address@hidden int gal_txt_line_stat (char @code{*line})
-Check the contents of @code{line} and see if it is a blank, comment, or
-data line. The returned values are the macros that start with
address@hidden
address@hidden {void} gal_eps_to_pt (float @code{widthincm}, size_t 
@code{*dsize}, size_t @code{*w_h_in_pt})
+Given a specific width in centimeters (@code{widthincm} and the number of
+the dataset's pixels in each dimension (@code{dsize}) calculate the size of
+the output in PostScript points. The output values are written in the
address@hidden array (which has to be allocated before calling this
+function). The first element in @code{w_h_in_pt} is the width and the
+second is the height of the image.
 @end deftypefun
 
address@hidden {gal_data_t *} gal_txt_table_info (char @code{*filename}, size_t 
@code{*numcols}, size_t @code{*numrows})
-Store the information of each column in @code{filename} into an array of
-data structures with @code{numcols} elements (one data structure for each
-column) see @ref{Arrays of datasets}. The total number of rows in the table
-is also put into the memory that @code{numrows} points to.
address@hidden {void} gal_eps_write (gal_data_t @code{*in}, char 
@code{*filename}, float @code{widthincm}, uint32_t @code{borderwidth}, int 
@code{hex}, int @code{forpdf})
+Write the @code{in} dataset into an EPS file called
address@hidden @code{in} has to be an unsigned 8-bit character type
+(@code{GAL_TYPE_UINT8}, see @ref{Numeric data types}). The desired width of
+the image in human/non-pixel units (to help the displayer) can be set with
+the @code{widthincm} argument. If @code{borderwidth} is non-zero, it is
+interpretted as the width (in points) of a solid black border around the
+image. A border can helpful when importing the EPS file into a document.
 
-This function is just for column information. Therefore it only stores
-meta-data like column name, units and comments. No actual data (contents of
-the columns for example the @code{array} or @code{dsize} elements) will be
-allocated by this function. This is a low-level function particular to
-reading tables in plain text format. To be generic, it is recommended to
-use @code{gal_table_info} which will allow getting information from a
-variety of table formats based on the filename (see @ref{Table input
-output}).
address@hidden ASCII85 encoding
address@hidden Hexadecimal encoding
+EPS files are plain-text (can be opened/edited in a text editor), therefore
+there are different encodings to store the data (pixel values) within
+them. Gnuastro supports the Hexadecimal and ASCII85 encoding. ASCII85 is
+more efficient (producing small file sizes), so it is the default
+encoding. To use Hexademical encoding, set @code{hex} to a non-zero
+value. Currently If you don't directly want to import the EPS file into a
+PostScript document but want to later compile it into a PDF file, set the
address@hidden argument to @code{1}.
 @end deftypefun
 
address@hidden {gal_data_t *} gal_txt_table_read (char @code{*filename}, size_t 
@code{numrows}, gal_data_t @code{*colinfo}, gal_list_sizet_t @code{*indexll}, 
size_t @code{minmapsize})
-Read the columns given in the list @code{indexll} from a plain text table
-into a linked list of data structures, see @ref{List of size_t} and
address@hidden of gal_data_t}. If the necessary space for each column is larger
-than @code{minmapsize}, don't keep it in the RAM, but in a file on the
-HDD/SSD, see the description under the same name in @ref{Generic data
-container}.
 
-Note that this is a low-level function, so the output data list is the
-inverse of the input indexs linked list. It is recommended to use
address@hidden for generic reading of tables in any format, see
address@hidden input output}.
address@hidden deftypefun
 
address@hidden {gal_data_t *} gal_txt_image_read (char @code{*filename}, size_t 
@code{minmapsize})
-Read the 2D plain text dataset in @code{filename} into a dataset and return
-the dataset. If the necessary space for the image is larger than
address@hidden, don't keep it in the RAM, but in a file on the HDD/SSD,
-see the description under the same name in @ref{Generic data container}.
address@hidden deftypefun
 
address@hidden void gal_txt_write (gal_data_t @code{*cols}, gal_list_str_t 
@code{*comment}, char @code{*filename})
-Write @code{cols} in a plain text file @code{filename}. @code{cols} may
-have one or two dimensions which determines the output:
 
address@hidden @asis
address@hidden 1D
address@hidden is treated as a column and a list of datasets (see @ref{List of
-gal_data_t}): every node in the list is written as one column in a
-table.
address@hidden PDF files,  , EPS files, File input output
address@hidden PDF files (@file{pdf.h})
 
address@hidden 2D
address@hidden is a two dimensional array, it cannot be treated as a list
-(only one 2D array can currently be written to a text file). So if
address@hidden>next!=NULL} the next nodes in the list are ignored and will not
-be written.
address@hidden table
+The portable document format (PDF) has arguably become the most common
+format used for distribution of documents. In practice, a PDF file is just
+a compiled PostScript file. For a more complete introduction, please see
address@hidden file formats}. To provide high quality graphics, the PDF is
+a vectorized format, therefore pixels (elements of a ``rasterized'' format)
+aren't defined in their context. As a result, similar to @ref{EPS files},
+Gnuastro only writes datasets to a PDF file, not vice-versa.
 
-If @code{filename} already exists this function will abort with an error
-and will not write over the existing file. Please make sure if the file
-exists or not and take the appropriate action before calling this
-function. If @code{comments!=NULL}, a @code{#} will be put at the start of
-each node of the list of strings and will be written in the file before the
-column meta-data in @code{filename} (see @ref{List of strings}).
address@hidden {int} gal_pdf_name_is_pdf (char @code{*name})
+Return @code{1} if @code{name} has an PDF suffix. This can be used to make
+sure that a given input file is PDF. See @code{gal_pdf_suffix_is_pdf} for a
+list of recognized suffixes.
address@hidden deftypefun
 
-This is a low-level function for tables. It is recommended to use
address@hidden for generic writing of tables in a variety of
-formats, see @ref{Table input output}.
address@hidden {int} gal_pdf_suffix_is_pdf (char @code{*name})
+Return @code{1} if @code{suffix} is a recognized PDF suffix. The recognized
+suffixes are @code{.pdf} and @code{.PDF}.
 @end deftypefun
 
address@hidden {void} gal_pdf_write (gal_data_t @code{*in}, char 
@code{*filename}, float @code{widthincm}, uint32_t @code{borderwidth})
+Write the @code{in} dataset into an EPS file called
address@hidden @code{in} has to be an unsigned 8-bit character type
+(@code{GAL_TYPE_UINT8}, see @ref{Numeric data types}). The desired width of
+the image in human/non-pixel units (to help the displayer) can be set with
+the @code{widthincm} argument. If @code{borderwidth} is non-zero, it is
+interpretted as the width (in points) of a solid black border around the
+image. A border can helpful when importing the PDF file into a
+document.
+
+This function is just a wrapper for the @code{gal_eps_write} function in
address@hidden files}. After making the EPS file, Ghostscript (with a version of
+9.10 or above, see @ref{Optional dependencies}) will be used to compile the
+EPS file to a PDF file. Therfore if GhostScript doesn't exist, doesn't have
+the proper version, or fails for any other reason, the EPS file will
+remain. It can be used to find the cause, or use another converter or
+PostScript compiler.
address@hidden deftypefun
+
+
 
 
 
 
address@hidden World Coordinate System, Arithmetic on datasets, Text files, 
Gnuastro library
address@hidden World Coordinate System, Arithmetic on datasets, File input 
output, Gnuastro library
 @subsection World Coordinate System (@file{wcs.h})
 
 The FITS standard defines the world coordinate system (WCS) as a mechanism
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 8c14596..850c7d7 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -57,10 +57,10 @@ libgnuastro_la_SOURCES = arithmetic.c arithmetic-and.c 
arithmetic-bitand.c \
   arithmetic-gt.c arithmetic-le.c arithmetic-lt.c arithmetic-minus.c       \
   arithmetic-modulo.c arithmetic-multiply.c arithmetic-ne.c                \
   arithmetic-or.c arithmetic-plus.c array.c binary.c blank.c box.c         \
-  checkset.c convolve.c cosmology.c data.c fits.c git.c interpolate.c      \
-  jpeg.c list.c match.c options.c permutation.c polygon.c qsort.c          \
-  dimension.c statistics.c table.c tableintern.c threads.c tiff.c tile.c   \
-  timing.c txt.c type.c wcs.c
+  checkset.c convolve.c cosmology.c data.c eps.c fits.c git.c              \
+  interpolate.c jpeg.c list.c match.c options.c pdf.c permutation.c        \
+  polygon.c qsort.c dimension.c statistics.c table.c tableintern.c         \
+  threads.c tiff.c tile.c timing.c txt.c type.c wcs.c
 
 
 
@@ -70,16 +70,16 @@ libgnuastro_la_SOURCES = arithmetic.c arithmetic-and.c 
arithmetic-bitand.c \
 # in the $(headersdir) directory. Some of the header files don't need to be
 # installed.
 headersdir=$(top_srcdir)/lib/gnuastro
-pkginclude_HEADERS = gnuastro/config.h $(headersdir)/arithmetic.h          \
-  $(headersdir)/array.h $(headersdir)/binary.h $(headersdir)/blank.h       \
-  $(headersdir)/box.h $(headersdir)/convolve.h $(headersdir)/cosmology.h   \
-  $(headersdir)/data.h $(headersdir)/dimension.h $(headersdir)/fits.h      \
-  $(headersdir)/git.h $(headersdir)/jpeg.h $(headersdir)/interpolate.h     \
-  $(headersdir)/list.h $(headersdir)/match.h $(headersdir)/permutation.h   \
-  $(headersdir)/polygon.h $(headersdir)/qsort.h $(headersdir)/statistics.h \
-  $(headersdir)/table.h $(headersdir)/threads.h $(headersdir)/tiff.h       \
-  $(headersdir)/tile.h $(headersdir)/txt.h $(headersdir)/type.h            \
-  $(headersdir)/wcs.h
+pkginclude_HEADERS = gnuastro/config.h $(headersdir)/arithmetic.h         \
+  $(headersdir)/array.h $(headersdir)/binary.h $(headersdir)/blank.h      \
+  $(headersdir)/box.h $(headersdir)/convolve.h $(headersdir)/cosmology.h  \
+  $(headersdir)/data.h $(headersdir)/dimension.h $(headersdir)/eps.h      \
+  $(headersdir)/fits.h $(headersdir)/git.h $(headersdir)/jpeg.h           \
+  $(headersdir)/interpolate.h $(headersdir)/list.h $(headersdir)/match.h  \
+  $(headersdir)/pdf.h $(headersdir)/permutation.h $(headersdir)/polygon.h \
+  $(headersdir)/qsort.h $(headersdir)/statistics.h $(headersdir)/table.h  \
+  $(headersdir)/threads.h $(headersdir)/tiff.h $(headersdir)/tile.h       \
+  $(headersdir)/txt.h $(headersdir)/type.h $(headersdir)/wcs.h
 
 
 
diff --git a/lib/eps.c b/lib/eps.c
new file mode 100644
index 0000000..7a530b4
--- /dev/null
+++ b/lib/eps.c
@@ -0,0 +1,438 @@
+/*********************************************************************
+eps -- functions to write EPS files.
+This is part of GNU Astronomy Utilities (Gnuastro) package.
+
+Original author:
+     Mohammad Akhlaghi <address@hidden>
+Contributing author(s):
+Copyright (C) 2015-2018, Free Software Foundation, Inc.
+
+Gnuastro is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation, either version 3 of the License, or (at your
+option) any later version.
+
+Gnuastro is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
+**********************************************************************/
+#include <config.h>
+
+#include <stdio.h>
+#include <errno.h>
+#include <error.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <gnuastro/eps.h>
+#include <gnuastro/list.h>
+
+#include <gnuastro-internal/timing.h>
+#include <gnuastro-internal/checkset.h>
+
+
+
+
+
+
+/*************************************************************
+ **************      Acceptable EPS names      ***************
+ *************************************************************/
+int
+gal_eps_name_is_eps(char *name)
+{
+  size_t len;
+  len=strlen(name);
+  if ( ( len>=3 && strcmp(&name[len-3], "eps") == 0 )
+       || ( len>=3 && strcmp(&name[len-3], "EPS") == 0 )
+       || ( len>=4 && strcmp(&name[len-4], "epsf") == 0 )
+       || ( len>=4 && strcmp(&name[len-4], "epsi") == 0 ) )
+    return 1;
+  else
+    return 0;
+}
+
+
+
+
+
+int
+gal_eps_suffix_is_eps(char *name)
+{
+  if (strcmp(name, "eps") == 0 || strcmp(name, ".eps") == 0
+      || strcmp(name, "EPS") == 0 || strcmp(name, ".EPS") == 0
+      || strcmp(name, "epsf") == 0 || strcmp(name, ".epsf") == 0
+      || strcmp(name, "epsi") == 0 || strcmp(name, ".epsi") == 0)
+    return 1;
+  else
+    return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*************************************************************
+ **************       Write an EPS image        **************
+ *************************************************************/
+static int
+eps_is_binary(gal_data_t *in, uint8_t *bitone)
+{
+  gal_data_t *channel;
+  uint8_t second_set=0;
+  unsigned char *i, *fi, first=0, second=0;
+
+  /* Go through all the channels. */
+  for(channel=in; channel!=NULL; channel=channel->next)
+    {
+      /* Go through all the values and see if there is more than two values
+         in the array. */
+      fi = (i=channel->array) + channel->size;
+      first=*i;
+      do
+        if(*i!=first)
+          {
+            if(second_set)
+              { if(*i!=second) break; }
+            else
+              { second=*i; second_set=1; }
+          }
+      while(++i<fi);
+
+      /* If we didn't get to the end of the array, then we have a
+         multi-valued (not binary) image. */
+      if(i!=fi)
+        return 0;
+    }
+
+  /* If we get to this point, then all the channels were binary, so return
+     success. */
+  *bitone = first>second ? first : second;
+  return 1;
+}
+
+
+
+
+
+/* Convert the channels into into a 0 and 1 bit stream. This function is
+   only called when the image is binary (has only two values). NOTE: each
+   row has to have an integer number of bytes, so when the number of pixels
+   in a row is not a multiple of 8, we'll add one. */
+static gal_data_t *
+eps_convert_to_bitstream(gal_data_t *in, size_t *numbytes, uint8_t bitone)
+{
+  size_t i, j, k, bytesinrow;
+  gal_data_t *channel, *out=NULL;
+  unsigned char *bits, byte, curbit, *arr;
+  size_t s0=in->dsize[0], s1=in->dsize[1];
+
+  /* Find the size values and allocate the array. */
+  if( s1 % 8 ) bytesinrow = s1/8 + 1;
+  else         bytesinrow = s1/8;
+  *numbytes = bytesinrow*s0;
+
+  /* Go over all the channels. */
+  for(channel=in; channel!=NULL; channel=channel->next)
+    {
+      /* Allocate the array. Note that we currently don't have an
+         allocation system for bits, so we'll allocate space in bytes, then
+         convert  */
+      gal_list_data_add_alloc(&out, NULL, GAL_TYPE_UINT8, 1, numbytes,
+                              NULL, 0, -1, NULL, NULL, NULL);
+      out->type=GAL_TYPE_BIT;
+      bits=out->array;
+
+      /* Put the values in. */
+      arr=channel->array;
+      for(i=0;i<s0;++i)           /* i*s0+j is the byte, not bit position. */
+        for(j=0;j<bytesinrow;++j)
+          {
+            /* Set the 8 bits to zero. */
+            byte=0;
+
+            /* Current bit position. */
+            curbit=0x80;
+
+            /* Write the next 8 values as bits. */
+            for(k=0;k<8;++k)
+              {
+                if( j*8+k < s1 )
+                  {
+                    if(arr[i*s1+j*8+k]==bitone)
+                      byte |= curbit;
+                    curbit >>= 1;
+                  }
+                else break;
+              }
+
+            /* Write the byte into the array. */
+            bits[i*bytesinrow+j]=byte;
+          }
+    }
+
+  /* Reverse the list and return it. */
+  gal_list_data_reverse(&out);
+  return out;
+}
+
+
+
+
+
+static void
+eps_write_hex(gal_data_t *write, FILE *fp, size_t numbytes)
+{
+  unsigned char *arr;
+  gal_data_t *channel;
+  size_t i=0, j, elem_for_newline=35;
+
+  for(channel=write; channel!=NULL; channel=channel->next)
+    {
+      if(channel->status)       /* A blank channel has status==1. */
+        fprintf(fp, "{<00>} %% Channel %zu is blank\n", i);
+      else
+        {
+          arr=channel->array;
+          fprintf(fp, "{<");
+          for(j=0;j<numbytes;++j)
+            {
+              fprintf(fp, "%02X", arr[j]);
+              if(j%elem_for_newline==0) fprintf(fp, "\n");
+            }
+          fprintf(fp, ">}\n");
+        }
+      ++i;
+    }
+}
+
+
+
+
+
+static void
+eps_write_ascii85(gal_data_t *write, FILE *fp, size_t numbytes)
+{
+  unsigned char *arr;
+  gal_data_t *channel;
+  uint32_t anint, base;
+  size_t i=0, j, k, elem_for_newline=15;   /* 15*5=75 */
+
+  for(channel=write; channel!=NULL; channel=channel->next)
+    {
+      if(channel->status)
+        fprintf(fp, "{<00>} %% Channel %zu is blank\n", i);
+      else
+        {
+          arr=channel->array;
+          fprintf(fp, "{<~");
+          for(j=0;j<numbytes;j+=4)
+            {
+              /* This is the last four bytes */
+              if(numbytes-j<4)
+                {
+                  anint=arr[j]*256*256*256;
+                  if(numbytes-j>1)  anint+=arr[j+1]*256*256;
+                  if(numbytes-j==3) anint+=arr[j+2]*256;
+                }
+              else
+                anint=( arr[j]*256*256*256 + arr[j+1]*256*256
+                        + arr[j+2]*256     + arr[j+3]         );
+
+              /* If all four bytes are zero, then just print `z'. */
+              if(anint==0) fprintf(fp, "z");
+              else
+                {
+                  /* To check, just change the fprintf below to printf:
+                     printf("\n\n");
+                     printf("%u %u %u %u\n", in[i], in[i+1],
+                            in[i+2], in[i+3]);
+                  */
+                  base=85*85*85*85;
+                  /* Do the ASCII85 encoding: */
+                  for(k=0;k<5;++k)
+                    {
+                      fprintf(fp, "%c", anint/base+33);
+                      anint%=base;
+                      base/=85;
+                    }
+                }
+              /* Go to the next line if on the right place: */
+              if(j%elem_for_newline==0) fprintf(fp, "\n");
+            }
+          fprintf(fp, "~>}\n");
+        }
+      ++i;
+    }
+}
+
+
+
+
+
+static void
+eps_write_image(gal_data_t *in, FILE *fp, int hex)
+{
+  int bpc=8;
+  uint8_t bitone;
+  gal_data_t *write;
+  size_t i, numbytes, *dsize=in->dsize;
+  size_t numch=gal_list_data_number(in);
+
+  /* Set the number of bits per component. */
+  if( numch==1 && eps_is_binary(in, &bitone) )
+    {
+      bpc=1;
+      write=eps_convert_to_bitstream(in, &numbytes, bitone);
+    }
+  else
+    {
+      write=in;
+      numbytes=in->size;
+    }
+
+  /* Write the basic meta data. */
+  switch(numch)
+    {
+    case 1: fprintf(fp, "/DeviceGray setcolorspace\n"); break;
+    case 3: fprintf(fp, "/DeviceRGB setcolorspace\n");  break;
+    case 4: fprintf(fp, "/DeviceCMYK setcolorspace\n"); break;
+    default:
+      error(EXIT_FAILURE, 0, "%s: a bug! The number of channels (%zu) is "
+            "not 1, 3 or 4. Please contact us so we can find the issue and "
+            "fix it", __func__, numch);
+    }
+  fprintf(fp, "<<\n");
+  fprintf(fp, "  /ImageType 1\n");
+  fprintf(fp, "  /Width %zu\n", dsize[1]);
+  fprintf(fp, "  /Height %zu\n", dsize[0]);
+  fprintf(fp, "  /ImageMatrix [ %zu 0 0 %zu 0 0 ]\n", dsize[1], dsize[0]);
+  fprintf(fp, "  /MultipleDataSources true\n");
+  fprintf(fp, "  /BitsPerComponent %d\n", bpc);
+  fprintf(fp, "  /Decode[");
+  for(i=0;i<numch;++i) {fprintf(fp, " 0 1");} fprintf(fp, " ]\n");
+  fprintf(fp, "  /Interpolate false\n");
+  fprintf(fp, "  /DataSource [\n");
+
+  /* Based on the encoding, write the contents of the image. */
+  if(hex)
+    eps_write_hex(write, fp, numbytes);
+  else
+    eps_write_ascii85(write, fp, numbytes);
+
+  /* Finish the file. */
+  fprintf(fp, "  ]\n");
+  fprintf(fp, ">>\n");
+  fprintf(fp, "image\n\n");
+
+  /* Clean up. */
+  if(write!=in)
+    gal_list_data_free(write);
+}
+
+
+
+
+
+void
+gal_eps_to_pt(float widthincm, size_t *dsize, size_t *w_h_in_pt)
+{
+  w_h_in_pt[0] = widthincm*72.0f/2.54f;
+  w_h_in_pt[1] = (float)( dsize[0] * w_h_in_pt[0] )/(float)(dsize[1]);
+}
+
+
+
+
+
+void
+gal_eps_write(gal_data_t *in, char *filename, float widthincm,
+              uint32_t borderwidth, int hex, int forpdf)
+{
+  FILE *fp;
+  float hbw;
+  time_t rawtime;
+  size_t numch=gal_list_data_number(in);
+  size_t w_h_in_pt[2], *dsize=in->dsize;
+
+  /* Sanity checks. */
+  if(numch==2 || numch>4)
+    error(EXIT_FAILURE, 0, "%s: only 1, 3, and 4 color channels are "
+          "acceptable, input is a list of %zu data sets", __func__, numch);
+  if(in->type!=GAL_TYPE_UINT8)
+    error(EXIT_FAILURE, 0, "%s: input has a `%s' type, but JPEG images can "
+          "only have a `uint8' type", __func__, gal_type_name(in->type, 1));
+
+
+  /* Read the time to write in the output. */
+  time(&rawtime);
+
+
+  /* Find the bounding box  */
+  hbw=(float)borderwidth/2.0;
+  gal_eps_to_pt(widthincm, dsize, w_h_in_pt);
+
+
+  /* Open the output file and write the top comments. */
+  errno=0;
+  fp=fopen(filename, "w");
+  if(fp==NULL)
+    error(EXIT_FAILURE, errno, "%s", filename);
+  fprintf(fp, "%%!PS-Adobe-3.0 EPSF-3.0\n");
+  fprintf(fp, "%%%%BoundingBox: 0 0 %zu %zu\n", w_h_in_pt[0]+2*borderwidth,
+          w_h_in_pt[1]+2*borderwidth);
+  fprintf(fp, "%%%%Creator: %s\n", PACKAGE_STRING);
+  fprintf(fp, "%%%%CreationDate: %s", ctime(&rawtime));
+  fprintf(fp, "%%%%LanuageLevel: 3\n");
+  fprintf(fp, "%%%%EndComments\n\n");
+  if(forpdf==0)
+    fprintf(fp, "gsave\n\n");
+
+
+  /* Commands to draw the border: */
+  if(borderwidth)
+    {
+      fprintf(fp, "%% Draw the border:\n");
+      fprintf(fp, "0 setgray\n");
+      fprintf(fp, "%d setlinewidth\n", borderwidth);
+      fprintf(fp, "%.1f %.1f moveto\n", hbw, hbw);
+      fprintf(fp, "0 %zu rlineto\n", w_h_in_pt[1]+borderwidth);
+      fprintf(fp, "%zu 0 rlineto\n", w_h_in_pt[0]+borderwidth);
+      fprintf(fp, "0 -%zu rlineto\n", w_h_in_pt[1]+borderwidth);
+      fprintf(fp, "closepath\n");
+      fprintf(fp, "stroke\n\n");
+    }
+
+
+  /* Write the image: */
+  fprintf(fp, "%% Draw the image:\n");
+  fprintf(fp, "%d %d translate\n", borderwidth, borderwidth);
+  fprintf(fp, "%zu %zu scale\n", w_h_in_pt[0], w_h_in_pt[1]);
+  eps_write_image(in, fp, hex);
+
+
+  /* Ending of the EPS file: */
+  if(forpdf) fprintf(fp, "showpage\n");
+  else       fprintf(fp, "grestore\n");
+  fprintf(fp, "%%%%EOF");
+  fclose(fp);
+}
diff --git a/lib/gnuastro/eps.h b/lib/gnuastro/eps.h
new file mode 100644
index 0000000..ab8ed3d
--- /dev/null
+++ b/lib/gnuastro/eps.h
@@ -0,0 +1,75 @@
+/*********************************************************************
+eps -- functions to write EPS files.
+This is part of GNU Astronomy Utilities (Gnuastro) package.
+
+Original author:
+     Mohammad Akhlaghi <address@hidden>
+Contributing author(s):
+Copyright (C) 2015-2018, Free Software Foundation, Inc.
+
+Gnuastro is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation, either version 3 of the License, or (at your
+option) any later version.
+
+Gnuastro is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
+**********************************************************************/
+#ifndef __GAL_EPS_H__
+#define __GAL_EPS_H__
+
+
+/* Include other headers if necessary here. Note that other header files
+   must be included before the C++ preparations below */
+#include <gnuastro/data.h>
+
+
+
+/* C++ Preparations */
+#undef __BEGIN_C_DECLS
+#undef __END_C_DECLS
+#ifdef __cplusplus
+# define __BEGIN_C_DECLS extern "C" {
+# define __END_C_DECLS }
+#else
+# define __BEGIN_C_DECLS                /* empty */
+# define __END_C_DECLS                  /* empty */
+#endif
+/* End of C++ preparations */
+
+
+
+
+
+/* Actual header contants (the above were for the Pre-processor). */
+__BEGIN_C_DECLS  /* From C++ preparations */
+
+
+
+
+
+/* Functions */
+int
+gal_eps_name_is_eps(char *name);
+
+int
+gal_eps_suffix_is_eps(char *name);
+
+void
+gal_eps_to_pt(float widthincm, size_t *dsize, size_t *w_h_in_pt);
+
+void
+gal_eps_write(gal_data_t *in, char *filename, float widthincm,
+              uint32_t borderwidth, int hex, int forpdf);
+
+
+
+
+__END_C_DECLS    /* From C++ preparations */
+
+#endif           /* __GAL_TIFF_H__ */
diff --git a/lib/gnuastro/pdf.h b/lib/gnuastro/pdf.h
new file mode 100644
index 0000000..033a8e4
--- /dev/null
+++ b/lib/gnuastro/pdf.h
@@ -0,0 +1,72 @@
+/*********************************************************************
+pdf -- functions to write PDF files.
+This is part of GNU Astronomy Utilities (Gnuastro) package.
+
+Original author:
+     Mohammad Akhlaghi <address@hidden>
+Contributing author(s):
+Copyright (C) 2015-2018, Free Software Foundation, Inc.
+
+Gnuastro is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation, either version 3 of the License, or (at your
+option) any later version.
+
+Gnuastro is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
+**********************************************************************/
+#ifndef __GAL_PDF_H__
+#define __GAL_PDF_H__
+
+
+/* Include other headers if necessary here. Note that other header files
+   must be included before the C++ preparations below */
+#include <gnuastro/data.h>
+
+
+
+/* C++ Preparations */
+#undef __BEGIN_C_DECLS
+#undef __END_C_DECLS
+#ifdef __cplusplus
+# define __BEGIN_C_DECLS extern "C" {
+# define __END_C_DECLS }
+#else
+# define __BEGIN_C_DECLS                /* empty */
+# define __END_C_DECLS                  /* empty */
+#endif
+/* End of C++ preparations */
+
+
+
+
+
+/* Actual header contants (the above were for the Pre-processor). */
+__BEGIN_C_DECLS  /* From C++ preparations */
+
+
+
+
+
+/* Functions */
+int
+gal_pdf_name_is_pdf(char *name);
+
+int
+gal_pdf_suffix_is_pdf(char *name);
+
+void
+gal_pdf_write(gal_data_t *in, char *filename, float widthincm,
+              uint32_t borderwidth);
+
+
+
+
+__END_C_DECLS    /* From C++ preparations */
+
+#endif           /* __GAL_TIFF_H__ */
diff --git a/lib/pdf.c b/lib/pdf.c
new file mode 100644
index 0000000..794a9f5
--- /dev/null
+++ b/lib/pdf.c
@@ -0,0 +1,125 @@
+/*********************************************************************
+pdf -- functions to write PDF files.
+This is part of GNU Astronomy Utilities (Gnuastro) package.
+
+Original author:
+     Mohammad Akhlaghi <address@hidden>
+Contributing author(s):
+Copyright (C) 2015-2018, Free Software Foundation, Inc.
+
+Gnuastro is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation, either version 3 of the License, or (at your
+option) any later version.
+
+Gnuastro is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
+**********************************************************************/
+#include <config.h>
+
+#include <stdio.h>
+#include <errno.h>
+#include <error.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <gnuastro/eps.h>
+#include <gnuastro/pdf.h>
+
+#include <gnuastro-internal/checkset.h>
+
+
+
+
+/*************************************************************
+ **************      Acceptable PDF names      ***************
+ *************************************************************/
+int
+gal_pdf_name_is_pdf(char *name)
+{
+  size_t len;
+  len=strlen(name);
+  if (strcmp(&name[len-3], "pdf") == 0
+      || strcmp(&name[len-3], "PDF") == 0)
+    return 1;
+  else
+    return 0;
+}
+
+
+
+
+
+int
+gal_pdf_suffix_is_pdf(char *name)
+{
+  if (strcmp(name, "pdf") == 0 || strcmp(name, ".pdf") == 0
+      || strcmp(name, "PDF") == 0 || strcmp(name, ".PDF") == 0)
+    return 1;
+  else
+    return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*************************************************************
+ **************        Write a PDF image       ***************
+ *************************************************************/
+void
+gal_pdf_write(gal_data_t *in, char *filename, float widthincm,
+              uint32_t borderwidth)
+{
+  char command[20000];
+  size_t w_h_in_pt[2];
+  char *epsname=gal_checkset_malloc_cat(filename, ".ps");
+
+  /* Write the EPS file. */
+  gal_eps_write(in, epsname, widthincm, borderwidth, 0, 1);
+
+  /* Get the size of the image in `pt' units. */
+  gal_eps_to_pt(widthincm, in->dsize, w_h_in_pt);
+
+  /* Write the ghostscript command to compile the EPS file to PDF. */
+  sprintf(command, "gs -q -o %s -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=%zu"
+          " -dDEVICEHEIGHTPOINTS=%zu -dPDFFitPage %s", filename,
+          w_h_in_pt[0]+2*borderwidth, w_h_in_pt[1]+2*borderwidth,
+          epsname);
+
+  /* Run Ghostscript. */
+  if(system(command))
+    error(EXIT_FAILURE, 0, "the command to convert a PostScript file to "
+          "PDF (`%s') was not successful! The PostScript file (%s) is "
+          "left if you want to convert or use it through any other "
+          "means", command, epsname);
+
+  /* Delete the EPS file. */
+  errno=0;
+  if(unlink(epsname))
+    error(EXIT_FAILURE, errno, "%s", epsname);
+
+  /* Clean up. */
+  free(epsname);
+}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]