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);
467l_int32 w, h, d, factor, ncolors;
471 return ERROR_INT(
"&type not defined", __func__, 1);
474 return ERROR_INT(
"pix not defined", __func__, 1);
475 pixGetDimensions(pix, &w, &h, &d);
476 cmap = pixGetColormap(pix);
477 if (d == 8 && !cmap) {
478 factor = L_MAX(1, (l_int32)sqrt((l_float64)(w * h) / 20000.));
479 pixNumColors(pix, factor, &ncolors);
486 }
else if (cmap || d == 2 || d == 4) {
488 }
else if (d == 8 || d == 32) {
490 }
else if (d == 16) {
493 return ERROR_INT(
"type selection failure", __func__, 1);
536 return ERROR_INT(
"dirname not defined", __func__, 1);
538 return ERROR_INT(
"fileout not defined", __func__, 1);
540 if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
541 return ERROR_INT(
"sa not made", __func__, 1);
571 return ERROR_INT(
"sa not defined", __func__, 1);
575 if (data) LEPT_FREE(data);
576 return ERROR_INT(
"pdf data not made", __func__, 1);
579 ret = l_binaryWrite(fileout,
"w", data, nbytes);
582 L_ERROR(
"pdf data not written to file\n", __func__);
611l_int32 i, n, ret, npages;
617 return ERROR_INT(
"&data not defined", __func__, 1);
620 return ERROR_INT(
"&nbytes not defined", __func__, 1);
623 return ERROR_INT(
"sa not defined", __func__, 1);
626 n = sarrayGetCount(sa);
627 pa_data = ptraCreate(n);
628 for (i = 0; i < n; i++) {
629 if (i && (i % 10 == 0)) lept_stderr(
".. %d ", i);
630 fname = sarrayGetString(sa, i,
L_NOCOPY);
637 ba = l_byteaInitFromMem(imdata, imbytes);
638 if (imdata) LEPT_FREE(imdata);
639 ptraAdd(pa_data, ba);
641 ptraGetActualCount(pa_data, &npages);
643 L_ERROR(
"no pdf files made\n", __func__);
644 ptraDestroy(&pa_data, FALSE, FALSE);
649 lept_stderr(
"\nconcatenating ... ");
650 ret = ptraConcatenatePdfToData(pa_data, NULL, pdata, pnbytes);
651 lept_stderr(
"done\n");
654 ptraGetActualCount(pa_data, &npages);
655 for (i = 0; i < npages; i++) {
659 ptraDestroy(&pa_data, FALSE, FALSE);
690 return ERROR_INT(
"&data not defined", __func__, 1);
693 return ERROR_INT(
"&nbytes not defined", __func__, 1);
696 return ERROR_INT(
"fname not defined", __func__, 1);
698 findFileFormat(fname, &format);
699 if (format == IFF_UNKNOWN) {
700 L_WARNING(
"file %s format is unknown; skip\n", __func__, fname);
703 if (format == IFF_PS || format == IFF_LPDF) {
704 L_WARNING(
"file %s format is %d; skip\n", __func__, fname, format);
711 l_generateCIDataForPdf(fname, NULL, 0, &cid);
713 L_ERROR(
"file %s format is %d; unreadable\n", __func__, fname, format);
719 cidConvertToPdfData(cid, title, pdata, pnbytes);
758 l_float32 scalefactor,
769 return ERROR_INT(
"pixa not defined", __func__, 1);
772 title, &data, &nbytes);
775 return ERROR_INT(
"conversion to pdf failed", __func__, 1);
778 ret = l_binaryWrite(fileout,
"w", data, nbytes);
781 L_ERROR(
"pdf data not written to file\n", __func__);
810 l_float32 scalefactor,
818l_int32 i, n, ret, scaledres, pagetype;
825 return ERROR_INT(
"&data not defined", __func__, 1);
828 return ERROR_INT(
"&nbytes not defined", __func__, 1);
831 return ERROR_INT(
"pixa not defined", __func__, 1);
832 if (scalefactor <= 0.0) scalefactor = 1.0;
833 if (scalefactor >= 50.0)
834 return ERROR_INT(
"scalefactor too large", __func__, 1);
838 L_WARNING(
"invalid compression type; using per-page default\n",
842 if (quality < 0 || quality > 100)
843 return ERROR_INT(
"invalid quality", __func__, 1);
846 n = pixaGetCount(pixa);
847 pa_data = ptraCreate(n);
848 for (i = 0; i < n; i++) {
849 if ((pixs = pixaGetPix(pixa, i,
L_CLONE)) == NULL) {
850 L_ERROR(
"pixs[%d] not retrieved\n", __func__, i);
853 if (scalefactor != 1.0)
854 pix = pixScale(pixs, scalefactor, scalefactor);
856 pix = pixClone(pixs);
859 L_ERROR(
"pix[%d] not made\n", __func__, i);
862 scaledres = (l_int32)(res * scalefactor);
868 L_ERROR(
"encoding type selection failed for pix[%d]\n",
874 ret = pixConvertToPdfData(pix, pagetype, quality, &imdata, &imbytes,
875 0, 0, scaledres, title, NULL, 0);
879 L_ERROR(
"pdf encoding failed for pix[%d]\n", __func__, i);
882 ba = l_byteaInitFromMem(imdata, imbytes);
884 ptraAdd(pa_data, ba);
886 ptraGetActualCount(pa_data, &n);
888 L_ERROR(
"no pdf files made\n", __func__);
889 ptraDestroy(&pa_data, FALSE, FALSE);
894 ret = ptraConcatenatePdfToData(pa_data, NULL, pdata, pnbytes);
896 ptraGetActualCount(pa_data, &n);
897 for (i = 0; i < n; i++) {
901 ptraDestroy(&pa_data, FALSE, FALSE);
985 return ERROR_INT(
"filein not defined", __func__, 1);
988 return ERROR_INT(
"fileout not defined", __func__, 1);
992 res, title, plpd, position))
993 return ERROR_INT(
"pdf data not made", __func__, 1);
996 ret = l_binaryWrite(fileout,
"w", data, nbytes);
999 return ERROR_INT(
"pdf data not written to file", __func__, 1);
1043 const char *fileout,
1055 return ERROR_INT(
"image data not defined", __func__, 1);
1058 return ERROR_INT(
"fileout not defined", __func__, 1);
1061 if ((pix = pixReadMem(imdata, size)) == NULL)
1062 return ERROR_INT(
"pix not read", __func__, 1);
1068 title, plpd, position);
1121 return ERROR_INT(
"&data not defined", __func__, 1);
1124 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1127 return ERROR_INT(
"filein not defined", __func__, 1);
1129 if ((pix = pixRead(filein)) == NULL)
1130 return ERROR_INT(
"pix not made", __func__, 1);
1132 pixConvertToPdfData(pix, type, quality, pdata, pnbytes,
1133 x, y, res, title, plpd, position);
1189 return ERROR_INT(
"&data not defined", __func__, 1);
1192 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1195 return ERROR_INT(
"image data not defined", __func__, 1);
1201 if ((pix = pixReadMem(imdata, size)) == NULL)
1202 return ERROR_INT(
"pix not read", __func__, 1);
1207 ret = pixConvertToPdfData(pix, type, quality, pdata, pnbytes,
1208 x, y, res, title, plpd, position);
1251 const char *fileout,
1264 return ERROR_INT(
"pix not defined", __func__, 1);
1267 return ERROR_INT(
"fileout not defined", __func__, 1);
1270 if (pixConvertToPdfData(pix, type, quality, &data, &nbytes,
1271 x, y, res, title, plpd, position)) {
1273 return ERROR_INT(
"pdf data not made", __func__, 1);
1277 ret = l_binaryWrite(fileout,
"w", data, nbytes);
1280 return ERROR_INT(
"pdf data not written to file", __func__, 1);
1311size_t nbytes, nbytes_written;
1314 return ERROR_INT(
"stream not opened", __func__, 1);
1316 return ERROR_INT(
"pix not defined", __func__, 1);
1320 return ERROR_INT(
"pdf data not made", __func__, 1);
1323 nbytes_written = fwrite(data, 1, nbytes, fp);
1325 if (nbytes != nbytes_written)
1326 return ERROR_INT(
"failure writing pdf data to stream", __func__, 1);
1359 if (pdata) *pdata = NULL;
1360 if (pnbytes) *pnbytes = 0;
1361 if (!pdata || !pnbytes)
1362 return ERROR_INT(
"&data or &nbytes not defined", __func__, 1);
1364 return ERROR_INT(
"pix not defined", __func__, 1);
1367 ret = pixConvertToPdfData(pix, type, 75, pdata, pnbytes,
1368 0, 0, res, title, NULL, 0);
1370 return ERROR_INT(
"pdf data not made", __func__, 1);
1429 l_float32 scalefactor,
1431 const char *fileout)
1434l_uint8 *imdata, *data;
1435l_int32 i, npages, nboxa, nboxes, ret;
1436size_t imbytes, databytes;
1443 return ERROR_INT(
"dirname not defined", __func__, 1);
1445 return ERROR_INT(
"fileout not defined", __func__, 1);
1447 if ((sa = getNumberedPathnamesInDirectory(dirname, substr, 0, 0, 10000))
1449 return ERROR_INT(
"sa not made", __func__, 1);
1451 npages = sarrayGetCount(sa);
1455 nboxa = boxaaGetCount(baa);
1456 if (nboxa < npages) {
1457 boxa = boxaCreate(1);
1458 boxaaExtendWithInit(baa, npages, boxa);
1464 pa_data = ptraCreate(npages);
1465 for (i = 0; i < npages; i++) {
1466 fname = sarrayGetString(sa, i,
L_NOCOPY);
1467 if (!strcmp(fname,
""))
continue;
1470 boxa = boxaaGetBoxa(baa, i,
L_CLONE);
1471 nboxes = boxaGetCount(boxa);
1476 quality, scalefactor, title,
1480 L_ERROR(
"pdf encoding failed for %s\n", __func__, fname);
1483 ba = l_byteaInitFromMem(imdata, imbytes);
1484 if (imdata) LEPT_FREE(imdata);
1485 ptraAdd(pa_data, ba);
1489 ptraGetActualCount(pa_data, &npages);
1491 L_ERROR(
"no pdf files made\n", __func__);
1492 ptraDestroy(&pa_data, FALSE, FALSE);
1497 ret = ptraConcatenatePdfToData(pa_data, NULL, &data, &databytes);
1500 ptraGetActualCount(pa_data, &npages);
1501 for (i = 0; i < npages; i++) {
1503 l_byteaDestroy(&ba);
1505 ptraDestroy(&pa_data, FALSE, FALSE);
1508 if (data) LEPT_FREE(data);
1509 return ERROR_INT(
"pdf data not made", __func__, 1);
1512 ret = l_binaryWrite(fileout,
"w", data, databytes);
1515 L_ERROR(
"pdf data not written to file\n", __func__);
1553 return (
BOXAA *)ERROR_PTR(
"dirname not defined", __func__, NULL);
1555 if ((sa = getNumberedPathnamesInDirectory(dirname, substr, numpre,
1556 numpost, 10000)) == NULL)
1557 return (
BOXAA *)ERROR_PTR(
"sa not made", __func__, NULL);
1560 n = sarrayGetCount(sa);
1561 baa = boxaaCreate(n);
1562 boxa = boxaCreate(1);
1563 boxaaInitFull(baa, boxa);
1565 for (i = 0; i < n; i++) {
1566 fname = sarrayGetString(sa, i,
L_NOCOPY);
1567 if (!strcmp(fname,
""))
continue;
1568 if ((pix = pixRead(fname)) == NULL) {
1569 L_WARNING(
"invalid image on page %d\n", __func__, i);
1572 boxa = pixConnComp(pix, NULL, 8);
1573 boxaaReplaceBoxa(baa, i, boxa);
1653 l_float32 scalefactor,
1655 const char *fileout)
1661 return ERROR_INT(
"filein not defined", __func__, 1);
1663 return ERROR_INT(
"fileout not defined", __func__, 1);
1666 return ERROR_INT(
"invalid conversion type", __func__, 1);
1667 if (boxa && scalefactor > 1.0) {
1668 L_WARNING(
"setting scalefactor to 1.0\n", __func__);
1672 if ((pixs = pixRead(filein)) == NULL)
1673 return ERROR_INT(
"pixs not made", __func__, 1);
1676 scalefactor, title, fileout);
1710 l_float32 scalefactor,
1712 const char *fileout)
1719 return ERROR_INT(
"pixs not defined", __func__, 1);
1721 return ERROR_INT(
"fileout not defined", __func__, 1);
1724 return ERROR_INT(
"invalid conversion type", __func__, 1);
1725 if (boxa && scalefactor > 1.0) {
1726 L_WARNING(
"setting scalefactor to 1.0\n", __func__);
1731 scalefactor, title, &data, &nbytes);
1733 return ERROR_INT(
"pdf generation failure", __func__, 1);
1735 ret = l_binaryWrite(fileout,
"w", data, nbytes);
1736 if (data) LEPT_FREE(data);
1772 l_float32 scalefactor,
1781 return ERROR_INT(
"&data not defined", __func__, 1);
1784 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1787 return ERROR_INT(
"filein not defined", __func__, 1);
1790 return ERROR_INT(
"invalid conversion type", __func__, 1);
1791 if (boxa && scalefactor > 1.0) {
1792 L_WARNING(
"setting scalefactor to 1.0\n", __func__);
1796 if ((pixs = pixRead(filein)) == NULL)
1797 return ERROR_INT(
"pixs not made", __func__, 1);
1800 quality, scalefactor, title,
1836 l_float32 scalefactor,
1841l_int32 i, nbox, seq, bx, by, bw, bh, upscale;
1843BOX *box, *boxc, *box2;
1844PIX *pix, *pixt1, *pixt2, *pixt3, *pixt4, *pixt5, *pixt6;
1849 return ERROR_INT(
"&data not defined", __func__, 1);
1852 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1855 return ERROR_INT(
"pixs not defined", __func__, 1);
1858 return ERROR_INT(
"invalid conversion type", __func__, 1);
1859 if (boxa && (scalefactor <= 0.0 || scalefactor > 1.0)) {
1860 L_WARNING(
"setting scalefactor to 1.0\n", __func__);
1866 res = DefaultInputRes;
1867 scale = (l_float32)((l_int32)(scalefactor * res + 0.5)) / (l_float32)res;
1868 cmap = pixGetColormap(pixs);
1871 if (!boxa || boxaGetCount(boxa) == 0) {
1872 if (pixGetDepth(pixs) > 1 && type ==
L_G4_ENCODE) {
1876 pixt1 = pixConvertTo8(pixs, FALSE);
1877 pixt2 = pixScaleGray2xLIThresh(pixt1, thresh);
1878 pixConvertToPdfData(pixt2, type, quality, pdata, pnbytes,
1879 0, 0, 2 * res, title, NULL, 0);
1883 pixConvertToPdfData(pixs, type, quality, pdata, pnbytes,
1884 0, 0, res, title, NULL, 0);
1895 pixt1 = pixSetBlackOrWhiteBoxa(pixs, boxa,
L_SET_WHITE);
1896 nbox = boxaGetCount(boxa);
1898 pixt2 = pixCreateTemplate(pixs);
1900 for (i = 0; i < nbox; i++) {
1901 box = boxaGetBox(boxa, i,
L_CLONE);
1902 pix = pixClipRectangle(pixs, box, &boxc);
1903 boxGetGeometry(boxc, &bx, &by, &bw, &bh);
1904 pixRasterop(pixt2, bx, by, bw, bh,
PIX_SRC, pix, 0, 0);
1910 if (pixGetDepth(pixt3) == 1)
1911 pixt4 = pixScaleToGray(pixt3, scale);
1913 pixt4 = pixScale(pixt3, scale, scale);
1914 pixConvertToPdfData(pixt4,
L_JPEG_ENCODE, quality, pdata, pnbytes,
1915 0, 0, (l_int32)(scale * res), title,
1918 if (pixGetDepth(pixt1) == 1) {
1919 pixt5 = pixClone(pixt1);
1922 pixt6 = pixConvertTo8(pixt1, 0);
1923 pixt5 = pixScaleGray2xLIThresh(pixt6, thresh);
1927 pixConvertToPdfData(pixt5,
L_G4_ENCODE, quality, pdata, pnbytes,
1939 pixConvertToPdfData(pixt1, type, quality, pdata, pnbytes, 0, 0,
1941 for (i = 0; i < nbox; i++) {
1942 box = boxaGetBox(boxa, i,
L_CLONE);
1943 pixt2 = pixClipRectangle(pixs, box, &boxc);
1945 if (pixGetDepth(pixt3) == 1)
1946 pixt4 = pixScaleToGray(pixt3, scale);
1948 pixt4 = pixScale(pixt3, scale, scale);
1949 box2 = boxTransform(boxc, 0, 0, scale, scale);
1950 boxGetGeometry(box2, &bx, &by, NULL, &bh);
1952 pixConvertToPdfData(pixt4,
L_JPEG_ENCODE, quality, pdata, pnbytes,
1953 bx, by, (l_int32)(scale * res), title,
1995 const char *fileout)
2001 return ERROR_INT(
"dirname not defined", __func__, 1);
2003 return ERROR_INT(
"fileout not defined", __func__, 1);
2005 if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
2006 return ERROR_INT(
"sa not made", __func__, 1);
2027 const char *fileout)
2034 return ERROR_INT(
"sa not defined", __func__, 1);
2036 return ERROR_INT(
"fileout not defined", __func__, 1);
2040 return ERROR_INT(
"pdf data not made", __func__, 1);
2041 ret = l_binaryWrite(fileout,
"w", data, nbytes);
2061 const char *fileout)
2068 return ERROR_INT(
"pa not defined", __func__, 1);
2070 return ERROR_INT(
"fileout not defined", __func__, 1);
2072 ret = ptraConcatenatePdfToData(pa, NULL, &data, &nbytes);
2074 return ERROR_INT(
"pdf data not made", __func__, 1);
2075 ret = l_binaryWrite(fileout,
"w", data, nbytes);
2112 return ERROR_INT(
"&data not defined", __func__, 1);
2115 return ERROR_INT(
"&nbytes not defined", __func__, 1);
2118 return ERROR_INT(
"dirname not defined", __func__, 1);
2120 if ((sa = getSortedPathnamesInDirectory(dirname, substr, 0, 0)) == NULL)
2121 return ERROR_INT(
"sa not made", __func__, 1);
2147l_int32 i, npages, ret;
2152 return ERROR_INT(
"&data not defined", __func__, 1);
2155 return ERROR_INT(
"&nbytes not defined", __func__, 1);
2158 return ERROR_INT(
"sa not defined", __func__, 1);
2161 if ((npages = sarrayGetCount(sa)) == 0)
2162 return ERROR_INT(
"no filenames found", __func__, 1);
2163 pa_data = ptraCreate(npages);
2164 for (i = 0; i < npages; i++) {
2165 fname = sarrayGetString(sa, i,
L_NOCOPY);
2166 bas = l_byteaInitFromFile(fname);
2167 ptraAdd(pa_data, bas);
2170 ret = ptraConcatenatePdfToData(pa_data, sa, pdata, pnbytes);
2173 ptraGetActualCount(pa_data, &npages);
2174 for (i = 0; i < npages; i++) {
2176 l_byteaDestroy(&bas);
2178 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
struct PixColormap PIXCMAP