src/pdfio.c
l_int32
concatenatePdf(const char  *dirname,
               const char  *substr,
               const char  *fileout)
{
l_int32  ret;
SARRAY  *sa;

    PROCNAME("concatenatePdf");

    if (!dirname)
        return ERROR_INT("dirname not defined", procName, 1);
    if (!fileout)
        return ERROR_INT("fileout not defined", procName, 1);

    if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
        return ERROR_INT("sa not made", procName, 1);
    ret = saConcatenatePdf(sa, fileout);
    sarrayDestroy(&sa);
    return ret;
}
/*!
 *  concatenatePdf()
 *
 *      Input:  directory name (containing single-page pdf files)
 *              substr (<optional> substring filter on filenames; can be NULL)
 *              fileout (concatenated pdf file)
 *      Return: 0 if OK, 1 on error
 *
 *  Notes:
 *      (1) This only works with leptonica-formatted single-page pdf files.
 *      (2) If @substr is not NULL, only filenames that contain
 *          the substring can be returned.  If @substr == NULL,
 *          none of the filenames are filtered out.
 *      (3) The files in the directory, after optional filtering by
 *          the substring, are lexically sorted in increasing order
 *          before concatenation.
 */
concatenatePdf()
Input:  directory name (containing single-page pdf files)
substr ( substring filter on filenames; can be NULL)
fileout (concatenated pdf file)
Return: 0 if OK, 1 on error

(1) This only works with leptonica-formatted single-page pdf files.
(2) If @substr is not NULL, only filenames that contain
the substring can be returned.  If @substr == NULL,
none of the filenames are filtered out.
(3) The files in the directory, after optional filtering by
the substring, are lexically sorted in increasing order
before concatenation.
concatenatePdf () Input : directory name ( containing single - page pdf files ) substr ( substring filter on filenames ; can be NULL ) fileout ( concatenated pdf file ) Return : 0 if OK 1 on error ( 1 ) This only works with leptonica - formatted single - page pdf files . ( 2 ) If @substr is not NULL only filenames that contain the substring can be returned . If @substr == NULL none of the filenames are filtered out . ( 3 ) The files in the directory after optional filtering by the substring are lexically sorted in increasing order before concatenation .
l_int32
concatenatePdf(const char  *dirname,
               const char  *substr,
               const char  *fileout)
{
l_int32  ret;
SARRAY  *sa;
    PROCNAME("concatenatePdf");
    if (!dirname)
        return ERROR_INT("dirname not defined", procName, 1);
    if (!fileout)
        return ERROR_INT("fileout not defined", procName, 1);
    if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
        return ERROR_INT("sa not made", procName, 1);
    ret = saConcatenatePdf(sa, fileout);
    sarrayDestroy(&sa);
    return ret;
}
l_int32 concatenatePdf ( const char * dirname , const char * substr , const char * fileout ) { l_int32 ret ; SARRAY * sa ; PROCNAME ( " " ) ; if ( ! dirname ) return ERROR_INT ( " " , procName , 1 ) ; if ( ! fileout ) return ERROR_INT ( " " , procName , 1 ) ; if ( ( sa = getSortedPathnamesInDirectory ( dirname , substr , 0 , 0 ) ) == NULL ) return ERROR_INT ( " " , procName , 1 ) ; ret = saConcatenatePdf ( sa , fileout ) ; sarrayDestroy ( & sa ) ; return ret ; }
concatenatePdf()
      Input:  directory name (containing single-page pdf files)
              substr (<optional> substring filter on filenames; can be NULL)
              fileout (concatenated pdf file)
      Return: 0 if OK, 1 on error
concatenatePdf () Input : directory name ( containing single - page pdf files ) substr ( <optional > substring filter on filenames ; can be NULL ) fileout ( concatenated pdf file ) Return : 0 if OK 1 on error