346
350
* Procs for TIFFClientOpen
350
t2pReadFile(TIFF *tif, tdata_t data, tsize_t size)
352
thandle_t client = TIFFClientdata(tif);
353
TIFFReadWriteProc proc = TIFFGetReadProc(tif);
355
return proc(client, data, size);
360
t2pWriteFile(TIFF *tif, tdata_t data, tsize_t size)
362
thandle_t client = TIFFClientdata(tif);
363
TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
365
return proc(client, data, size);
354
t2pReadFile(TIFF *tif, tdata_t data, tmsize_t size)
356
thandle_t client = TIFFClientdata(tif);
357
TIFFReadWriteProc proc = TIFFGetReadProc(tif);
359
return proc(client, data, size);
364
t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
366
thandle_t client = TIFFClientdata(tif);
367
TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
369
return proc(client, data, size);
370
374
t2pSeekFile(TIFF *tif, toff_t offset, int whence)
372
376
thandle_t client = TIFFClientdata(tif);
373
TIFFSeekProc proc = TIFFGetSeekProc(tif);
377
TIFFSeekProc proc = TIFFGetSeekProc(tif);
375
379
return proc(client, offset, whence);
380
t2p_readproc(thandle_t handle, tdata_t data, tsize_t size)
384
t2p_readproc(thandle_t handle, tdata_t data, tmsize_t size)
382
386
(void) handle, (void) data, (void) size;
387
t2p_writeproc(thandle_t handle, tdata_t data, tsize_t size)
391
t2p_writeproc(thandle_t handle, tdata_t data, tmsize_t size)
389
393
T2P *t2p = (T2P*) handle;
390
394
if (t2p->outputdisable <= 0 && t2p->outputfile) {
399
t2p_seekproc(thandle_t handle, toff_t offset, int whence)
403
t2p_seekproc(thandle_t handle, uint64 offset, int whence)
401
405
T2P *t2p = (T2P*) handle;
402
406
if (t2p->outputdisable <= 0 && t2p->outputfile)
403
return fseek(t2p->outputfile, offset, whence);
407
return fseek(t2p->outputfile, (long) offset, whence);
422
t2p_mapproc(thandle_t handle, tdata_t *data, toff_t *offset)
426
t2p_mapproc(thandle_t handle, void **data, toff_t *offset)
424
428
(void) handle, (void) data, (void) offset;
429
t2p_unmapproc(thandle_t handle, tdata_t data, toff_t offset)
433
t2p_unmapproc(thandle_t handle, void *data, toff_t offset)
431
435
(void) handle, (void) data, (void) offset;
565
569
tiff2pdf input.tiff
567
The above example would generate PDF output from input.tiff and write it
571
The above example would generate PDF output from input.tiff and write it
568
572
to standard output.
570
574
tiff2pdf -j -p letter -o output.pdf input.tiff
572
The above example would generate the file output.pdf from input.tiff,
573
putting the image pages on a letter sized page, compressing the output
576
The above example would generate the file output.pdf from input.tiff,
577
putting the image pages on a letter sized page, compressing the output
576
580
Please report bugs through:
578
582
http://bugzilla.remotesensing.org/buglist.cgi?product=libtiff
580
584
See also libtiff.3t, tiffcp.
772
775
output = TIFFClientOpen(outfilename, "w", (thandle_t) t2p,
773
776
t2p_readproc, t2p_writeproc, t2p_seekproc,
774
777
t2p_closeproc, t2p_sizeproc,
775
t2p_mapproc, t2p_unmapproc );
778
t2p_mapproc, t2p_unmapproc);
776
779
if (output == NULL) {
777
780
TIFFError(TIFF2PDF_MODULE,
778
781
"Can't initialize output descriptor");
791
written = t2p_write_pdf(t2p, input, output);
794
t2p_write_pdf(t2p, input, output);
792
795
if (t2p->t2p_error != 0) {
793
796
TIFFError(TIFF2PDF_MODULE,
794
797
"An error occurred creating output PDF file");
926
"Can't allocate %u bytes of memory for t2p_init",
929
"Can't allocate %lu bytes of memory for t2p_init",
930
(unsigned long) sizeof(T2P));
928
931
return( (T2P*) NULL );
930
933
_TIFFmemset(t2p, 0x00, sizeof(T2P));
1036
1039
if(t2p->tiff_pages==NULL){
1038
1041
TIFF2PDF_MODULE,
1039
"Can't allocate %u bytes of memory for tiff_pages array, %s",
1040
directorycount * sizeof(T2P_PAGE),
1042
"Can't allocate %lu bytes of memory for tiff_pages array, %s",
1043
(unsigned long) directorycount * sizeof(T2P_PAGE),
1041
1044
TIFFFileName(input));
1042
1045
t2p->t2p_error = T2P_ERR_ERROR;
1047
1050
if(t2p->tiff_tiles==NULL){
1049
1052
TIFF2PDF_MODULE,
1050
"Can't allocate %u bytes of memory for tiff_tiles array, %s",
1051
directorycount * sizeof(T2P_TILES),
1053
"Can't allocate %lu bytes of memory for tiff_tiles array, %s",
1054
(unsigned long) directorycount * sizeof(T2P_TILES),
1052
1055
TIFFFileName(input));
1053
1056
t2p->t2p_error = T2P_ERR_ERROR;
1179
1182
if( t2p->tiff_tiles[i].tiles_tiles == NULL){
1181
1184
TIFF2PDF_MODULE,
1182
"Can't allocate %u bytes of memory for t2p_read_tiff_init, %s",
1183
t2p->tiff_tiles[i].tiles_tilecount * sizeof(T2P_TILE),
1185
"Can't allocate %lu bytes of memory for t2p_read_tiff_init, %s",
1186
(unsigned long) t2p->tiff_tiles[i].tiles_tilecount * sizeof(T2P_TILE),
1184
1187
TIFFFileName(input));
1185
1188
t2p->t2p_error = T2P_ERR_ERROR;
1807
1810
#ifdef CCITT_SUPPORT
1808
1811
if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
1809
1812
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1810
t2p->tiff_datasize=sbc[0];
1813
t2p->tiff_datasize=(tmsize_t)sbc[0];
1814
1817
#ifdef ZIP_SUPPORT
1815
1818
if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
1816
1819
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1817
t2p->tiff_datasize=sbc[0];
1820
t2p->tiff_datasize=(tmsize_t)sbc[0];
1834
1837
if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
1835
1838
if(t2p->tiff_dataoffset != 0){
1836
1839
if(TIFFGetField(input, TIFFTAG_JPEGIFBYTECOUNT, &(t2p->tiff_datasize))!=0){
1837
if(t2p->tiff_datasize < k) {
1840
if((uint64)t2p->tiff_datasize < k) {
1838
1841
TIFFWarning(TIFF2PDF_MODULE,
1839
1842
"Input file %s has short JPEG interchange file byte count",
1840
1843
TIFFFileName(input));
2096
2098
_TIFFmalloc(t2p->tiff_datasize);
2097
2099
if (buffer == NULL) {
2098
2100
TIFFError(TIFF2PDF_MODULE,
2099
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2101
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2102
(unsigned long) t2p->tiff_datasize,
2101
2103
TIFFFileName(input));
2102
2104
t2p->t2p_error = T2P_ERR_ERROR;
2124
2126
_TIFFmalloc(t2p->tiff_datasize);
2125
2127
if(buffer == NULL){
2126
2128
TIFFError(TIFF2PDF_MODULE,
2127
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2129
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2130
(unsigned long) t2p->tiff_datasize,
2129
2131
TIFFFileName(input));
2130
2132
t2p->t2p_error = T2P_ERR_ERROR;
2151
2153
_TIFFmalloc(t2p->tiff_datasize);
2152
2154
if(buffer == NULL) {
2153
2155
TIFFError(TIFF2PDF_MODULE,
2154
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2156
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2157
(unsigned long) t2p->tiff_datasize,
2156
2158
TIFFFileName(input));
2157
2159
t2p->t2p_error = T2P_ERR_ERROR;
2227
2229
_TIFFmalloc(t2p->tiff_datasize);
2228
2230
if(buffer==NULL){
2229
2231
TIFFError(TIFF2PDF_MODULE,
2230
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2232
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2233
(unsigned long) t2p->tiff_datasize,
2232
2234
TIFFFileName(input));
2233
2235
t2p->t2p_error = T2P_ERR_ERROR;
2270
2272
_TIFFmalloc(t2p->tiff_datasize);
2271
2273
if(buffer==NULL){
2272
2274
TIFFError(TIFF2PDF_MODULE,
2273
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2275
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2276
(unsigned long) t2p->tiff_datasize,
2275
2277
TIFFFileName(input));
2276
2278
t2p->t2p_error = T2P_ERR_ERROR;
2332
2334
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2333
2335
if(buffer==NULL){
2334
2336
TIFFError(TIFF2PDF_MODULE,
2335
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2337
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2338
(unsigned long) t2p->tiff_datasize,
2337
2339
TIFFFileName(input));
2338
2340
t2p->t2p_error = T2P_ERR_ERROR;
2370
2372
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2371
2373
if(buffer==NULL){
2372
2374
TIFFError(TIFF2PDF_MODULE,
2373
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2375
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2376
(unsigned long) t2p->tiff_datasize,
2375
2377
TIFFFileName(input));
2376
2378
t2p->t2p_error = T2P_ERR_ERROR;
2380
2382
samplebuffer = (unsigned char*) _TIFFmalloc(stripsize);
2381
2383
if(samplebuffer==NULL){
2382
2384
TIFFError(TIFF2PDF_MODULE,
2383
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2385
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2386
(unsigned long) t2p->tiff_datasize,
2385
2387
TIFFFileName(input));
2386
2388
t2p->t2p_error = T2P_ERR_ERROR;
2419
2421
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2420
2422
if(buffer==NULL){
2421
2423
TIFFError(TIFF2PDF_MODULE,
2422
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2424
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2425
(unsigned long) t2p->tiff_datasize,
2424
2426
TIFFFileName(input));
2425
2427
t2p->t2p_error = T2P_ERR_ERROR;
2450
2452
if(t2p->pdf_sample & T2P_SAMPLE_REALIZE_PALETTE){
2451
2454
samplebuffer=(unsigned char*)_TIFFrealloc(
2452
2455
(tdata_t) buffer,
2453
2456
t2p->tiff_datasize * t2p->tiff_samplesperpixel);
2454
2457
if(samplebuffer==NULL){
2455
2458
TIFFError(TIFF2PDF_MODULE,
2456
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2459
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2460
(unsigned long) t2p->tiff_datasize,
2458
2461
TIFFFileName(input));
2459
2462
t2p->t2p_error = T2P_ERR_ERROR;
2460
2463
_TIFFfree(buffer);
2483
2486
t2p->tiff_width*t2p->tiff_length*4);
2484
2487
if(samplebuffer==NULL){
2485
2488
TIFFError(TIFF2PDF_MODULE,
2486
"Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
2489
"Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
2490
(unsigned long) t2p->tiff_datasize,
2488
2491
TIFFFileName(input));
2489
2492
t2p->t2p_error = T2P_ERR_ERROR;
2490
2493
_TIFFfree(buffer);
2680
2683
buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2681
2684
if(buffer==NULL){
2682
2685
TIFFError(TIFF2PDF_MODULE,
2683
"Can't allocate %u bytes of memory "
2686
"Can't allocate %lu bytes of memory "
2684
2687
"for t2p_readwrite_pdf_image_tile, %s",
2688
(unsigned long) t2p->tiff_datasize,
2686
2689
TIFFFileName(input));
2687
2690
t2p->t2p_error = T2P_ERR_ERROR;
2701
2704
buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2702
2705
if(buffer==NULL){
2703
2706
TIFFError(TIFF2PDF_MODULE,
2704
"Can't allocate %u bytes of memory "
2707
"Can't allocate %lu bytes of memory "
2705
2708
"for t2p_readwrite_pdf_image_tile, %s",
2709
(unsigned long) t2p->tiff_datasize,
2707
2710
TIFFFileName(input));
2708
2711
t2p->t2p_error = T2P_ERR_ERROR;
2730
2733
buffer=(unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2731
2734
if(buffer==NULL){
2732
2735
TIFFError(TIFF2PDF_MODULE,
2733
"Can't allocate %u bytes of memory "
2736
"Can't allocate %lu bytes of memory "
2734
2737
"for t2p_readwrite_pdf_image, %s",
2738
(unsigned long) t2p->tiff_datasize,
2736
2739
TIFFFileName(input));
2737
2740
t2p->t2p_error = T2P_ERR_ERROR;
2771
2774
buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2772
2775
if(buffer==NULL){
2773
2776
TIFFError(TIFF2PDF_MODULE,
2774
"Can't allocate %u bytes of memory "
2777
"Can't allocate %lu bytes of memory "
2775
2778
"for t2p_readwrite_pdf_image_tile, %s",
2776
2779
t2p->tiff_datasize,
2777
2780
TIFFFileName(input));
2814
2817
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2815
2818
if(buffer==NULL){
2816
2819
TIFFError(TIFF2PDF_MODULE,
2817
"Can't allocate %u bytes of memory for "
2820
"Can't allocate %lu bytes of memory for "
2818
2821
"t2p_readwrite_pdf_image_tile, %s",
2822
(unsigned long) t2p->tiff_datasize,
2820
2823
TIFFFileName(input));
2821
2824
t2p->t2p_error = T2P_ERR_ERROR;
2847
2850
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2848
2851
if(buffer==NULL){
2849
2852
TIFFError(TIFF2PDF_MODULE,
2850
"Can't allocate %u bytes of memory "
2853
"Can't allocate %lu bytes of memory "
2851
2854
"for t2p_readwrite_pdf_image_tile, %s",
2855
(unsigned long) t2p->tiff_datasize,
2853
2856
TIFFFileName(input));
2854
2857
t2p->t2p_error = T2P_ERR_ERROR;
2857
2860
samplebuffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2858
2861
if(samplebuffer==NULL){
2859
2862
TIFFError(TIFF2PDF_MODULE,
2860
"Can't allocate %u bytes of memory "
2863
"Can't allocate %lu bytes of memory "
2861
2864
"for t2p_readwrite_pdf_image_tile, %s",
2865
(unsigned long) t2p->tiff_datasize,
2863
2866
TIFFFileName(input));
2864
2867
t2p->t2p_error = T2P_ERR_ERROR;
2896
2899
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
2897
2900
if(buffer==NULL){
2898
2901
TIFFError(TIFF2PDF_MODULE,
2899
"Can't allocate %u bytes of memory "
2902
"Can't allocate %lu bytes of memory "
2900
2903
"for t2p_readwrite_pdf_image_tile, %s",
2904
(unsigned long) t2p->tiff_datasize,
2902
2905
TIFFFileName(input));
2903
2906
t2p->t2p_error = T2P_ERR_ERROR;
3430
3433
uint32 edgetilewidth,
3431
3434
uint32 tilelength){
3434
3437
tsize_t edgescanwidth=0;
3436
3439
edgescanwidth = (scanwidth * edgetilewidth + (tilewidth - 1))/ tilewidth;
3437
for(i=i;i<tilelength;i++){
3440
for(i=0;i<tilelength;i++){
3439
3442
&(((char*)buffer)[edgescanwidth*i]),
3440
3443
&(((char*)buffer)[scanwidth*i]),
3743
3746
* This function writes a PDF string object to output.
3746
3749
tsize_t t2p_write_pdf_string(char* pdfstr, TIFF* output)
3748
3751
tsize_t written = 0;
3750
3753
char buffer[64];
3753
3756
len = strlen(pdfstr);
3754
3757
written += t2pWriteFile(output, (tdata_t) "(", 1);
3755
3758
for (i=0; i<len; i++) {
3756
3759
if((pdfstr[i]&0x80) || (pdfstr[i]==127) || (pdfstr[i]<32)){
3757
snprintf(buffer, sizeof(buffer), "\\%.3hho", pdfstr[i]);
3760
snprintf(buffer, sizeof(buffer), "\\%.3o", ((unsigned char)pdfstr[i]));
3758
3761
written += t2pWriteFile(output, (tdata_t)buffer, 4);
3760
3763
switch (pdfstr[i]){
3948
3951
written += t2p_write_pdf_string(buffer, output);
3949
3952
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3950
3953
if (t2p->pdf_creator[0] != '\0') {
3951
written += t2pWriteFile(output, (tdata_t) "/Creator ", 9);
3952
written += t2p_write_pdf_string(t2p->pdf_creator, output);
3953
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3954
written += t2pWriteFile(output, (tdata_t) "/Creator ", 9);
3955
written += t2p_write_pdf_string(t2p->pdf_creator, output);
3956
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3955
3958
if (TIFFGetField(input, TIFFTAG_SOFTWARE, &info) != 0 && info) {
3956
3959
if(strlen(info) >= sizeof(t2p->pdf_creator))
3963
3966
if (t2p->pdf_author[0] != '\0') {
3964
written += t2pWriteFile(output, (tdata_t) "/Author ", 8);
3965
written += t2p_write_pdf_string(t2p->pdf_author, output);
3966
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3967
written += t2pWriteFile(output, (tdata_t) "/Author ", 8);
3968
written += t2p_write_pdf_string(t2p->pdf_author, output);
3969
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3968
3971
if ((TIFFGetField(input, TIFFTAG_ARTIST, &info) != 0
3969
3972
|| TIFFGetField(input, TIFFTAG_COPYRIGHT, &info) != 0)
3973
3976
written += t2pWriteFile(output, (tdata_t) "/Author ", 8);
3974
3977
written += t2p_write_pdf_string(info, output);
3975
3978
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3978
3981
if (t2p->pdf_title[0] != '\0') {
3979
written += t2pWriteFile(output, (tdata_t) "/Title ", 7);
3980
written += t2p_write_pdf_string(t2p->pdf_title, output);
3981
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3982
written += t2pWriteFile(output, (tdata_t) "/Title ", 7);
3983
written += t2p_write_pdf_string(t2p->pdf_title, output);
3984
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3983
3986
if (TIFFGetField(input, TIFFTAG_DOCUMENTNAME, &info) != 0){
3984
3987
if(strlen(info) > 511) {
3992
3995
if (t2p->pdf_subject[0] != '\0') {
3993
written += t2pWriteFile(output, (tdata_t) "/Subject ", 9);
3994
written += t2p_write_pdf_string(t2p->pdf_subject, output);
3995
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3996
written += t2pWriteFile(output, (tdata_t) "/Subject ", 9);
3997
written += t2p_write_pdf_string(t2p->pdf_subject, output);
3998
written += t2pWriteFile(output, (tdata_t) "\n", 1);
3997
4000
if (TIFFGetField(input, TIFFTAG_IMAGEDESCRIPTION, &info) != 0 && info) {
3998
4001
if (strlen(info) >= sizeof(t2p->pdf_subject))
4005
4008
if (t2p->pdf_keywords[0] != '\0') {
4006
written += t2pWriteFile(output, (tdata_t) "/Keywords ", 10);
4007
written += t2p_write_pdf_string(t2p->pdf_keywords, output);
4008
written += t2pWriteFile(output, (tdata_t) "\n", 1);
4010
written += t2pWriteFile(output, (tdata_t) ">> \n", 4);
4009
written += t2pWriteFile(output, (tdata_t) "/Keywords ", 10);
4010
written += t2p_write_pdf_string(t2p->pdf_keywords, output);
4011
written += t2pWriteFile(output, (tdata_t) "\n", 1);
4013
written += t2pWriteFile(output, (tdata_t) ">> \n", 4);
4012
4015
return(written);
4033
4036
"D:%.4d%.2d%.2d%.2d%.2d%.2d",
4034
4037
(currenttime->tm_year + 1900) % 65536,
4035
4038
(currenttime->tm_mon + 1) % 256,
4036
(currenttime->tm_mday) % 256,
4037
(currenttime->tm_hour) % 256,
4038
(currenttime->tm_min) % 256,
4039
(currenttime->tm_sec) % 256);
4039
(currenttime->tm_mday) % 256,
4040
(currenttime->tm_hour) % 256,
4041
(currenttime->tm_min) % 256,
4042
(currenttime->tm_sec) % 256);
4091
written += t2pWriteFile(output,
4094
written += t2pWriteFile(output,
4092
4095
(tdata_t) "<< \n/Type /Pages \n/Kids [ ", 26);
4093
4096
page = t2p->pdf_pages+1;
4094
4097
for (i=0;i<t2p->tiff_pagecount;i++){
4125
4128
tsize_t written=0;
4126
4129
char buffer[16];
4129
4132
written += t2pWriteFile(output, (tdata_t) "<<\n/Type /Page \n/Parent ", 24);
4130
4133
buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_pages);
4131
4134
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
4798
4801
buflen=sprintf(buffer, "/Size [%u] \n", (1<<t2p->tiff_bitspersample));
4799
4802
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
4800
4803
written += t2pWriteFile(output, (tdata_t) "/BitsPerSample 16 \n", 19);
4801
written += t2p_write_pdf_stream_dict(1<<(t2p->tiff_bitspersample+1), 0, output);
4804
written += t2p_write_pdf_stream_dict(((tsize_t)1)<<(t2p->tiff_bitspersample+1), 0, output);
4803
4806
return(written);
4810
4813
written += t2p_write_pdf_stream(
4811
4814
t2p->tiff_transferfunction[i],
4812
(1<<(t2p->tiff_bitspersample+1)),
4815
(((tsize_t)1)<<(t2p->tiff_bitspersample+1)),
4815
4818
return(written);