201#include <config_auto.h>
206#include "allheaders.h"
213static const l_int32 DefaultInputRes = 300;
255 l_float32 scalefactor,
265 return ERROR_INT(
"dirname not defined", __func__, 1);
267 return ERROR_INT(
"fileout not defined", __func__, 1);
269 if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
270 return ERROR_INT(
"sa not made", __func__, 1);
301 l_float32 scalefactor,
312 return ERROR_INT(
"sa not defined", __func__, 1);
315 title, &data, &nbytes);
317 if (data) LEPT_FREE(data);
318 return ERROR_INT(
"pdf data not made", __func__, 1);
321 ret = l_binaryWrite(fileout,
"w", data, nbytes);
324 L_ERROR(
"pdf data not written to file\n", __func__);
353 l_float32 scalefactor,
362l_int32 i, n, ret, pagetype, npages, scaledres;
369 return ERROR_INT(
"&data not defined", __func__, 1);
372 return ERROR_INT(
"&nbytes not defined", __func__, 1);
375 return ERROR_INT(
"sa not defined", __func__, 1);
376 if (scalefactor <= 0.0) scalefactor = 1.0;
383 n = sarrayGetCount(sa);
384 pa_data = ptraCreate(n);
385 for (i = 0; i < n; i++) {
386 if (i && (i % 10 == 0)) lept_stderr(
".. %d ", i);
387 fname = sarrayGetString(sa, i,
L_NOCOPY);
388 if ((pixs = pixRead(fname)) == NULL) {
389 L_ERROR(
"image not readable from file %s\n", __func__, fname);
392 if (scalefactor != 1.0)
393 pix = pixScale(pixs, scalefactor, scalefactor);
395 pix = pixClone(pixs);
397 scaledres = (l_int32)(res * scalefactor);
404 L_ERROR(
"encoding type selection failed for file %s\n",
409 ret = pixConvertToPdfData(pix, pagetype, quality, &imdata, &imbytes,
410 0, 0, scaledres, title, NULL, 0);
414 L_ERROR(
"pdf encoding failed for %s\n", __func__, fname);
417 ba = l_byteaInitFromMem(imdata, imbytes);
419 ptraAdd(pa_data, ba);
421 ptraGetActualCount(pa_data, &npages);
423 L_ERROR(
"no pdf files made\n", __func__);
424 ptraDestroy(&pa_data, FALSE, FALSE);
429 lept_stderr(
"\nconcatenating ... ");
430 ret = ptraConcatenatePdfToData(pa_data, NULL, pdata, pnbytes);
431 lept_stderr(
"done\n");
433 ptraGetActualCount(pa_data, &npages);
434 for (i = 0; i < npages; i++) {
438 ptraDestroy(&pa_data, FALSE, FALSE);
470l_int32 w, h, d, factor, ncolors;
474 return ERROR_INT(
"&type not defined", __func__, 1);
477 return ERROR_INT(
"pix not defined", __func__, 1);
478 pixGetDimensions(pix, &w, &h, &d);
479 cmap = pixGetColormap(pix);
480 if (d == 8 && !cmap) {
481 factor = L_MAX(1, (l_int32)sqrt((l_float64)(w * h) / 20000.));
482 pixNumColors(pix, factor, &ncolors);
489 }
else if (cmap || d == 2 || d == 4) {
491 }
else if (d == 8 || d == 32) {
493 }
else if (d == 16) {
496 return ERROR_INT(
"type selection failure", __func__, 1);
539 return ERROR_INT(
"dirname not defined", __func__, 1);
541 return ERROR_INT(
"fileout not defined", __func__, 1);
543 if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
544 return ERROR_INT(
"sa not made", __func__, 1);
574 return ERROR_INT(
"sa not defined", __func__, 1);
578 if (data) LEPT_FREE(data);
579 return ERROR_INT(
"pdf data not made", __func__, 1);
582 ret = l_binaryWrite(fileout,
"w", data, nbytes);
585 L_ERROR(
"pdf data not written to file\n", __func__);
614l_int32 i, n, ret, npages;
620 return ERROR_INT(
"&data not defined", __func__, 1);
623 return ERROR_INT(
"&nbytes not defined", __func__, 1);
626 return ERROR_INT(
"sa not defined", __func__, 1);
629 n = sarrayGetCount(sa);
630 pa_data = ptraCreate(n);
631 for (i = 0; i < n; i++) {
632 if (i && (i % 10 == 0)) lept_stderr(
".. %d ", i);
633 fname = sarrayGetString(sa, i,
L_NOCOPY);
640 ba = l_byteaInitFromMem(imdata, imbytes);
641 if (imdata) LEPT_FREE(imdata);
642 ptraAdd(pa_data, ba);
644 ptraGetActualCount(pa_data, &npages);
646 L_ERROR(
"no pdf files made\n", __func__);
647 ptraDestroy(&pa_data, FALSE, FALSE);
652 lept_stderr(
"\nconcatenating ... ");
653 ret = ptraConcatenatePdfToData(pa_data, NULL, pdata, pnbytes);
654 lept_stderr(
"done\n");
657 ptraGetActualCount(pa_data, &npages);
658 for (i = 0; i < npages; i++) {
662 ptraDestroy(&pa_data, FALSE, FALSE);
693 return ERROR_INT(
"&data not defined", __func__, 1);
696 return ERROR_INT(
"&nbytes not defined", __func__, 1);
699 return ERROR_INT(
"fname not defined", __func__, 1);
701 findFileFormat(fname, &format);
702 if (format == IFF_UNKNOWN) {
703 L_WARNING(
"file %s format is unknown; skip\n", __func__, fname);
706 if (format == IFF_PS || format == IFF_LPDF) {
707 L_WARNING(
"file %s format is %d; skip\n", __func__, fname, format);
714 l_generateCIDataForPdf(fname, NULL, 0, &cid);
716 L_ERROR(
"file %s format is %d; unreadable\n", __func__, fname, format);
722 cidConvertToPdfData(cid, title, pdata, pnbytes);
761 l_float32 scalefactor,
772 return ERROR_INT(
"pixa not defined", __func__, 1);
775 title, &data, &nbytes);
778 return ERROR_INT(
"conversion to pdf failed", __func__, 1);
781 ret = l_binaryWrite(fileout,
"w", data, nbytes);
784 L_ERROR(
"pdf data not written to file\n", __func__);
813 l_float32 scalefactor,
821l_int32 i, n, ret, scaledres, pagetype;
828 return ERROR_INT(
"&data not defined", __func__, 1);
831 return ERROR_INT(
"&nbytes not defined", __func__, 1);
834 return ERROR_INT(
"pixa not defined", __func__, 1);
835 if (scalefactor <= 0.0) scalefactor = 1.0;
836 if (scalefactor >= 50.0)
837 return ERROR_INT(
"scalefactor too large", __func__, 1);
841 L_WARNING(
"invalid compression type; using per-page default\n",
845 if (quality < 0 || quality > 100)
846 return ERROR_INT(
"invalid quality", __func__, 1);
849 n = pixaGetCount(pixa);
850 pa_data = ptraCreate(n);
851 for (i = 0; i < n; i++) {
852 if ((pixs = pixaGetPix(pixa, i,
L_CLONE)) == NULL) {
853 L_ERROR(
"pixs[%d] not retrieved\n", __func__, i);
856 if (scalefactor != 1.0)
857 pix = pixScale(pixs, scalefactor, scalefactor);
859 pix = pixClone(pixs);
862 L_ERROR(
"pix[%d] not made\n", __func__, i);
865 scaledres = (l_int32)(res * scalefactor);
871 L_ERROR(
"encoding type selection failed for pix[%d]\n",
877 ret = pixConvertToPdfData(pix, pagetype, quality, &imdata, &imbytes,
878 0, 0, scaledres, title, NULL, 0);
882 L_ERROR(
"pdf encoding failed for pix[%d]\n", __func__, i);
885 ba = l_byteaInitFromMem(imdata, imbytes);
887 ptraAdd(pa_data, ba);
889 ptraGetActualCount(pa_data, &n);
891 L_ERROR(
"no pdf files made\n", __func__);
892 ptraDestroy(&pa_data, FALSE, FALSE);
897 ret = ptraConcatenatePdfToData(pa_data, NULL, pdata, pnbytes);
899 ptraGetActualCount(pa_data, &n);
900 for (i = 0; i < n; i++) {
904 ptraDestroy(&pa_data, FALSE, FALSE);
988 return ERROR_INT(
"filein not defined", __func__, 1);
991 return ERROR_INT(
"fileout not defined", __func__, 1);
995 res, title, plpd, position))
996 return ERROR_INT(
"pdf data not made", __func__, 1);
999 ret = l_binaryWrite(fileout,
"w", data, nbytes);
1002 return ERROR_INT(
"pdf data not written to file", __func__, 1);
1046 const char *fileout,
1058 return ERROR_INT(
"image data not defined", __func__, 1);
1061 return ERROR_INT(
"fileout not defined", __func__, 1);
1064 if ((pix = pixReadMem(imdata, size)) == NULL)
1065 return ERROR_INT(
"pix not read", __func__, 1);
1071 title, plpd, position);
1124 return ERROR_INT(
"&data not defined", __func__, 1);
1127 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1130 return ERROR_INT(
"filein not defined", __func__, 1);
1132 if ((pix = pixRead(filein)) == NULL)
1133 return ERROR_INT(
"pix not made", __func__, 1);
1135 pixConvertToPdfData(pix, type, quality, pdata, pnbytes,
1136 x, y, res, title, plpd, position);
1192 return ERROR_INT(
"&data not defined", __func__, 1);
1195 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1198 return ERROR_INT(
"image data not defined", __func__, 1);
1204 if ((pix = pixReadMem(imdata, size)) == NULL)
1205 return ERROR_INT(
"pix not read", __func__, 1);
1210 ret = pixConvertToPdfData(pix, type, quality, pdata, pnbytes,
1211 x, y, res, title, plpd, position);
1254 const char *fileout,
1267 return ERROR_INT(
"pix not defined", __func__, 1);
1270 return ERROR_INT(
"fileout not defined", __func__, 1);
1273 if (pixConvertToPdfData(pix, type, quality, &data, &nbytes,
1274 x, y, res, title, plpd, position)) {
1276 return ERROR_INT(
"pdf data not made", __func__, 1);
1280 ret = l_binaryWrite(fileout,
"w", data, nbytes);
1283 return ERROR_INT(
"pdf data not written to file", __func__, 1);
1314size_t nbytes, nbytes_written;
1317 return ERROR_INT(
"stream not opened", __func__, 1);
1319 return ERROR_INT(
"pix not defined", __func__, 1);
1323 return ERROR_INT(
"pdf data not made", __func__, 1);
1326 nbytes_written = fwrite(data, 1, nbytes, fp);
1328 if (nbytes != nbytes_written)
1329 return ERROR_INT(
"failure writing pdf data to stream", __func__, 1);
1362 if (pdata) *pdata = NULL;
1363 if (pnbytes) *pnbytes = 0;
1364 if (!pdata || !pnbytes)
1365 return ERROR_INT(
"&data or &nbytes not defined", __func__, 1);
1367 return ERROR_INT(
"pix not defined", __func__, 1);
1370 ret = pixConvertToPdfData(pix, type, 75, pdata, pnbytes,
1371 0, 0, res, title, NULL, 0);
1373 return ERROR_INT(
"pdf data not made", __func__, 1);
1432 l_float32 scalefactor,
1434 const char *fileout)
1437l_uint8 *imdata, *data;
1438l_int32 i, npages, nboxa, nboxes, ret;
1439size_t imbytes, databytes;
1446 return ERROR_INT(
"dirname not defined", __func__, 1);
1448 return ERROR_INT(
"fileout not defined", __func__, 1);
1450 if ((sa = getNumberedPathnamesInDirectory(dirname, substr, 0, 0, 10000))
1452 return ERROR_INT(
"sa not made", __func__, 1);
1454 npages = sarrayGetCount(sa);
1458 nboxa = boxaaGetCount(baa);
1459 if (nboxa < npages) {
1460 boxa = boxaCreate(1);
1461 boxaaExtendWithInit(baa, npages, boxa);
1467 pa_data = ptraCreate(npages);
1468 for (i = 0; i < npages; i++) {
1469 fname = sarrayGetString(sa, i,
L_NOCOPY);
1470 if (!strcmp(fname,
""))
continue;
1473 boxa = boxaaGetBoxa(baa, i,
L_CLONE);
1474 nboxes = boxaGetCount(boxa);
1479 quality, scalefactor, title,
1483 L_ERROR(
"pdf encoding failed for %s\n", __func__, fname);
1486 ba = l_byteaInitFromMem(imdata, imbytes);
1487 if (imdata) LEPT_FREE(imdata);
1488 ptraAdd(pa_data, ba);
1492 ptraGetActualCount(pa_data, &npages);
1494 L_ERROR(
"no pdf files made\n", __func__);
1495 ptraDestroy(&pa_data, FALSE, FALSE);
1500 ret = ptraConcatenatePdfToData(pa_data, NULL, &data, &databytes);
1503 ptraGetActualCount(pa_data, &npages);
1504 for (i = 0; i < npages; i++) {
1506 l_byteaDestroy(&ba);
1508 ptraDestroy(&pa_data, FALSE, FALSE);
1511 if (data) LEPT_FREE(data);
1512 return ERROR_INT(
"pdf data not made", __func__, 1);
1515 ret = l_binaryWrite(fileout,
"w", data, databytes);
1518 L_ERROR(
"pdf data not written to file\n", __func__);
1556 return (
BOXAA *)ERROR_PTR(
"dirname not defined", __func__, NULL);
1558 if ((sa = getNumberedPathnamesInDirectory(dirname, substr, numpre,
1559 numpost, 10000)) == NULL)
1560 return (
BOXAA *)ERROR_PTR(
"sa not made", __func__, NULL);
1563 n = sarrayGetCount(sa);
1564 baa = boxaaCreate(n);
1565 boxa = boxaCreate(1);
1566 boxaaInitFull(baa, boxa);
1568 for (i = 0; i < n; i++) {
1569 fname = sarrayGetString(sa, i,
L_NOCOPY);
1570 if (!strcmp(fname,
""))
continue;
1571 if ((pix = pixRead(fname)) == NULL) {
1572 L_WARNING(
"invalid image on page %d\n", __func__, i);
1575 boxa = pixConnComp(pix, NULL, 8);
1576 boxaaReplaceBoxa(baa, i, boxa);
1656 l_float32 scalefactor,
1658 const char *fileout)
1664 return ERROR_INT(
"filein not defined", __func__, 1);
1666 return ERROR_INT(
"fileout not defined", __func__, 1);
1669 return ERROR_INT(
"invalid conversion type", __func__, 1);
1670 if (boxa && scalefactor > 1.0) {
1671 L_WARNING(
"setting scalefactor to 1.0\n", __func__);
1675 if ((pixs = pixRead(filein)) == NULL)
1676 return ERROR_INT(
"pixs not made", __func__, 1);
1679 scalefactor, title, fileout);
1713 l_float32 scalefactor,
1715 const char *fileout)
1722 return ERROR_INT(
"pixs not defined", __func__, 1);
1724 return ERROR_INT(
"fileout not defined", __func__, 1);
1727 return ERROR_INT(
"invalid conversion type", __func__, 1);
1728 if (boxa && scalefactor > 1.0) {
1729 L_WARNING(
"setting scalefactor to 1.0\n", __func__);
1734 scalefactor, title, &data, &nbytes);
1736 return ERROR_INT(
"pdf generation failure", __func__, 1);
1738 ret = l_binaryWrite(fileout,
"w", data, nbytes);
1739 if (data) LEPT_FREE(data);
1775 l_float32 scalefactor,
1784 return ERROR_INT(
"&data not defined", __func__, 1);
1787 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1790 return ERROR_INT(
"filein not defined", __func__, 1);
1793 return ERROR_INT(
"invalid conversion type", __func__, 1);
1794 if (boxa && scalefactor > 1.0) {
1795 L_WARNING(
"setting scalefactor to 1.0\n", __func__);
1799 if ((pixs = pixRead(filein)) == NULL)
1800 return ERROR_INT(
"pixs not made", __func__, 1);
1803 quality, scalefactor, title,
1839 l_float32 scalefactor,
1844l_int32 i, nbox, seq, bx, by, bw, bh, upscale;
1846BOX *box, *boxc, *box2;
1847PIX *pix, *pixt1, *pixt2, *pixt3, *pixt4, *pixt5, *pixt6;
1852 return ERROR_INT(
"&data not defined", __func__, 1);
1855 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1858 return ERROR_INT(
"pixs not defined", __func__, 1);
1861 return ERROR_INT(
"invalid conversion type", __func__, 1);
1862 if (boxa && (scalefactor <= 0.0 || scalefactor > 1.0)) {
1863 L_WARNING(
"setting scalefactor to 1.0\n", __func__);
1869 res = DefaultInputRes;
1870 scale = (l_float32)((l_int32)(scalefactor * res + 0.5)) / (l_float32)res;
1871 cmap = pixGetColormap(pixs);
1874 if (!boxa || boxaGetCount(boxa) == 0) {
1875 if (pixGetDepth(pixs) > 1 && type ==
L_G4_ENCODE) {
1879 pixt1 = pixConvertTo8(pixs, FALSE);
1880 pixt2 = pixScaleGray2xLIThresh(pixt1, thresh);
1881 pixConvertToPdfData(pixt2, type, quality, pdata, pnbytes,
1882 0, 0, 2 * res, title, NULL, 0);
1886 pixConvertToPdfData(pixs, type, quality, pdata, pnbytes,
1887 0, 0, res, title, NULL, 0);
1898 pixt1 = pixSetBlackOrWhiteBoxa(pixs, boxa,
L_SET_WHITE);
1899 nbox = boxaGetCount(boxa);
1901 pixt2 = pixCreateTemplate(pixs);
1903 for (i = 0; i < nbox; i++) {
1904 box = boxaGetBox(boxa, i,
L_CLONE);
1905 pix = pixClipRectangle(pixs, box, &boxc);
1906 boxGetGeometry(boxc, &bx, &by, &bw, &bh);
1907 pixRasterop(pixt2, bx, by, bw, bh,
PIX_SRC, pix, 0, 0);
1913 if (pixGetDepth(pixt3) == 1)
1914 pixt4 = pixScaleToGray(pixt3, scale);
1916 pixt4 = pixScale(pixt3, scale, scale);
1917 pixConvertToPdfData(pixt4,
L_JPEG_ENCODE, quality, pdata, pnbytes,
1918 0, 0, (l_int32)(scale * res), title,
1921 if (pixGetDepth(pixt1) == 1) {
1922 pixt5 = pixClone(pixt1);
1925 pixt6 = pixConvertTo8(pixt1, 0);
1926 pixt5 = pixScaleGray2xLIThresh(pixt6, thresh);
1930 pixConvertToPdfData(pixt5,
L_G4_ENCODE, quality, pdata, pnbytes,
1942 pixConvertToPdfData(pixt1, type, quality, pdata, pnbytes, 0, 0,
1944 for (i = 0; i < nbox; i++) {
1945 box = boxaGetBox(boxa, i,
L_CLONE);
1946 pixt2 = pixClipRectangle(pixs, box, &boxc);
1948 if (pixGetDepth(pixt3) == 1)
1949 pixt4 = pixScaleToGray(pixt3, scale);
1951 pixt4 = pixScale(pixt3, scale, scale);
1952 box2 = boxTransform(boxc, 0, 0, scale, scale);
1953 boxGetGeometry(box2, &bx, &by, NULL, &bh);
1955 pixConvertToPdfData(pixt4,
L_JPEG_ENCODE, quality, pdata, pnbytes,
1956 bx, by, (l_int32)(scale * res), title,
1998 const char *fileout)
2004 return ERROR_INT(
"dirname not defined", __func__, 1);
2006 return ERROR_INT(
"fileout not defined", __func__, 1);
2008 if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
2009 return ERROR_INT(
"sa not made", __func__, 1);
2030 const char *fileout)
2037 return ERROR_INT(
"sa not defined", __func__, 1);
2039 return ERROR_INT(
"fileout not defined", __func__, 1);
2043 return ERROR_INT(
"pdf data not made", __func__, 1);
2044 ret = l_binaryWrite(fileout,
"w", data, nbytes);
2064 const char *fileout)
2071 return ERROR_INT(
"pa not defined", __func__, 1);
2073 return ERROR_INT(
"fileout not defined", __func__, 1);
2075 ret = ptraConcatenatePdfToData(pa, NULL, &data, &nbytes);
2077 return ERROR_INT(
"pdf data not made", __func__, 1);
2078 ret = l_binaryWrite(fileout,
"w", data, nbytes);
2115 return ERROR_INT(
"&data not defined", __func__, 1);
2118 return ERROR_INT(
"&nbytes not defined", __func__, 1);
2121 return ERROR_INT(
"dirname not defined", __func__, 1);
2123 if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
2124 return ERROR_INT(
"sa not made", __func__, 1);
2150l_int32 i, npages, ret;
2155 return ERROR_INT(
"&data not defined", __func__, 1);
2158 return ERROR_INT(
"&nbytes not defined", __func__, 1);
2161 return ERROR_INT(
"sa not defined", __func__, 1);
2164 if ((npages = sarrayGetCount(sa)) == 0)
2165 return ERROR_INT(
"no filenames found", __func__, 1);
2166 pa_data = ptraCreate(npages);
2167 for (i = 0; i < npages; i++) {
2168 fname = sarrayGetString(sa, i,
L_NOCOPY);
2169 bas = l_byteaInitFromFile(fname);
2170 ptraAdd(pa_data, bas);
2173 ret = ptraConcatenatePdfToData(pa_data, sa, pdata, pnbytes);
2176 ptraGetActualCount(pa_data, &npages);
2177 for (i = 0; i < npages; i++) {
2179 l_byteaDestroy(&bas);
2181 ptraDestroy(&pa_data, FALSE, FALSE);
l_ok concatenatePdf(const char *dirname, const char *substr, const char *fileout)
concatenatePdf()
l_ok concatenatePdfToData(const char *dirname, const char *substr, l_uint8 **pdata, size_t *pnbytes)
concatenatePdfToData()
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 convertUnscaledFilesToPdf(const char *dirname, const char *substr, const char *title, const char *fileout)
convertUnscaledFilesToPdf()
l_ok pixWriteMemPdf(l_uint8 **pdata, size_t *pnbytes, PIX *pix, l_int32 res, const char *title)
pixWriteMemPdf()
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_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 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 ptraConcatenatePdf(L_PTRA *pa, const char *fileout)
ptraConcatenatePdf()
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 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()
l_ok saConcatenatePdfToData(SARRAY *sa, l_uint8 **pdata, size_t *pnbytes)
saConcatenatePdfToData()
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 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_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 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 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 saConvertUnscaledFilesToPdf(SARRAY *sa, const char *title, const char *fileout)
saConvertUnscaledFilesToPdf()
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 convertUnscaledToPdfData(const char *fname, const char *title, l_uint8 **pdata, size_t *pnbytes)
convertUnscaledToPdfData()
l_ok saConcatenatePdf(SARRAY *sa, const char *fileout)
saConcatenatePdf()
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 selectDefaultPdfEncoding(PIX *pix, l_int32 *ptype)
selectDefaultPdfEncoding()
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()
l_ok saConvertUnscaledFilesToPdfData(SARRAY *sa, const char *title, l_uint8 **pdata, size_t *pnbytes)
saConvertUnscaledFilesToPdfData()
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()
BOXAA * convertNumberedMasksToBoxaa(const char *dirname, const char *substr, l_int32 numpre, l_int32 numpost)
convertNumberedMasksToBoxaa()
@ REMOVE_CMAP_TO_GRAYSCALE
@ REMOVE_CMAP_BASED_ON_SRC