src/psio1.c
l_int32
convertFilesToPS(const char  *dirin,
                 const char  *substr,
                 l_int32      res,
                 const char  *fileout)
{
SARRAY  *sa;

    PROCNAME("convertFilesToPS");

    if (!dirin)
        return ERROR_INT("dirin not defined", procName, 1);
    if (!fileout)
        return ERROR_INT("fileout not defined", procName, 1);
    if (res <= 0) {
        L_INFO("setting res to 300 ppi", procName);
        res = 300;
    }
    if (res < 10 || res > 4000)
        L_WARNING("res is typically in the range 300-600 ppi", procName);

        /* Get all filtered and sorted full pathnames. */
    sa = getSortedPathnamesInDirectory(dirin, substr, 0, 0);

        /* Generate the PS file.  Don't use bounding boxes. */
    l_psWriteBoundingBox(FALSE);
    sarrayConvertFilesToPS(sa, res, fileout);
    l_psWriteBoundingBox(TRUE);
    sarrayDestroy(&sa);
    return 0;
}
/*
 *  convertFilesToPS()
 *
 *      Input:  dirin (input directory)
 *              substr (<optional> substring filter on filenames; can be NULL)
 *              res (typ. 300 or 600 ppi)
 *              fileout (output ps file)
 *      Return: 0 if OK, 1 on error
 *
 *  Notes:
 *      (1) This generates a PS file for all image files in a specified
 *          directory that contain the substr pattern to be matched.
 *      (2) Each image is written to a separate page in the output PS file.
 *      (3) All images are written compressed:
 *              * if tiffg4  -->  use ccittg4
 *              * if jpeg    -->  use dct
 *              * all others -->  use flate
 *          If the image is jpeg or tiffg4, we use the existing compressed
 *          strings for the encoding; otherwise, we read the image into
 *          a pix and flate-encode the pieces.
 *      (4) The resolution is often confusing.  It is interpreted
 *          as the resolution of the output display device:  "If the
 *          input image were digitized at 300 ppi, what would it
 *          look like when displayed at res ppi."  So, for example,
 *          if res = 100 ppi, then the display pixels are 3x larger
 *          than the 300 ppi pixels, and the image will be rendered
 *          3x larger.
 *      (5) The size of the PostScript file is independent of the resolution,
 *          because the entire file is encoded.  The res parameter just
 *          tells the PS decomposer how to render the page.  Therefore,
 *          for minimum file size without loss of visual information,
 *          if the output res is less than 300, you should downscale
 *          the image to the output resolution before wrapping in PS.
 *      (6) The "canvas" on which the image is rendered, at the given
 *          output resolution, is a standard page size (8.5 x 11 in).
 */
convertFilesToPS()
Input:  dirin (input directory)
substr ( substring filter on filenames; can be NULL)
res (typ. 300 or 600 ppi)
fileout (output ps file)
Return: 0 if OK, 1 on error

(1) This generates a PS file for all image files in a specified
directory that contain the substr pattern to be matched.
(2) Each image is written to a separate page in the output PS file.
convertFilesToPS () Input : dirin ( input directory ) substr ( substring filter on filenames ; can be NULL ) res ( typ . 300 or 600 ppi ) fileout ( output ps file ) Return : 0 if OK 1 on error ( 1 ) This generates a PS file for all image files in a specified directory that contain the substr pattern to be matched . ( 2 ) Each image is written to a separate page in the output PS file .
l_int32
convertFilesToPS(const char  *dirin,
                 const char  *substr,
                 l_int32      res,
                 const char  *fileout)
{
SARRAY  *sa;
    PROCNAME("convertFilesToPS");
    if (!dirin)
        return ERROR_INT("dirin not defined", procName, 1);
    if (!fileout)
        return ERROR_INT("fileout not defined", procName, 1);
    if (res <= 0) {
        L_INFO("setting res to 300 ppi", procName);
        res = 300;
    }
    if (res < 10 || res > 4000)
        L_WARNING("res is typically in the range 300-600 ppi", procName);
    sa = getSortedPathnamesInDirectory(dirin, substr, 0, 0);
    l_psWriteBoundingBox(FALSE);
    sarrayConvertFilesToPS(sa, res, fileout);
    l_psWriteBoundingBox(TRUE);
    sarrayDestroy(&sa);
    return 0;
}
l_int32 convertFilesToPS ( const char * dirin , const char * substr , l_int32 res , const char * fileout ) { SARRAY * sa ; PROCNAME ( " " ) ; if ( ! dirin ) return ERROR_INT ( " " , procName , 1 ) ; if ( ! fileout ) return ERROR_INT ( " " , procName , 1 ) ; if ( res <= 0 ) { L_INFO ( " " , procName ) ; res = 300 ; } if ( res < 10 || res > 4000 ) L_WARNING ( " " , procName ) ; sa = getSortedPathnamesInDirectory ( dirin , substr , 0 , 0 ) ; l_psWriteBoundingBox ( FALSE ) ; sarrayConvertFilesToPS ( sa , res , fileout ) ; l_psWriteBoundingBox ( TRUE ) ; sarrayDestroy ( & sa ) ; return 0 ; }
convertFilesToPS()
      Input:  dirin (input directory)
              substr (<optional> substring filter on filenames; can be NULL)
              res (typ.
convertFilesToPS () Input : dirin ( input directory ) substr ( <optional > substring filter on filenames ; can be NULL ) res ( typ .
/* Get all filtered and sorted full pathnames. */ /* Generate the PS file.  Don't use bounding boxes. */