194 #include "allheaders.h" 201 static const l_int32 DEFAULT_INPUT_RES = 300;
242 l_float32 scalefactor,
251 PROCNAME(
"convertFilesToPdf");
254 return ERROR_INT(
"dirname not defined", procName, 1);
256 return ERROR_INT(
"fileout not defined", procName, 1);
259 return ERROR_INT(
"sa not made", procName, 1);
289 l_float32 scalefactor,
299 PROCNAME(
"saConvertFilesToPdf");
302 return ERROR_INT(
"sa not defined", procName, 1);
305 title, &data, &nbytes);
307 if (data) LEPT_FREE(data);
308 return ERROR_INT(
"pdf data not made", procName, 1);
314 L_ERROR(
"pdf data not written to file\n", procName);
342 l_float32 scalefactor,
350 const char *pdftitle;
352 l_int32 i, n, ret, pagetype, npages, scaledres;
358 PROCNAME(
"saConvertFilesToPdfData");
361 return ERROR_INT(
"&data not defined", procName, 1);
364 return ERROR_INT(
"&nbytes not defined", procName, 1);
367 return ERROR_INT(
"sa not defined", procName, 1);
368 if (scalefactor <= 0.0) scalefactor = 1.0;
370 L_WARNING(
"invalid compression type; using per-page default\n",
379 for (i = 0; i < n; i++) {
380 if (i && (i % 10 == 0)) fprintf(stderr,
".. %d ", i);
382 if ((pixs =
pixRead(fname)) == NULL) {
383 L_ERROR(
"image not readable from file %s\n", procName, fname);
387 pdftitle = (title) ? title : fname;
388 if (scalefactor != 1.0)
389 pix =
pixScale(pixs, scalefactor, scalefactor);
393 scaledres = (l_int32)(res * scalefactor);
398 L_ERROR(
"encoding type selection failed for file %s\n",
403 0, 0, scaledres, pdftitle, NULL, 0);
407 L_ERROR(
"pdf encoding failed for %s\n", procName, fname);
416 L_ERROR(
"no pdf files made\n", procName);
422 fprintf(stderr,
"\nconcatenating ... ");
424 fprintf(stderr,
"done\n");
427 for (i = 0; i < npages; i++) {
460 l_int32 w, h, d, factor, ncolors;
463 PROCNAME(
"selectDefaultPdfEncoding");
466 return ERROR_INT(
"pix not defined", procName, 1);
468 return ERROR_INT(
"&type not defined", procName, 1);
471 cmap = pixGetColormap(pix);
472 if (d == 8 && !cmap) {
473 factor = L_MAX(1, (l_int32)sqrt((l_float64)(w * h) / 20000.));
481 }
else if (cmap || d == 2 || d == 4) {
483 }
else if (d == 8 || d == 32) {
486 return ERROR_INT(
"type selection failure", procName, 1);
528 PROCNAME(
"convertUnscaledFilesToPdf");
531 return ERROR_INT(
"dirname not defined", procName, 1);
533 return ERROR_INT(
"fileout not defined", procName, 1);
536 return ERROR_INT(
"sa not made", procName, 1);
566 PROCNAME(
"saConvertUnscaledFilesToPdf");
569 return ERROR_INT(
"sa not defined", procName, 1);
573 if (data) LEPT_FREE(data);
574 return ERROR_INT(
"pdf data not made", procName, 1);
580 L_ERROR(
"pdf data not written to file\n", procName);
603 l_int32 i, n, ret, npages;
608 PROCNAME(
"saConvertUnscaledFilesToPdfData");
611 return ERROR_INT(
"&data not defined", procName, 1);
614 return ERROR_INT(
"&nbytes not defined", procName, 1);
617 return ERROR_INT(
"sa not defined", procName, 1);
622 for (i = 0; i < n; i++) {
623 if (i && (i % 10 == 0)) fprintf(stderr,
".. %d ", i);
632 if (imdata) LEPT_FREE(imdata);
637 L_ERROR(
"no pdf files made\n", procName);
643 fprintf(stderr,
"\nconcatenating ... ");
645 fprintf(stderr,
"done\n");
649 for (i = 0; i < npages; i++) {
673 const char *pdftitle = NULL;
678 PROCNAME(
"convertUnscaledToPdfData");
681 return ERROR_INT(
"&data not defined", procName, 1);
684 return ERROR_INT(
"&nbytes not defined", procName, 1);
687 return ERROR_INT(
"fname not defined", procName, 1);
690 if (format == IFF_UNKNOWN) {
691 L_WARNING(
"file %s format is unknown; skip\n", procName, fname);
694 if (format == IFF_PS || format == IFF_LPDF) {
695 L_WARNING(
"file %s format is %d; skip\n", procName, fname, format);
703 L_ERROR(
"file %s format is %d; unreadable\n", procName, fname, format);
754 l_float32 scalefactor,
764 PROCNAME(
"pixaConvertToPdf");
767 return ERROR_INT(
"pixa not defined", procName, 1);
770 title, &data, &nbytes);
773 return ERROR_INT(
"conversion to pdf failed", procName, 1);
779 L_ERROR(
"pdf data not written to file\n", procName);
806 l_float32 scalefactor,
814 l_int32 i, n, ret, scaledres, pagetype;
820 PROCNAME(
"pixaConvertToPdfData");
823 return ERROR_INT(
"&data not defined", procName, 1);
826 return ERROR_INT(
"&nbytes not defined", procName, 1);
829 return ERROR_INT(
"pixa not defined", procName, 1);
830 if (scalefactor <= 0.0) scalefactor = 1.0;
832 L_WARNING(
"invalid compression type; using per-page default\n",
840 for (i = 0; i < n; i++) {
842 L_ERROR(
"pix[%d] not retrieved\n", procName, i);
845 if (scalefactor != 1.0)
846 pix =
pixScale(pixs, scalefactor, scalefactor);
850 scaledres = (l_int32)(res * scalefactor);
854 L_ERROR(
"encoding type selection failed for pix[%d]\n",
860 0, 0, scaledres, title, NULL, 0);
864 L_ERROR(
"pdf encoding failed for pix[%d]\n", procName, i);
873 L_ERROR(
"no pdf files made\n", procName);
882 for (i = 0; i < n; i++) {
965 PROCNAME(
"convertToPdf");
968 return ERROR_INT(
"filein not defined", procName, 1);
971 return ERROR_INT(
"fileout not defined", procName, 1);
975 return ERROR_INT(
"invalid conversion type", procName, 1);
978 res, title, plpd, position))
979 return ERROR_INT(
"pdf data not made", procName, 1);
985 return ERROR_INT(
"pdf data not written to file", procName, 1);
1025 const char *fileout,
1036 PROCNAME(
"convertImageDataToPdf");
1039 return ERROR_INT(
"image data not defined", procName, 1);
1042 return ERROR_INT(
"invalid conversion type", procName, 1);
1045 return ERROR_INT(
"fileout not defined", procName, 1);
1048 if ((pix =
pixReadMem(imdata, size)) == NULL)
1049 return ERROR_INT(
"pix not read", procName, 1);
1051 title, plpd, position);
1100 PROCNAME(
"convertToPdfData");
1103 return ERROR_INT(
"&data not defined", procName, 1);
1106 return ERROR_INT(
"&nbytes not defined", procName, 1);
1109 return ERROR_INT(
"filein not defined", procName, 1);
1112 return ERROR_INT(
"invalid conversion type", procName, 1);
1114 if ((pix =
pixRead(filein)) == NULL)
1115 return ERROR_INT(
"pix not made", procName, 1);
1118 x, y, res, (title) ? title : filein, plpd, position);
1170 PROCNAME(
"convertImageDataToPdfData");
1173 return ERROR_INT(
"&data not defined", procName, 1);
1176 return ERROR_INT(
"&nbytes not defined", procName, 1);
1179 return ERROR_INT(
"image data not defined", procName, 1);
1185 if ((pix =
pixReadMem(imdata, size)) == NULL)
1186 return ERROR_INT(
"pix not read", procName, 1);
1188 x, y, res, title, plpd, position);
1226 const char *fileout,
1238 PROCNAME(
"pixConvertToPdf");
1241 return ERROR_INT(
"pix not defined", procName, 1);
1244 return ERROR_INT(
"invalid conversion type", procName, 1);
1247 return ERROR_INT(
"fileout not defined", procName, 1);
1251 x, y, res, title, plpd, position)) {
1253 return ERROR_INT(
"pdf data not made", procName, 1);
1260 return ERROR_INT(
"pdf data not written to file", procName, 1);
1292 size_t nbytes, nbytes_written;
1294 PROCNAME(
"pixWriteStreamPdf");
1297 return ERROR_INT(
"stream not opened", procName, 1);
1299 return ERROR_INT(
"pix not defined", procName, 1);
1303 return ERROR_INT(
"pdf data not made", procName, 1);
1306 nbytes_written = fwrite(data, 1, nbytes, fp);
1308 if (nbytes != nbytes_written)
1309 return ERROR_INT(
"failure writing pdf data to stream", procName, 1);
1341 l_int32 ret, d, type;
1344 PROCNAME(
"pixWriteMemPdf");
1346 if (pdata) *pdata = NULL;
1347 if (pnbytes) *pnbytes = 0;
1348 if (!pdata || !pnbytes)
1349 return ERROR_INT(
"&data or &nbytes not defined", procName, 1);
1351 return ERROR_INT(
"pix not defined", procName, 1);
1353 d = pixGetDepth(pix);
1354 cmap = pixGetColormap(pix);
1357 else if (cmap || d == 2 || d == 4 || d == 16)
1363 0, 0, res, title, NULL, 0);
1365 return ERROR_INT(
"pdf data not made", procName, 1);
1422 l_float32 scalefactor,
1424 const char *fileout)
1427 l_uint8 *imdata, *data;
1428 l_int32 i, npages, nboxa, nboxes, ret;
1429 size_t imbytes, databytes;
1435 PROCNAME(
"convertSegmentedFilesToPdf");
1438 return ERROR_INT(
"dirname not defined", procName, 1);
1440 return ERROR_INT(
"fileout not defined", procName, 1);
1444 return ERROR_INT(
"sa not made", procName, 1);
1451 if (nboxa < npages) {
1460 for (i = 0; i < npages; i++) {
1462 if (!strcmp(fname,
""))
continue;
1471 quality, scalefactor, title,
1475 L_ERROR(
"pdf encoding failed for %s\n", procName, fname);
1479 if (imdata) LEPT_FREE(imdata);
1486 L_ERROR(
"no pdf files made\n", procName);
1496 for (i = 0; i < npages; i++) {
1503 if (data) LEPT_FREE(data);
1504 return ERROR_INT(
"pdf data not made", procName, 1);
1510 L_ERROR(
"pdf data not written to file\n", procName);
1547 PROCNAME(
"convertNumberedMasksToBoxaa");
1550 return (
BOXAA *)ERROR_PTR(
"dirname not defined", procName, NULL);
1553 numpost, 10000)) == NULL)
1554 return (
BOXAA *)ERROR_PTR(
"sa not made", procName, NULL);
1562 for (i = 0; i < n; i++) {
1564 if (!strcmp(fname,
""))
continue;
1565 if ((pix =
pixRead(fname)) == NULL) {
1566 L_WARNING(
"invalid image on page %d\n", procName, i);
1650 l_float32 scalefactor,
1652 const char *fileout)
1657 PROCNAME(
"convertToPdfSegmented");
1660 return ERROR_INT(
"filein not defined", procName, 1);
1662 return ERROR_INT(
"fileout not defined", procName, 1);
1665 return ERROR_INT(
"invalid conversion type", procName, 1);
1666 if (boxa && scalefactor > 1.0) {
1667 L_WARNING(
"setting scalefactor to 1.0\n", procName);
1671 if ((pixs =
pixRead(filein)) == NULL)
1672 return ERROR_INT(
"pixs not made", procName, 1);
1675 scalefactor, (title) ? title : filein,
1710 l_float32 scalefactor,
1712 const char *fileout)
1718 PROCNAME(
"pixConvertToPdfSegmented");
1721 return ERROR_INT(
"pixs not defined", procName, 1);
1723 return ERROR_INT(
"fileout not defined", procName, 1);
1726 return ERROR_INT(
"invalid conversion type", procName, 1);
1727 if (boxa && scalefactor > 1.0) {
1728 L_WARNING(
"setting scalefactor to 1.0\n", procName);
1733 scalefactor, title, &data, &nbytes);
1735 return ERROR_INT(
"pdf generation failure", procName, 1);
1738 if (data) LEPT_FREE(data);
1773 l_float32 scalefactor,
1781 PROCNAME(
"convertToPdfDataSegmented");
1784 return ERROR_INT(
"&data not defined", procName, 1);
1787 return ERROR_INT(
"&nbytes not defined", procName, 1);
1790 return ERROR_INT(
"filein not defined", procName, 1);
1793 return ERROR_INT(
"invalid conversion type", procName, 1);
1794 if (boxa && scalefactor > 1.0) {
1795 L_WARNING(
"setting scalefactor to 1.0\n", procName);
1799 if ((pixs =
pixRead(filein)) == NULL)
1800 return ERROR_INT(
"pixs not made", procName, 1);
1803 quality, scalefactor,
1804 (title) ? title : filein,
1840 l_float32 scalefactor,
1845 l_int32 i, nbox, seq, bx, by, bw, bh, upscale;
1847 BOX *box, *boxc, *box2;
1848 PIX *pix, *pixt1, *pixt2, *pixt3, *pixt4, *pixt5, *pixt6;
1852 PROCNAME(
"pixConvertToPdfDataSegmented");
1855 return ERROR_INT(
"&data not defined", procName, 1);
1858 return ERROR_INT(
"&nbytes not defined", procName, 1);
1861 return ERROR_INT(
"pixs not defined", procName, 1);
1864 return ERROR_INT(
"invalid conversion type", procName, 1);
1865 if (boxa && (scalefactor <= 0.0 || scalefactor > 1.0)) {
1866 L_WARNING(
"setting scalefactor to 1.0\n", procName);
1872 res = DEFAULT_INPUT_RES;
1873 scale = (l_float32)((l_int32)(scalefactor * res + 0.5)) / (l_float32)res;
1874 cmap = pixGetColormap(pixs);
1878 if (pixGetDepth(pixs) > 1 && type ==
L_G4_ENCODE) {
1885 0, 0, 2 * res, title, NULL, 0);
1890 0, 0, res, title, NULL, 0);
1906 for (i = 0; i < nbox; i++) {
1916 if (pixGetDepth(pixt3) == 1)
1919 pixt4 =
pixScale(pixt3, scale, scale);
1921 0, 0, (l_int32)(scale * res), title,
1924 if (pixGetDepth(pixt1) == 1) {
1947 for (i = 0; i < nbox; i++) {
1951 if (pixGetDepth(pixt3) == 1)
1954 pixt4 =
pixScale(pixt3, scale, scale);
1959 bx, by, (l_int32)(scale * res), title,
2000 const char *fileout)
2005 PROCNAME(
"concatenatePdf");
2008 return ERROR_INT(
"dirname not defined", procName, 1);
2010 return ERROR_INT(
"fileout not defined", procName, 1);
2013 return ERROR_INT(
"sa not made", procName, 1);
2034 const char *fileout)
2040 PROCNAME(
"saConcatenatePdf");
2043 return ERROR_INT(
"sa not defined", procName, 1);
2045 return ERROR_INT(
"fileout not defined", procName, 1);
2049 return ERROR_INT(
"pdf data not made", procName, 1);
2070 const char *fileout)
2076 PROCNAME(
"ptraConcatenatePdf");
2079 return ERROR_INT(
"pa not defined", procName, 1);
2081 return ERROR_INT(
"fileout not defined", procName, 1);
2085 return ERROR_INT(
"pdf data not made", procName, 1);
2121 PROCNAME(
"concatenatePdfToData");
2124 return ERROR_INT(
"&data not defined", procName, 1);
2127 return ERROR_INT(
"&nbytes not defined", procName, 1);
2130 return ERROR_INT(
"dirname not defined", procName, 1);
2133 return ERROR_INT(
"sa not made", procName, 1);
2159 l_int32 i, npages, ret;
2163 PROCNAME(
"saConcatenatePdfToData");
2166 return ERROR_INT(
"&data not defined", procName, 1);
2169 return ERROR_INT(
"&nbytes not defined", procName, 1);
2172 return ERROR_INT(
"sa not defined", procName, 1);
2176 return ERROR_INT(
"no filenames found", procName, 1);
2178 for (i = 0; i < npages; i++) {
2188 for (i = 0; i < npages; i++) {
PIX * pixRemoveColormap(PIX *pixs, l_int32 type)
pixRemoveColormap()
l_ok ptraConcatenatePdfToData(L_PTRA *pa_data, SARRAY *sa, l_uint8 **pdata, size_t *pnbytes)
ptraConcatenatePdfToData()
PIX * pixScaleToGray(PIX *pixs, l_float32 scalefactor)
pixScaleToGray()
l_ok ptraGetActualCount(L_PTRA *pa, l_int32 *pcount)
ptraGetActualCount()
l_ok saConvertFilesToPdf(SARRAY *sa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, const char *fileout)
saConvertFilesToPdf()
l_ok boxaaReplaceBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaReplaceBoxa()
l_ok convertToPdfData(const char *filein, l_int32 type, l_int32 quality, l_uint8 **pdata, size_t *pnbytes, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
convertToPdfData()
l_ok convertToPdfSegmented(const char *filein, l_int32 res, l_int32 type, l_int32 thresh, BOXA *boxa, l_int32 quality, l_float32 scalefactor, const char *title, const char *fileout)
convertToPdfSegmented()
l_int32 boxaaGetCount(BOXAA *baa)
boxaaGetCount()
l_ok convertImageDataToPdf(l_uint8 *imdata, size_t size, l_int32 type, l_int32 quality, const char *fileout, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
convertImageDataToPdf()
l_ok saConvertFilesToPdfData(SARRAY *sa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, l_uint8 **pdata, size_t *pnbytes)
saConvertFilesToPdfData()
l_ok saConcatenatePdfToData(SARRAY *sa, l_uint8 **pdata, size_t *pnbytes)
saConcatenatePdfToData()
l_ok pixRasterop(PIX *pixd, l_int32 dx, l_int32 dy, l_int32 dw, l_int32 dh, l_int32 op, PIX *pixs, l_int32 sx, l_int32 sy)
pixRasterop()
PIX * pixConvertTo8(PIX *pixs, l_int32 cmapflag)
pixConvertTo8()
L_BYTEA * l_byteaInitFromMem(const l_uint8 *data, size_t size)
l_byteaInitFromMem()
PIX * pixScaleGray2xLIThresh(PIX *pixs, l_int32 thresh)
pixScaleGray2xLIThresh()
l_ok boxaaExtendWithInit(BOXAA *baa, l_int32 maxindex, BOXA *boxa)
boxaaExtendWithInit()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
l_ok pixWriteMemPdf(l_uint8 **pdata, size_t *pnbytes, PIX *pix, l_int32 res, const char *title)
pixWriteMemPdf()
l_ok cidConvertToPdfData(L_COMP_DATA *cid, const char *title, l_uint8 **pdata, size_t *pnbytes)
cidConvertToPdfData()
BOX * boxTransform(BOX *box, l_int32 shiftx, l_int32 shifty, l_float32 scalex, l_float32 scaley)
boxTransform()
l_ok pixNumColors(PIX *pixs, l_int32 factor, l_int32 *pncolors)
pixNumColors()
l_ok pixConvertToPdfSegmented(PIX *pixs, l_int32 res, l_int32 type, l_int32 thresh, BOXA *boxa, l_int32 quality, l_float32 scalefactor, const char *title, const char *fileout)
pixConvertToPdfSegmented()
l_ok convertFilesToPdf(const char *dirname, const char *substr, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, const char *fileout)
convertFilesToPdf()
PIX * pixReadMem(const l_uint8 *data, size_t size)
pixReadMem()
PIX * pixCreateTemplate(PIX *pixs)
pixCreateTemplate()
PIX * pixClipRectangle(PIX *pixs, BOX *box, BOX **pboxc)
pixClipRectangle()
SARRAY * getNumberedPathnamesInDirectory(const char *dirname, const char *substr, l_int32 numpre, l_int32 numpost, l_int32 maxnum)
getNumberedPathnamesInDirectory()
l_ok concatenatePdfToData(const char *dirname, const char *substr, l_uint8 **pdata, size_t *pnbytes)
concatenatePdfToData()
l_ok convertSegmentedFilesToPdf(const char *dirname, const char *substr, l_int32 res, l_int32 type, l_int32 thresh, BOXAA *baa, l_int32 quality, l_float32 scalefactor, const char *title, const char *fileout)
convertSegmentedFilesToPdf()
l_ok l_binaryWrite(const char *filename, const char *operation, const void *data, size_t nbytes)
l_binaryWrite()
BOXA * pixConnComp(PIX *pixs, PIXA **ppixa, l_int32 connectivity)
pixConnComp()
l_ok convertUnscaledFilesToPdf(const char *dirname, const char *substr, const char *title, const char *fileout)
convertUnscaledFilesToPdf()
l_ok saConcatenatePdf(SARRAY *sa, const char *fileout)
saConcatenatePdf()
L_PTRA * ptraCreate(l_int32 n)
ptraCreate()
l_ok pixWriteStreamPdf(FILE *fp, PIX *pix, l_int32 res, const char *title)
pixWriteStreamPdf()
l_ok convertImageDataToPdfData(l_uint8 *imdata, size_t size, l_int32 type, l_int32 quality, l_uint8 **pdata, size_t *pnbytes, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
convertImageDataToPdfData()
l_ok pixSetBlackOrWhite(PIX *pixs, l_int32 op)
pixSetBlackOrWhite()
l_ok findFileFormat(const char *filename, l_int32 *pformat)
findFileFormat()
char * sarrayGetString(SARRAY *sa, l_int32 index, l_int32 copyflag)
sarrayGetString()
l_ok convertToPdf(const char *filein, l_int32 type, l_int32 quality, const char *fileout, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
convertToPdf()
L_BYTEA * l_byteaInitFromFile(const char *fname)
l_byteaInitFromFile()
PIX * pixClone(PIX *pixs)
pixClone()
void pixDestroy(PIX **ppix)
pixDestroy()
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
l_ok selectDefaultPdfEncoding(PIX *pix, l_int32 *ptype)
selectDefaultPdfEncoding()
SARRAY * getSortedPathnamesInDirectory(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
getSortedPathnamesInDirectory()
l_ok splitPathAtDirectory(const char *pathname, char **pdir, char **ptail)
splitPathAtDirectory()
l_ok ptraConcatenatePdf(L_PTRA *pa, const char *fileout)
ptraConcatenatePdf()
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
BOXAA * boxaaCreate(l_int32 n)
boxaaCreate()
l_ok pixConvertToPdfData(PIX *pix, l_int32 type, l_int32 quality, l_uint8 **pdata, size_t *pnbytes, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
pixConvertToPdfData()
void ptraDestroy(L_PTRA **ppa, l_int32 freeflag, l_int32 warnflag)
ptraDestroy()
l_int32 sarrayGetCount(SARRAY *sa)
sarrayGetCount()
l_ok ptraAdd(L_PTRA *pa, void *item)
ptraAdd()
PIX * pixRead(const char *filename)
pixRead()
l_ok convertToPdfDataSegmented(const char *filein, l_int32 res, l_int32 type, l_int32 thresh, BOXA *boxa, l_int32 quality, l_float32 scalefactor, const char *title, l_uint8 **pdata, size_t *pnbytes)
convertToPdfDataSegmented()
l_ok pixConvertToPdf(PIX *pix, l_int32 type, l_int32 quality, const char *fileout, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
pixConvertToPdf()
l_ok convertUnscaledToPdfData(const char *fname, const char *title, l_uint8 **pdata, size_t *pnbytes)
convertUnscaledToPdfData()
l_ok pixaConvertToPdf(PIXA *pixa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, const char *fileout)
pixaConvertToPdf()
l_ok saConvertUnscaledFilesToPdf(SARRAY *sa, const char *title, const char *fileout)
saConvertUnscaledFilesToPdf()
BOXAA * convertNumberedMasksToBoxaa(const char *dirname, const char *substr, l_int32 numpre, l_int32 numpost)
convertNumberedMasksToBoxaa()
PIX * pixaGetPix(PIXA *pixa, l_int32 index, l_int32 accesstype)
pixaGetPix()
l_ok l_generateCIDataForPdf(const char *fname, PIX *pix, l_int32 quality, L_COMP_DATA **pcid)
l_generateCIDataForPdf()
void * ptraRemove(L_PTRA *pa, l_int32 index, l_int32 flag)
ptraRemove()
l_ok boxaaInitFull(BOXAA *baa, BOXA *boxa)
boxaaInitFull()
l_ok pixaConvertToPdfData(PIXA *pixa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, l_uint8 **pdata, size_t *pnbytes)
pixaConvertToPdfData()
BOXA * boxaCreate(l_int32 n)
boxaCreate()
l_ok saConvertUnscaledFilesToPdfData(SARRAY *sa, const char *title, l_uint8 **pdata, size_t *pnbytes)
saConvertUnscaledFilesToPdfData()
void boxDestroy(BOX **pbox)
boxDestroy()
l_int32 boxaGetCount(BOXA *boxa)
boxaGetCount()
void l_byteaDestroy(L_BYTEA **pba)
l_byteaDestroy()
l_ok boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
l_ok pixConvertToPdfDataSegmented(PIX *pixs, l_int32 res, l_int32 type, l_int32 thresh, BOXA *boxa, l_int32 quality, l_float32 scalefactor, const char *title, l_uint8 **pdata, size_t *pnbytes)
pixConvertToPdfDataSegmented()
PIX * pixScale(PIX *pixs, l_float32 scalex, l_float32 scaley)
pixScale()
l_ok concatenatePdf(const char *dirname, const char *substr, const char *fileout)
concatenatePdf()
l_int32 pixaGetCount(PIXA *pixa)
pixaGetCount()
PIX * pixSetBlackOrWhiteBoxa(PIX *pixs, BOXA *boxa, l_int32 op)
pixSetBlackOrWhiteBoxa()
BOXA * boxaaGetBoxa(BOXAA *baa, l_int32 index, l_int32 accessflag)
boxaaGetBoxa()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()