97 #include <config_auto.h>
101 #include "allheaders.h"
108 static l_int32 var_PS_WRITE_BOUNDING_BOX = 1;
111 static const l_int32 DefaultInputRes = 300;
112 static const l_int32 MinRes = 5;
113 static const l_int32 MaxRes = 3000;
116 static const l_int32 LetterWidth = 612;
117 static const l_int32 LetterHeight = 792;
118 static const l_int32 A4Width = 595;
119 static const l_int32 A4Height = 842;
120 static const l_float32 DefaultFillFraction = 0.95;
122 #ifndef NO_CONSOLE_IO
125 #define DEBUG_FLATE 0
140 l_int32 res, l_float32 scale,
141 l_float32 *pxpt, l_float32 *pypt,
142 l_float32 *pwpt, l_float32 *phpt);
145 l_int32 *pnbytes, l_int32 x, l_int32 y,
146 l_int32 res, l_float32 scale,
147 l_int32 pageno, l_int32 endpage);
149 l_float32 xpt, l_float32 ypt, l_float32 wpt,
150 l_float32 hpt, l_int32 pageno, l_int32 endpage);
152 l_int32 *pnbytes, l_int32 x, l_int32 y,
153 l_int32 res, l_float32 scale, l_int32 pageno,
154 l_int32 maskflag, l_int32 endpage);
156 l_float32 ypt, l_float32 wpt, l_float32 hpt,
157 l_int32 maskflag, l_int32 pageno, l_int32 endpage);
159 l_int32 *pnbytes, l_int32 x, l_int32 y,
160 l_int32 res, l_float32 scale,
161 l_int32 pageno, l_int32 endpage);
163 l_float32 xpt, l_float32 ypt, l_float32 wpt,
164 l_float32 hpt, l_int32 pageno, l_int32 endpage);
197 return ERROR_INT(
"filein not defined", __func__, 1);
199 return ERROR_INT(
"fileout not defined", __func__, 1);
201 if ((pix =
pixRead(filein)) == NULL)
202 return ERROR_INT(
"image not read from file", __func__, 1);
203 w = pixGetWidth(pix);
204 h = pixGetHeight(pix);
205 if (w * 11.0 > h * 8.5)
206 scale = 8.5 * 300. / (l_float32)w;
208 scale = 11.0 * 300. / (l_float32)h;
211 return ERROR_INT(
"file not opened for write", __func__, 1);
250 return (l_int32)ERROR_INT(
"stream not open", __func__, 1);
252 return (l_int32)ERROR_INT(
"pix not defined", __func__, 1);
255 return (l_int32)ERROR_INT(
"pixc not made", __func__, 1);
259 return (l_int32)ERROR_INT(
"outstr not made", __func__, 1);
261 length = strlen(outstr);
262 fwrite(outstr, 1, length, fp);
343 char *hexdata, *outstr;
345 l_int32 i, j, k, w, h, d;
346 l_float32 wpt, hpt, xpt, ypt;
347 l_int32 wpl, psbpl, hexbytes, boxflag, bps;
348 l_uint32 *line, *data;
352 return (
char *)ERROR_PTR(
"pixs not defined", __func__, NULL);
355 return (
char *)ERROR_PTR(
"pix not made", __func__, NULL);
375 wpl = pixGetWpl(pix);
376 if (d == 1 || d == 8)
377 psbpl = (w * d + 7) / 8;
381 hexbytes = 2 * psbpl * h;
382 if ((hexdata = (
char *)LEPT_CALLOC(hexbytes + 1,
sizeof(
char))) == NULL)
383 return (
char *)ERROR_PTR(
"hexdata not made", __func__, NULL);
384 if (d == 1 || d == 8) {
385 for (i = 0, k = 0; i < h; i++) {
386 line = data + i * wpl;
387 for (j = 0; j < psbpl; j++) {
395 for (i = 0, k = 0; i < h; i++) {
396 line = data + i * wpl;
397 for (j = 0; j < w; j++) {
416 xpt, ypt, wpt, hpt, boxflag);
419 return (
char *)ERROR_PTR(
"outstr not made", __func__, NULL);
458 char bigbuf[Bufsize];
462 return (
char *)ERROR_PTR(
"hexdata not defined", __func__, NULL);
467 snprintf(bigbuf,
sizeof(bigbuf),
468 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
469 xpt, ypt, xpt + wpt, ypt + hpt);
477 "{1 exch sub} settransfer %invert binary",
L_COPY);
479 snprintf(bigbuf,
sizeof(bigbuf),
480 "/bpl %d string def %%bpl as a string", psbpl);
482 snprintf(bigbuf,
sizeof(bigbuf),
483 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
485 snprintf(bigbuf,
sizeof(bigbuf),
486 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
488 snprintf(bigbuf,
sizeof(bigbuf),
489 "%d %d %d %%image dimensions in pixels", w, h, bps);
491 snprintf(bigbuf,
sizeof(bigbuf),
492 "[%d %d %d %d %d %d] %%mapping matrix: [w 0 0 -h 0 h]",
497 if (d == 1 || d == 8)
499 "{currentfile bpl readhexstring pop} image",
L_COPY);
502 "{currentfile bpl readhexstring pop} false 3 colorimage",
505 if (d == 1 || d == 8)
507 "{currentfile bpl readhexstring pop} bind image",
L_COPY);
510 "{currentfile bpl readhexstring pop} bind false 3 colorimage",
523 if (!outstr) L_ERROR(
"outstr not made\n", __func__);
560 l_int32 bx, by, bw, bh;
561 l_float32 winch, hinch, xinch, yinch, fres;
564 res = DefaultInputRes;
565 fres = (l_float32)res;
571 fres = (l_float32)res / scale;
576 if (res < MinRes || res > MaxRes) {
577 L_WARNING(
"res %d out of bounds; using default res; no scaling\n",
579 res = DefaultInputRes;
580 fres = (l_float32)res;
584 winch = (l_float32)wpix / fres;
585 hinch = (l_float32)hpix / fres;
586 xinch = (8.5 - winch) / 2.;
587 yinch = (11.0 - hinch) / 2.;
591 winch = (l_float32)wpix / fres;
593 winch = (l_float32)bw / 1000.;
595 hinch = (l_float32)hpix / fres;
597 hinch = (l_float32)bh / 1000.;
598 xinch = (l_float32)bx / 1000.;
599 yinch = (l_float32)by / 1000.;
603 L_WARNING(
"left edge < 0.0 inch\n", __func__);
604 if (xinch + winch > 8.5)
605 L_WARNING(
"right edge > 8.5 inch\n", __func__);
607 L_WARNING(
"bottom edge < 0.0 inch\n", __func__);
608 if (yinch + hinch > 11.0)
609 L_WARNING(
"top edge > 11.0 inch\n", __func__);
637 *pnib1 =
'a' + (nib - 10);
642 *pnib2 =
'a' + (nib - 10);
672 l_int32 w, h, nbytes, ret;
673 l_float32 xpt, ypt, wpt, hpt;
677 return ERROR_INT(
"filein not defined", __func__, 1);
679 return ERROR_INT(
"fileout not defined", __func__, 1);
683 return ERROR_INT(
"jpeg data not made", __func__, 1);
691 if (w * 11.0 > h * 8.5) {
693 hpt = wpt * (l_float32)h / (l_float32)w;
696 wpt = hpt * (l_float32)w / (l_float32)h;
704 return ERROR_INT(
"outstr not made", __func__, 1);
705 nbytes = strlen(outstr);
709 if (ret) L_ERROR(
"ps string not written to file\n", __func__);
784 const char *operation,
796 return ERROR_INT(
"filein not defined", __func__, 1);
798 return ERROR_INT(
"fileout not defined", __func__, 1);
799 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
800 return ERROR_INT(
"operation must be \"w\" or \"a\"", __func__, 1);
804 return ERROR_INT(
"ps string not made", __func__, 1);
808 return ERROR_INT(
"ps string not written to file", __func__, 1);
853 l_float32 xpt, ypt, wpt, hpt;
857 return ERROR_INT(
"&outstr not defined", __func__, 1);
859 return ERROR_INT(
"&nbytes not defined", __func__, 1);
863 return ERROR_INT(
"filein not defined", __func__, 1);
867 return ERROR_INT(
"jpeg data not made", __func__, 1);
878 res = DefaultInputRes;
884 xpt = scale * x * 72. / res;
885 ypt = scale * y * 72. / res;
886 wpt = scale * cid->
w * 72. / res;
887 hpt = scale * cid->
h * 72. / res;
893 lept_stderr(
"w = %d, h = %d, bps = %d, spp = %d\n",
894 cid->
w, cid->
h, cid->
bps, cid->
spp);
895 lept_stderr(
"comp bytes = %ld, nbytes85 = %ld, ratio = %5.3f\n",
898 lept_stderr(
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
903 outstr =
generateJpegPS(NULL, cid, xpt, ypt, wpt, hpt, pageno, endpage);
906 return ERROR_INT(
"outstr not made", __func__, 1);
908 *pnbytes = strlen(outstr);
943 l_int32 w, h, bps, spp;
945 char bigbuf[Bufsize];
949 return (
char *)ERROR_PTR(
"jpeg data not defined", __func__, NULL);
959 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
961 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: Jpeg compressed PS");
965 if (var_PS_WRITE_BOUNDING_BOX == 1) {
966 snprintf(bigbuf,
sizeof(bigbuf),
967 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
968 xpt, ypt, xpt + wpt, ypt + hpt);
974 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
979 "/RawData currentfile /ASCII85Decode filter def",
L_COPY);
982 snprintf(bigbuf,
sizeof(bigbuf),
983 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
986 snprintf(bigbuf,
sizeof(bigbuf),
987 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
998 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1000 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1002 snprintf(bigbuf,
sizeof(bigbuf),
1003 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1006 snprintf(bigbuf,
sizeof(bigbuf),
" /BitsPerComponent %d", bps);
1019 if (endpage == TRUE)
1059 const char *fileout)
1062 l_int32 w, h, nbytes, ret;
1063 l_float32 xpt, ypt, wpt, hpt;
1067 return ERROR_INT(
"filein not defined", __func__, 1);
1069 return ERROR_INT(
"fileout not defined", __func__, 1);
1072 return ERROR_INT(
"g4 data not made", __func__, 1);
1080 if (w * 11.0 > h * 8.5) {
1082 hpt = wpt * (l_float32)h / (l_float32)w;
1085 wpt = hpt * (l_float32)w / (l_float32)h;
1090 outstr =
generateG4PS(NULL, cid, xpt, ypt, wpt, hpt, 1, 1, 1);
1093 return ERROR_INT(
"outstr not made", __func__, 1);
1094 nbytes = strlen(outstr);
1098 if (ret) L_ERROR(
"ps string not written to file\n", __func__);
1163 const char *fileout,
1164 const char *operation,
1174 l_int32 nbytes, ret;
1177 return ERROR_INT(
"filein not defined", __func__, 1);
1179 return ERROR_INT(
"fileout not defined", __func__, 1);
1180 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
1181 return ERROR_INT(
"operation must be \"w\" or \"a\"", __func__, 1);
1184 pageno, maskflag, endpage))
1185 return ERROR_INT(
"ps string not made", __func__, 1);
1190 return ERROR_INT(
"ps string not written to file", __func__, 1);
1235 l_float32 xpt, ypt, wpt, hpt;
1239 return ERROR_INT(
"&outstr not defined", __func__, 1);
1241 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1245 return ERROR_INT(
"filein not defined", __func__, 1);
1248 return ERROR_INT(
"g4 data not made", __func__, 1);
1265 xpt = scale * x * 72. / res;
1266 ypt = scale * y * 72. / res;
1267 wpt = scale * cid->
w * 72. / res;
1268 hpt = scale * cid->
h * 72. / res;
1278 lept_stderr(
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
1279 xpt, ypt, wpt, hpt);
1284 maskflag, pageno, endpage);
1287 return ERROR_INT(
"outstr not made", __func__, 1);
1289 *pnbytes = strlen(outstr);
1329 char bigbuf[Bufsize];
1333 return (
char *)ERROR_PTR(
"g4 data not defined", __func__, NULL);
1341 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
1343 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: G4 compressed PS");
1347 if (var_PS_WRITE_BOUNDING_BOX == 1) {
1348 snprintf(bigbuf,
sizeof(bigbuf),
1349 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
1350 xpt, ypt, xpt + wpt, ypt + hpt);
1356 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
1362 snprintf(bigbuf,
sizeof(bigbuf),
1363 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1366 snprintf(bigbuf,
sizeof(bigbuf),
1367 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1374 " /RawData currentfile /ASCII85Decode filter def",
L_COPY);
1377 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1379 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1381 snprintf(bigbuf,
sizeof(bigbuf),
1382 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1393 snprintf(bigbuf,
sizeof(bigbuf),
" /Columns %d", w);
1395 snprintf(bigbuf,
sizeof(bigbuf),
" /Rows %d", h);
1398 if (maskflag == TRUE)
1403 if (endpage == TRUE)
1448 const char *fileout,
1449 l_float32 fillfract)
1452 l_int32 i, npages, w, h, istiff;
1458 return ERROR_INT(
"filein not defined", __func__, 1);
1460 return ERROR_INT(
"fileout not defined", __func__, 1);
1463 return ERROR_INT(
"file not found", __func__, 1);
1467 return ERROR_INT(
"file not tiff format", __func__, 1);
1472 if (fillfract == 0.0)
1473 fillfract = DefaultFillFraction;
1475 for (i = 0; i < npages; i++) {
1477 return ERROR_INT(
"pix not made", __func__, 1);
1480 if (w == 1728 && h < w)
1486 pixWrite(tempfile, pixs, IFF_TIFF_G4);
1487 scale = L_MIN(fillfract * 2550 / w, fillfract * 3300 / h);
1490 i + 1, FALSE, TRUE);
1493 i + 1, FALSE, TRUE);
1495 LEPT_FREE(tempfile);
1526 const char *fileout)
1529 l_int32 w, h, nbytes, ret;
1530 l_float32 xpt, ypt, wpt, hpt;
1534 return ERROR_INT(
"filein not defined", __func__, 1);
1536 return ERROR_INT(
"fileout not defined", __func__, 1);
1539 return ERROR_INT(
"flate data not made", __func__, 1);
1547 if (w * 11.0 > h * 8.5) {
1549 hpt = wpt * (l_float32)h / (l_float32)w;
1552 wpt = hpt * (l_float32)w / (l_float32)h;
1560 return ERROR_INT(
"outstr not made", __func__, 1);
1561 nbytes = strlen(outstr);
1565 if (ret) L_ERROR(
"ps string not written to file\n", __func__);
1638 const char *fileout,
1639 const char *operation,
1648 l_int32 nbytes, ret;
1651 return ERROR_INT(
"filein not defined", __func__, 1);
1653 return ERROR_INT(
"fileout not defined", __func__, 1);
1654 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
1655 return ERROR_INT(
"operation must be \"w\" or \"a\"", __func__, 1);
1659 return ERROR_INT(
"ps string not made", __func__, 1);
1663 if (ret) L_ERROR(
"ps string not written to file\n", __func__);
1713 l_float32 xpt, ypt, wpt, hpt;
1717 return ERROR_INT(
"&outstr not defined", __func__, 1);
1719 return ERROR_INT(
"&nbytes not defined", __func__, 1);
1723 return ERROR_INT(
"filein not defined", __func__, 1);
1726 return ERROR_INT(
"flate data not made", __func__, 1);
1737 res = DefaultInputRes;
1739 xpt = scale * x * 72. / res;
1740 ypt = scale * y * 72. / res;
1741 wpt = scale * cid->
w * 72. / res;
1742 hpt = scale * cid->
h * 72. / res;
1748 lept_stderr(
"w = %d, h = %d, bps = %d, spp = %d\n",
1749 cid->
w, cid->
h, cid->
bps, cid->
spp);
1750 lept_stderr(
"uncomp bytes = %ld, comp bytes = %ld, nbytes85 = %ld\n",
1753 lept_stderr(
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
1754 xpt, ypt, wpt, hpt);
1758 outstr =
generateFlatePS(NULL, cid, xpt, ypt, wpt, hpt, pageno, endpage);
1761 return ERROR_INT(
"outstr not made", __func__, 1);
1763 *pnbytes = strlen(outstr);
1793 l_int32 w, h, bps, spp;
1795 char bigbuf[Bufsize];
1799 return (
char *)ERROR_PTR(
"flate data not defined", __func__, NULL);
1809 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
1811 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: Flate compressed PS");
1815 if (var_PS_WRITE_BOUNDING_BOX == 1) {
1816 snprintf(bigbuf,
sizeof(bigbuf),
1817 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
1818 xpt, ypt, xpt + wpt, ypt + hpt);
1824 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
1828 snprintf(bigbuf,
sizeof(bigbuf),
1829 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1832 snprintf(bigbuf,
sizeof(bigbuf),
1833 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1838 snprintf(bigbuf,
sizeof(bigbuf),
1839 "[ /Indexed /DeviceRGB %d %%set colormap type/size",
1845 }
else if (spp == 1) {
1852 "/RawData currentfile /ASCII85Decode filter def",
L_COPY);
1854 "/Data RawData << >> /FlateDecode filter def",
L_COPY);
1857 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1859 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1861 snprintf(bigbuf,
sizeof(bigbuf),
" /BitsPerComponent %d", bps);
1863 snprintf(bigbuf,
sizeof(bigbuf),
1864 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1869 }
else if (spp == 1) {
1882 if (endpage == TRUE)
1929 return ERROR_INT(
"&data not defined", __func__, 1 );
1931 return ERROR_INT(
"&size not defined", __func__, 1 );
1933 return ERROR_INT(
"&pix not defined", __func__, 1 );
1936 *psize = strlen((
char *)(*pdata));
1956 l_float32 fillfract)
1958 l_int32 resw, resh, res;
1960 if (fillfract == 0.0)
1961 fillfract = DefaultFillFraction;
1962 resw = (l_int32)((w * 72.) / (LetterWidth * fillfract));
1963 resh = (l_int32)((h * 72.) / (LetterHeight * fillfract));
1964 res = L_MAX(resw, resh);
1981 l_float32 fillfract)
1983 l_int32 resw, resh, res;
1985 if (fillfract == 0.0)
1986 fillfract = DefaultFillFraction;
1987 resw = (l_int32)((w * 72.) / (A4Width * fillfract));
1988 resh = (l_int32)((h * 72.) / (A4Height * fillfract));
1989 res = L_MAX(resw, resh);
1998 l_psWriteBoundingBox(l_int32 flag)
2000 var_PS_WRITE_BOUNDING_BOX = flag;
#define GET_DATA_BYTE(pdata, n)
l_ok boxGetGeometry(const BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
L_COMP_DATA * l_generateG4Data(const char *fname, l_int32 ascii85flag)
l_generateG4Data()
L_COMP_DATA * l_generateJpegData(const char *fname, l_int32 ascii85flag)
l_generateJpegData()
void l_CIDataDestroy(L_COMP_DATA **pcid)
l_CIDataDestroy()
L_COMP_DATA * l_generateFlateData(const char *fname, l_int32 ascii85flag)
l_generateFlateData()
l_uint32 * pixGetData(PIX *pix)
pixGetData()
void pixDestroy(PIX **ppix)
pixDestroy()
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
PIX * pixClone(PIX *pixs)
pixClone()
PIX * pixConvertForPSWrap(PIX *pixs)
pixConvertForPSWrap()
char * pixWriteStringPS(PIX *pixs, BOX *box, l_int32 res, l_float32 scale)
pixWriteStringPS()
static char * generateFlatePS(const char *filein, L_COMP_DATA *cid, l_float32 xpt, l_float32 ypt, l_float32 wpt, l_float32 hpt, l_int32 pageno, l_int32 endpage)
generateFlatePS()
static l_ok convertG4ToPSString(const char *filein, char **poutstr, l_int32 *pnbytes, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 maskflag, l_int32 endpage)
convertG4ToPSString()
char * generateUncompressedPS(char *hexdata, l_int32 w, l_int32 h, l_int32 d, l_int32 psbpl, l_int32 bps, l_float32 xpt, l_float32 ypt, l_float32 wpt, l_float32 hpt, l_int32 boxflag)
generateUncompressedPS()
l_ok convertFlateToPS(const char *filein, const char *fileout, const char *operation, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 endpage)
convertFlateToPS()
static void getScaledParametersPS(BOX *box, l_int32 wpix, l_int32 hpix, l_int32 res, l_float32 scale, l_float32 *pxpt, l_float32 *pypt, l_float32 *pwpt, l_float32 *phpt)
getScaledParametersPS()
static l_ok convertFlateToPSString(const char *filein, char **poutstr, l_int32 *pnbytes, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 endpage)
convertFlateToPSString()
l_ok pixWriteStreamPS(FILE *fp, PIX *pix, BOX *box, l_int32 res, l_float32 scale)
pixWriteStreamPS()
l_ok convertJpegToPS(const char *filein, const char *fileout, const char *operation, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 endpage)
convertJpegToPS()
l_int32 getResA4Page(l_int32 w, l_int32 h, l_float32 fillfract)
getResA4Page()
l_ok pixWritePSEmbed(const char *filein, const char *fileout)
pixWritePSEmbed()
static l_ok convertJpegToPSString(const char *filein, char **poutstr, l_int32 *pnbytes, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 endpage)
convertJpegToPSString()
l_ok convertTiffMultipageToPS(const char *filein, const char *fileout, l_float32 fillfract)
convertTiffMultipageToPS()
static void convertByteToHexAscii(l_uint8 byteval, char *pnib1, char *pnib2)
convertByteToHexAscii()
l_ok convertFlateToPSEmbed(const char *filein, const char *fileout)
convertFlateToPSEmbed()
l_ok convertG4ToPSEmbed(const char *filein, const char *fileout)
convertG4ToPSEmbed()
l_ok pixWriteMemPS(l_uint8 **pdata, size_t *psize, PIX *pix, BOX *box, l_int32 res, l_float32 scale)
pixWriteMemPS()
l_ok convertJpegToPSEmbed(const char *filein, const char *fileout)
convertJpegToPSEmbed()
l_ok convertG4ToPS(const char *filein, const char *fileout, const char *operation, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 maskflag, l_int32 endpage)
convertG4ToPS()
static char * generateJpegPS(const char *filein, L_COMP_DATA *cid, l_float32 xpt, l_float32 ypt, l_float32 wpt, l_float32 hpt, l_int32 pageno, l_int32 endpage)
generateJpegPS()
l_int32 getResLetterPage(l_int32 w, l_int32 h, l_float32 fillfract)
getResLetterPage()
static char * generateG4PS(const char *filein, L_COMP_DATA *cid, l_float32 xpt, l_float32 ypt, l_float32 wpt, l_float32 hpt, l_int32 maskflag, l_int32 pageno, l_int32 endpage)
generateG4PS()
PIX * pixRead(const char *filename)
pixRead()
l_int32 fileFormatIsTiff(FILE *fp)
fileFormatIsTiff()
SARRAY * sarrayCreate(l_int32 n)
sarrayCreate()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()
l_ok sarrayAddString(SARRAY *sa, const char *string, l_int32 copyflag)
sarrayAddString()
char * sarrayToString(SARRAY *sa, l_int32 addnlflag)
sarrayToString()
PIX * pixScale(PIX *pixs, l_float32 scalex, l_float32 scaley)
pixScale()
PIX * pixReadTiff(const char *filename, l_int32 n)
pixReadTiff()
l_ok tiffGetCount(FILE *fp, l_int32 *pn)
tiffGetCount()
void lept_stderr(const char *fmt,...)
lept_stderr()
l_int32 lept_rmfile(const char *filepath)
lept_rmfile()
char * l_makeTempFilename(void)
l_makeTempFilename()
FILE * fopenWriteStream(const char *filename, const char *modestring)
fopenWriteStream()
l_ok l_binaryWrite(const char *filename, const char *operation, const void *data, size_t nbytes)
l_binaryWrite()
FILE * fopenReadStream(const char *filename)
fopenReadStream()