changed program name from t2p to tumble.
This commit is contained in:
parent
5b99cc508d
commit
22dcb1616b
16
Makefile
16
Makefile
@ -1,6 +1,6 @@
|
||||
# t2p: build a PDF file out of one or more TIFF Class F Group 4 files
|
||||
# tumble: build a PDF file from image files
|
||||
# Makefile
|
||||
# $Id: Makefile,v 1.28 2003/03/12 23:57:21 eric Exp $
|
||||
# $Id: Makefile,v 1.29 2003/03/13 00:57:05 eric Exp $
|
||||
# Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -55,18 +55,18 @@ YFLAGS = -d -v
|
||||
# let me know why so I can improve this Makefile.
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
VERSION = 0.23
|
||||
VERSION = 0.24
|
||||
|
||||
PACKAGE = t2p
|
||||
PACKAGE = tumble
|
||||
|
||||
TARGETS = t2p
|
||||
TARGETS = tumble
|
||||
|
||||
CSRCS = t2p.c semantics.c \
|
||||
CSRCS = tumble.c semantics.c \
|
||||
bitblt.c bitblt_table_gen.c bitblt_g4.c g4_table_gen.c \
|
||||
pdf.c pdf_util.c pdf_prim.c pdf_bookmark.c pdf_name_tree.c \
|
||||
pdf_text.c pdf_g4.c pdf_jpeg.c
|
||||
OSRCS = scanner.l parser.y
|
||||
HDRS = t2p.h semantics.h bitblt.h bitblt_tables.h \
|
||||
HDRS = tumble.h semantics.h bitblt.h bitblt_tables.h \
|
||||
pdf.h pdf_private.h pdf_util.h pdf_prim.h pdf_name_tree.h
|
||||
MISC = COPYING Makefile
|
||||
|
||||
@ -85,7 +85,7 @@ AUTO_MISC = parser.output
|
||||
all: $(TARGETS) $(TEST_TARGETS)
|
||||
|
||||
|
||||
t2p: t2p.o scanner.o semantics.o parser.tab.o \
|
||||
tumble: tumble.o scanner.o semantics.o parser.tab.o \
|
||||
bitblt.o bitblt_g4.o bitblt_tables.o g4_tables.o \
|
||||
pdf.o pdf_util.o pdf_prim.o pdf_bookmark.o pdf_name_tree.o \
|
||||
pdf_text.o pdf_g4.o pdf_jpeg.o
|
||||
|
||||
6
bitblt.c
6
bitblt.c
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* bitblt routines
|
||||
* $Id: bitblt.c,v 1.15 2003/03/12 02:59:09 eric Exp $
|
||||
* $Id: bitblt.c,v 1.16 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
6
bitblt.h
6
bitblt.h
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* bitblt routines
|
||||
* $Id: bitblt.h,v 1.16 2003/03/12 02:59:09 eric Exp $
|
||||
* $Id: bitblt.h,v 1.17 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* G4 compression
|
||||
* $Id: bitblt_g4.c,v 1.13 2003/03/12 19:30:44 eric Exp $
|
||||
* $Id: bitblt_g4.c,v 1.14 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* bitblt table generator
|
||||
* $Id: bitblt_table_gen.c,v 1.6 2003/03/11 22:40:34 eric Exp $
|
||||
* $Id: bitblt_table_gen.c,v 1.7 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* G4 table generator
|
||||
* $Id: g4_table_gen.c,v 1.3 2003/03/11 22:57:46 eric Exp $
|
||||
* $Id: g4_table_gen.c,v 1.4 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
6
parser.y
6
parser.y
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* Parser
|
||||
* $Id: parser.y,v 1.17 2003/02/21 00:49:11 eric Exp $
|
||||
* $Id: parser.y,v 1.18 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
6
pdf.c
6
pdf.c
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf.c,v 1.9 2003/03/13 00:03:11 eric Exp $
|
||||
* $Id: pdf.c,v 1.10 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
6
pdf.h
6
pdf.h
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf.h,v 1.8 2003/03/12 23:57:21 eric Exp $
|
||||
* $Id: pdf.h,v 1.9 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_bookmark.c,v 1.5 2003/03/05 12:56:25 eric Exp $
|
||||
* $Id: pdf_bookmark.c,v 1.6 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
6
pdf_g4.c
6
pdf_g4.c
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_g4.c,v 1.14 2003/03/12 23:59:35 eric Exp $
|
||||
* $Id: pdf_g4.c,v 1.15 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_jpeg.c,v 1.1 2003/03/12 02:57:06 eric Exp $
|
||||
* $Id: pdf_jpeg.c,v 1.2 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_name_tree.c,v 1.8 2003/03/12 03:13:28 eric Exp $
|
||||
* $Id: pdf_name_tree.c,v 1.9 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_name_tree.h,v 1.2 2003/03/07 22:52:09 eric Exp $
|
||||
* $Id: pdf_name_tree.h,v 1.3 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_prim.c,v 1.11 2003/03/13 00:00:21 eric Exp $
|
||||
* $Id: pdf_prim.c,v 1.12 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_prim.h,v 1.9 2003/03/12 22:56:57 eric Exp $
|
||||
* $Id: pdf_prim.h,v 1.10 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_private.h,v 1.6 2003/03/07 22:52:09 eric Exp $
|
||||
* $Id: pdf_private.h,v 1.7 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_text.c,v 1.1 2003/03/12 23:57:21 eric Exp $
|
||||
* $Id: pdf_text.c,v 1.2 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_util.c,v 1.5 2003/03/10 05:08:25 eric Exp $
|
||||
* $Id: pdf_util.c,v 1.6 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* PDF routines
|
||||
* $Id: pdf_util.h,v 1.5 2003/03/07 03:02:12 eric Exp $
|
||||
* $Id: pdf_util.h,v 1.6 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* Lexical analyzer
|
||||
* $Id: scanner.l,v 1.17 2003/02/21 00:49:11 eric Exp $
|
||||
* $Id: scanner.l,v 1.18 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* Semantic routines for spec file parser
|
||||
* $Id: semantics.c,v 1.18 2003/03/12 00:38:04 eric Exp $
|
||||
* $Id: semantics.c,v 1.19 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -32,7 +30,7 @@
|
||||
|
||||
#include "semantics.h"
|
||||
#include "parser.tab.h"
|
||||
#include "t2p.h"
|
||||
#include "tumble.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* Semantic routines for spec file parser
|
||||
* $Id: semantics.h,v 1.12 2003/03/12 00:38:04 eric Exp $
|
||||
* $Id: semantics.h,v 1.13 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
732
t2p.c
732
t2p.c
@ -1,732 +0,0 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
*
|
||||
* Main program
|
||||
* $Id: t2p.c,v 1.31 2003/03/12 23:59:10 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation. Note that permission is
|
||||
* not granted to redistribute this program under the terms of any
|
||||
* other version of the General Public License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
|
||||
*/
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <tiffio.h>
|
||||
#define TIFF_REVERSE_BITS
|
||||
|
||||
#include "bitblt.h"
|
||||
#include "semantics.h"
|
||||
#include "parser.tab.h"
|
||||
#include "t2p.h"
|
||||
#include "pdf.h"
|
||||
|
||||
|
||||
#define MAX_INPUT_FILES 5000
|
||||
|
||||
#define POINTS_PER_INCH 72
|
||||
|
||||
/* page size limited by Acrobat Reader to 45 inches on a side */
|
||||
#define PAGE_MAX_INCHES 45
|
||||
#define PAGE_MAX_POINTS (PAGE_MAX_INCHES * POINTS_PER_INCH)
|
||||
|
||||
|
||||
typedef struct output_file_t
|
||||
{
|
||||
struct output_file_t *next;
|
||||
char *name;
|
||||
pdf_file_handle pdf;
|
||||
} output_file_t;
|
||||
|
||||
|
||||
int verbose;
|
||||
|
||||
|
||||
char *in_filename;
|
||||
TIFF *in;
|
||||
output_file_t *output_files;
|
||||
output_file_t *out;
|
||||
|
||||
|
||||
char *progname;
|
||||
|
||||
|
||||
bool close_tiff_input_file (void);
|
||||
bool close_pdf_output_files (void);
|
||||
|
||||
|
||||
void usage (void)
|
||||
{
|
||||
fprintf (stderr, "\n");
|
||||
fprintf (stderr, "t2p - Copyright 2001-2003 Eric Smith <eric@brouhaha.com>\n");
|
||||
fprintf (stderr, "http://www.brouhaha.com/~eric/software/t2p/\n");
|
||||
fprintf (stderr, "\n");
|
||||
fprintf (stderr, "usage:\n");
|
||||
fprintf (stderr, " %s [options] -s spec\n", progname);
|
||||
fprintf (stderr, " %s [options] <input.tif>... -o <output.pdf>\n", progname);
|
||||
fprintf (stderr, "options:\n");
|
||||
fprintf (stderr, " -v verbose\n");
|
||||
fprintf (stderr, " -b fmt create bookmarks\n");
|
||||
fprintf (stderr, "bookmark format:\n");
|
||||
fprintf (stderr, " %%F file name (sans suffix)\n");
|
||||
fprintf (stderr, " %%p page number\n");
|
||||
}
|
||||
|
||||
|
||||
/* generate fatal error message to stderr, doesn't return */
|
||||
void fatal (int ret, char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
fprintf (stderr, "fatal error");
|
||||
if (format)
|
||||
{
|
||||
fprintf (stderr, ": ");
|
||||
va_start (ap, format);
|
||||
vfprintf (stderr, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
else
|
||||
fprintf (stderr, "\n");
|
||||
if (ret == 1)
|
||||
usage ();
|
||||
close_tiff_input_file ();
|
||||
close_pdf_output_files ();
|
||||
exit (ret);
|
||||
}
|
||||
|
||||
|
||||
bool close_tiff_input_file (void)
|
||||
{
|
||||
if (in)
|
||||
{
|
||||
free (in_filename);
|
||||
TIFFClose (in);
|
||||
}
|
||||
in = NULL;
|
||||
in_filename = NULL;
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
bool open_tiff_input_file (char *name)
|
||||
{
|
||||
if (in)
|
||||
{
|
||||
if (strcmp (name, in_filename) == 0)
|
||||
return (1);
|
||||
close_tiff_input_file ();
|
||||
}
|
||||
in_filename = strdup (name);
|
||||
if (! in_filename)
|
||||
{
|
||||
fprintf (stderr, "can't strdup input filename '%s'\n", name);
|
||||
return (0);
|
||||
}
|
||||
in = TIFFOpen (name, "r");
|
||||
if (! in)
|
||||
{
|
||||
fprintf (stderr, "can't open input file '%s'\n", name);
|
||||
free (in_filename);
|
||||
return (0);
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
bool close_pdf_output_files (void)
|
||||
{
|
||||
output_file_t *o, *n;
|
||||
|
||||
for (o = output_files; o; o = n)
|
||||
{
|
||||
n = o->next;
|
||||
pdf_close (o->pdf);
|
||||
free (o->name);
|
||||
free (o);
|
||||
}
|
||||
out = NULL;
|
||||
output_files = NULL;
|
||||
return (1);
|
||||
}
|
||||
|
||||
bool open_pdf_output_file (char *name,
|
||||
pdf_file_attributes_t *attributes)
|
||||
{
|
||||
output_file_t *o;
|
||||
|
||||
if (out && (strcmp (name, out->name) == 0))
|
||||
return (1);
|
||||
for (o = output_files; o; o = o->next)
|
||||
if (strcmp (name, o->name) == 0)
|
||||
{
|
||||
out = o;
|
||||
return (1);
|
||||
}
|
||||
o = calloc (1, sizeof (output_file_t));
|
||||
if (! o)
|
||||
{
|
||||
fprintf (stderr, "can't calloc output file struct for '%s'\n", name);
|
||||
return (0);
|
||||
}
|
||||
|
||||
o->name = strdup (name);
|
||||
if (! o->name)
|
||||
{
|
||||
fprintf (stderr, "can't strdup output filename '%s'\n", name);
|
||||
free (o);
|
||||
return (0);
|
||||
}
|
||||
|
||||
o->pdf = pdf_create (name, (attributes->has_bookmarks ?
|
||||
PDF_PAGE_MODE_USE_OUTLINES :
|
||||
PDF_PAGE_MODE_USE_NONE));
|
||||
if (! o->pdf)
|
||||
{
|
||||
fprintf (stderr, "can't open output file '%s'\n", name);
|
||||
free (o->name);
|
||||
free (o);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (attributes->author)
|
||||
pdf_set_author (o->pdf, attributes->author);
|
||||
if (attributes->creator)
|
||||
pdf_set_creator (o->pdf, attributes->creator);
|
||||
if (attributes->title)
|
||||
pdf_set_title (o->pdf, attributes->title);
|
||||
if (attributes->subject)
|
||||
pdf_set_subject (o->pdf, attributes->subject);
|
||||
if (attributes->keywords)
|
||||
pdf_set_keywords (o->pdf, attributes->keywords);
|
||||
|
||||
/* prepend new output file onto list */
|
||||
o->next = output_files;
|
||||
output_files = o;
|
||||
|
||||
out = o;
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
void process_page_numbers (int page_index,
|
||||
int count,
|
||||
int base,
|
||||
page_label_t *page_label)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* frees original! */
|
||||
static Bitmap *resize_bitmap (Bitmap *src,
|
||||
double x_resolution,
|
||||
double y_resolution,
|
||||
input_attributes_t input_attributes)
|
||||
{
|
||||
Rect src_rect;
|
||||
Point dest_min;
|
||||
Bitmap *dest;
|
||||
|
||||
int width_pixels = input_attributes.page_size.width * x_resolution;
|
||||
int height_pixels = input_attributes.page_size.height * y_resolution;
|
||||
|
||||
src_rect.min.x = (rect_width (& src->rect) - width_pixels) / 2;
|
||||
src_rect.min.y = (rect_height (& src->rect) - height_pixels) / 2;
|
||||
src_rect.max.x = src_rect.min.x + width_pixels;
|
||||
src_rect.max.y = src_rect.min.y + height_pixels;
|
||||
|
||||
dest_min.x = 0;
|
||||
dest_min.y = 0;
|
||||
|
||||
dest = bitblt (src, & src_rect, NULL, & dest_min, TF_SRC, 0);
|
||||
free_bitmap (src);
|
||||
return (dest);
|
||||
}
|
||||
|
||||
|
||||
/* "in place" rotation */
|
||||
static void rotate_bitmap (Bitmap *src,
|
||||
input_attributes_t input_attributes)
|
||||
{
|
||||
switch (input_attributes.rotation)
|
||||
{
|
||||
case 0: break;
|
||||
case 90: rot_90 (src); break;
|
||||
case 180: rot_180 (src); break;
|
||||
case 270: rot_270 (src); break;
|
||||
default:
|
||||
fprintf (stderr, "rotation must be 0, 90, 180, or 270\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define SWAP(type,a,b) do { type temp; temp = a; a = b; b = temp; } while (0)
|
||||
|
||||
|
||||
bool last_tiff_page (void)
|
||||
{
|
||||
return (TIFFLastDirectory (in));
|
||||
}
|
||||
|
||||
|
||||
bool process_tiff_page (int image, /* range 1 .. n */
|
||||
input_attributes_t input_attributes,
|
||||
bookmark_t *bookmarks)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
uint32_t image_length, image_width;
|
||||
uint32_t dest_image_length, dest_image_width;
|
||||
#ifdef CHECK_DEPTH
|
||||
uint32_t image_depth;
|
||||
#endif
|
||||
|
||||
uint16_t samples_per_pixel;
|
||||
uint16_t bits_per_sample;
|
||||
uint16_t planar_config;
|
||||
|
||||
uint16_t resolution_unit;
|
||||
float x_resolution, y_resolution;
|
||||
double dest_x_resolution, dest_y_resolution;
|
||||
|
||||
double width_points, height_points; /* really 1/72 inch units rather than
|
||||
points */
|
||||
|
||||
Rect rect;
|
||||
Bitmap *bitmap = NULL;
|
||||
|
||||
int row;
|
||||
|
||||
pdf_page_handle page;
|
||||
|
||||
if (! TIFFSetDirectory (in, image - 1))
|
||||
{
|
||||
fprintf (stderr, "can't find page %d of input file\n", image);
|
||||
goto fail;
|
||||
}
|
||||
if (1 != TIFFGetField (in, TIFFTAG_IMAGELENGTH, & image_length))
|
||||
{
|
||||
fprintf (stderr, "can't get image length\n");
|
||||
goto fail;
|
||||
}
|
||||
if (1 != TIFFGetField (in, TIFFTAG_IMAGEWIDTH, & image_width))
|
||||
{
|
||||
fprintf (stderr, "can't get image width\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (1 != TIFFGetField (in, TIFFTAG_SAMPLESPERPIXEL, & samples_per_pixel))
|
||||
{
|
||||
fprintf (stderr, "can't get samples per pixel\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef CHECK_DEPTH
|
||||
if (1 != TIFFGetField (in, TIFFTAG_IMAGEDEPTH, & image_depth))
|
||||
{
|
||||
fprintf (stderr, "can't get image depth\n");
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (1 != TIFFGetField (in, TIFFTAG_BITSPERSAMPLE, & bits_per_sample))
|
||||
{
|
||||
fprintf (stderr, "can't get bits per sample\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (1 != TIFFGetField (in, TIFFTAG_PLANARCONFIG, & planar_config))
|
||||
planar_config = 1;
|
||||
|
||||
if (1 != TIFFGetField (in, TIFFTAG_RESOLUTIONUNIT, & resolution_unit))
|
||||
resolution_unit = 2;
|
||||
if (1 != TIFFGetField (in, TIFFTAG_XRESOLUTION, & x_resolution))
|
||||
x_resolution = 300;
|
||||
if (1 != TIFFGetField (in, TIFFTAG_YRESOLUTION, & y_resolution))
|
||||
y_resolution = 300;
|
||||
|
||||
if (samples_per_pixel != 1)
|
||||
{
|
||||
fprintf (stderr, "samples per pixel %u, must be 1\n", samples_per_pixel);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef CHECK_DEPTH
|
||||
if (image_depth != 1)
|
||||
{
|
||||
fprintf (stderr, "image depth %u, must be 1\n", image_depth);
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bits_per_sample != 1)
|
||||
{
|
||||
fprintf (stderr, "bits per sample %u, must be 1\n", bits_per_sample);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (planar_config != 1)
|
||||
{
|
||||
fprintf (stderr, "planar config %u, must be 1\n", planar_config);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (input_attributes.has_resolution)
|
||||
{
|
||||
x_resolution = input_attributes.x_resolution;
|
||||
y_resolution = input_attributes.y_resolution;
|
||||
}
|
||||
|
||||
if ((input_attributes.rotation == 90) || (input_attributes.rotation == 270))
|
||||
{
|
||||
dest_image_width = image_length;
|
||||
dest_image_length = image_width;
|
||||
dest_x_resolution = y_resolution;
|
||||
dest_y_resolution = x_resolution;
|
||||
SWAP (double, width_points, height_points); /* $$$ not yet set!!! */
|
||||
}
|
||||
else
|
||||
{
|
||||
dest_image_width = image_width;
|
||||
dest_image_length = image_length;
|
||||
dest_x_resolution = x_resolution;
|
||||
dest_y_resolution = y_resolution;
|
||||
}
|
||||
|
||||
rect.min.x = 0;
|
||||
rect.min.y = 0;
|
||||
rect.max.x = image_width;
|
||||
rect.max.y = image_length;
|
||||
|
||||
bitmap = create_bitmap (& rect);
|
||||
|
||||
if (! bitmap)
|
||||
{
|
||||
fprintf (stderr, "can't allocate bitmap\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (row = 0; row < image_length; row++)
|
||||
if (1 != TIFFReadScanline (in,
|
||||
bitmap->bits + row * bitmap->row_words,
|
||||
row,
|
||||
0))
|
||||
{
|
||||
fprintf (stderr, "can't read TIFF scanline\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef TIFF_REVERSE_BITS
|
||||
reverse_bits ((uint8_t *) bitmap->bits,
|
||||
image_length * bitmap->row_words * sizeof (word_t));
|
||||
#endif /* TIFF_REVERSE_BITS */
|
||||
|
||||
#if 0
|
||||
if (input_attributes.has_page_size)
|
||||
bitmap = resize_bitmap (bitmap,
|
||||
x_resolution,
|
||||
y_resolution,
|
||||
input_attributes);
|
||||
#endif
|
||||
|
||||
rotate_bitmap (bitmap,
|
||||
input_attributes);
|
||||
|
||||
width_points = (rect_width (& bitmap->rect) / dest_x_resolution) * POINTS_PER_INCH;
|
||||
height_points = (rect_height (& bitmap->rect) / dest_y_resolution) * POINTS_PER_INCH;
|
||||
|
||||
if ((height_points > PAGE_MAX_POINTS) || (width_points > PAGE_MAX_POINTS))
|
||||
{
|
||||
fprintf (stdout, "image too large (max %d inches on a side\n", PAGE_MAX_INCHES);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
page = pdf_new_page (out->pdf, width_points, height_points);
|
||||
|
||||
#if 0
|
||||
pdf_write_text (page);
|
||||
#else
|
||||
pdf_write_g4_fax_image (page,
|
||||
0, 0, /* x, y */
|
||||
width_points, height_points,
|
||||
bitmap,
|
||||
0, /* ImageMask */
|
||||
0, 0, 0, /* r, g, b */
|
||||
0); /* BlackIs1 */
|
||||
#endif
|
||||
|
||||
while (bookmarks)
|
||||
{
|
||||
/* $$$ need to handle level here */
|
||||
pdf_new_bookmark (NULL, bookmarks->name, 0, page);
|
||||
bookmarks = bookmarks->next;
|
||||
}
|
||||
|
||||
result = 1;
|
||||
|
||||
fail:
|
||||
if (bitmap)
|
||||
free_bitmap (bitmap);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
bool process_jpeg_page (int image, /* range 1 .. n */
|
||||
input_attributes_t input_attributes,
|
||||
bookmark_t *bookmarks)
|
||||
{
|
||||
int result = 0;
|
||||
FILE *f;
|
||||
pdf_page_handle page;
|
||||
|
||||
f = fopen (filename, "rb");
|
||||
if (! f)
|
||||
fatal ("error opening input file '%s'\n", filename);
|
||||
|
||||
page = pdf_new_page (out->pdf, width_points, height_points);
|
||||
|
||||
pdf_write_jpeg_image (page,
|
||||
0, 0, /* x, y */
|
||||
width_points, height_points,
|
||||
f);
|
||||
|
||||
return (result);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool process_page (int image, /* range 1 .. n */
|
||||
input_attributes_t input_attributes,
|
||||
bookmark_t *bookmarks)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
result = process_tiff_page (image, input_attributes, bookmarks);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
#define MAX_BOOKMARK_NAME_LEN 500
|
||||
|
||||
|
||||
static int filename_length_without_suffix (char *in_fn)
|
||||
{
|
||||
char *p;
|
||||
int len = strlen (in_fn);
|
||||
|
||||
p = strrchr (in_fn, '.');
|
||||
if (p && ((strcasecmp (p, ".tif") == 0) ||
|
||||
(strcasecmp (p, ".tiff") == 0)))
|
||||
return (p - in_fn);
|
||||
return (len);
|
||||
}
|
||||
|
||||
|
||||
/* $$$ this function should ensure that it doesn't overflow the name string! */
|
||||
static void generate_bookmark_name (char *name,
|
||||
char *bookmark_fmt,
|
||||
char *in_fn,
|
||||
int page)
|
||||
{
|
||||
bool meta = 0;
|
||||
int len;
|
||||
|
||||
while (*bookmark_fmt)
|
||||
{
|
||||
if (meta)
|
||||
{
|
||||
meta = 0;
|
||||
switch (*bookmark_fmt)
|
||||
{
|
||||
case '%':
|
||||
*(name++) = '%';
|
||||
break;
|
||||
case 'F':
|
||||
len = filename_length_without_suffix (in_fn);
|
||||
strncpy (name, in_fn, len);
|
||||
name += len;
|
||||
break;
|
||||
case 'p':
|
||||
sprintf (name, "%d", page);
|
||||
name += strlen (name);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
switch (*bookmark_fmt)
|
||||
{
|
||||
case '%':
|
||||
meta = 1;
|
||||
break;
|
||||
default:
|
||||
*(name++) = *bookmark_fmt;
|
||||
}
|
||||
bookmark_fmt++;
|
||||
}
|
||||
*name = '\0';
|
||||
}
|
||||
|
||||
|
||||
void main_args (char *out_fn,
|
||||
int inf_count,
|
||||
char **in_fn,
|
||||
char *bookmark_fmt)
|
||||
{
|
||||
int i, ip;
|
||||
input_attributes_t input_attributes;
|
||||
pdf_file_attributes_t output_attributes;
|
||||
bookmark_t bookmark;
|
||||
char bookmark_name [MAX_BOOKMARK_NAME_LEN];
|
||||
|
||||
bookmark.next = NULL;
|
||||
bookmark.level = 1;
|
||||
bookmark.name = & bookmark_name [0];
|
||||
|
||||
memset (& input_attributes, 0, sizeof (input_attributes));
|
||||
memset (& output_attributes, 0, sizeof (output_attributes));
|
||||
|
||||
output_attributes.has_bookmarks = (bookmark_fmt != NULL);
|
||||
|
||||
if (! open_pdf_output_file (out_fn, & output_attributes))
|
||||
fatal (3, "error opening output file \"%s\"\n", out_fn);
|
||||
for (i = 0; i < inf_count; i++)
|
||||
{
|
||||
if (! open_tiff_input_file (in_fn [i]))
|
||||
fatal (3, "error opening input file \"%s\"\n", in_fn [i]);
|
||||
for (ip = 1;; ip++)
|
||||
{
|
||||
fprintf (stderr, "processing page %d of file \"%s\"\r", ip, in_fn [i]);
|
||||
if (bookmark_fmt)
|
||||
generate_bookmark_name (& bookmark_name [0],
|
||||
bookmark_fmt,
|
||||
in_fn [i],
|
||||
ip);
|
||||
if (! process_page (ip, input_attributes,
|
||||
bookmark_fmt ? & bookmark : NULL))
|
||||
fatal (3, "error processing page %d of input file \"%s\"\n", ip, in_fn [i]);
|
||||
if (last_tiff_page ())
|
||||
break;
|
||||
}
|
||||
if (verbose)
|
||||
fprintf (stderr, "processed %d pages of input file \"%s\"\n", ip, in_fn [i]);
|
||||
if (! close_tiff_input_file ())
|
||||
fatal (3, "error closing input file \"%s\"\n", in_fn [i]);
|
||||
}
|
||||
if (! close_pdf_output_files ())
|
||||
fatal (3, "error closing output file \"%s\"\n", out_fn);
|
||||
}
|
||||
|
||||
|
||||
void main_spec (char *spec_fn)
|
||||
{
|
||||
if (! parse_spec_file (spec_fn))
|
||||
fatal (2, "error parsing spec file\n");
|
||||
if (! process_specs ())
|
||||
fatal (3, "error processing spec file\n");
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
char *spec_fn = NULL;
|
||||
char *out_fn = NULL;
|
||||
char *bookmark_fmt = NULL;
|
||||
int inf_count = 0;
|
||||
char *in_fn [MAX_INPUT_FILES];
|
||||
|
||||
progname = argv [0];
|
||||
|
||||
pdf_init ();
|
||||
|
||||
while (--argc)
|
||||
{
|
||||
if (argv [1][0] == '-')
|
||||
{
|
||||
if (strcmp (argv [1], "-v") == 0)
|
||||
verbose++;
|
||||
else if (strcmp (argv [1], "-o") == 0)
|
||||
{
|
||||
if (argc)
|
||||
{
|
||||
argc--;
|
||||
argv++;
|
||||
out_fn = argv [1];
|
||||
}
|
||||
else
|
||||
fatal (1, "missing filename after \"-o\" option\n");
|
||||
}
|
||||
else if (strcmp (argv [1], "-s") == 0)
|
||||
{
|
||||
if (argc)
|
||||
{
|
||||
argc--;
|
||||
argv++;
|
||||
spec_fn = argv [1];
|
||||
}
|
||||
else
|
||||
fatal (1, "missing filename after \"-s\" option\n");
|
||||
}
|
||||
else if (strcmp (argv [1], "-b") == 0)
|
||||
{
|
||||
if (argc)
|
||||
{
|
||||
argc--;
|
||||
argv++;
|
||||
bookmark_fmt = argv [1];
|
||||
}
|
||||
else
|
||||
fatal (1, "missing format string after \"-b\" option\n");
|
||||
}
|
||||
else
|
||||
fatal (1, "unrecognized option \"%s\"\n", argv [1]);
|
||||
}
|
||||
else if (inf_count < MAX_INPUT_FILES)
|
||||
in_fn [inf_count++] = argv [1];
|
||||
else
|
||||
fatal (1, "exceeded maximum of %d input files\n", MAX_INPUT_FILES);
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (! ((! out_fn) ^ (! spec_fn)))
|
||||
fatal (1, "either a spec file or an output file (but not both) must be specified\n");
|
||||
|
||||
if (out_fn && ! inf_count)
|
||||
fatal (1, "no input files specified\n");
|
||||
|
||||
if (spec_fn && inf_count)
|
||||
fatal (1, "if spec file is provided, input files can't be specified as arguments\n");
|
||||
|
||||
if (spec_fn)
|
||||
main_spec (spec_fn);
|
||||
else
|
||||
main_args (out_fn, inf_count, in_fn, bookmark_fmt);
|
||||
|
||||
close_tiff_input_file ();
|
||||
close_pdf_output_files ();
|
||||
exit (0);
|
||||
}
|
||||
71
t2p.h
71
t2p.h
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
*
|
||||
* $Id: t2p.h,v 1.12 2003/03/12 23:59:10 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation. Note that permission is
|
||||
* not granted to redistribute this program under the terms of any
|
||||
* other version of the General Public License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA */
|
||||
|
||||
|
||||
extern int verbose;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool has_resolution;
|
||||
double x_resolution;
|
||||
double y_resolution;
|
||||
|
||||
bool has_page_size;
|
||||
page_size_t page_size;
|
||||
|
||||
bool has_rotation;
|
||||
int rotation;
|
||||
|
||||
bool has_crop;
|
||||
crop_t crop;
|
||||
} input_attributes_t;
|
||||
|
||||
bool open_tiff_input_file (char *name);
|
||||
bool close_tiff_input_file (void);
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *author;
|
||||
char *creator;
|
||||
char *title;
|
||||
char *subject;
|
||||
char *keywords;
|
||||
bool has_bookmarks;
|
||||
} pdf_file_attributes_t;
|
||||
|
||||
bool open_pdf_output_file (char *name,
|
||||
pdf_file_attributes_t *attributes);
|
||||
|
||||
|
||||
void process_page_numbers (int page_index,
|
||||
int count,
|
||||
int base,
|
||||
page_label_t *page_label);
|
||||
|
||||
|
||||
|
||||
bool process_page (int image, /* range 1 .. n */
|
||||
input_attributes_t input_attributes,
|
||||
bookmark_t *bookmarks);
|
||||
12
tumble.c
12
tumble.c
@ -1,10 +1,8 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* Main program
|
||||
* $Id: tumble.c,v 1.31 2003/03/12 23:59:10 eric Exp $
|
||||
* $Id: tumble.c,v 1.32 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -38,7 +36,7 @@
|
||||
#include "bitblt.h"
|
||||
#include "semantics.h"
|
||||
#include "parser.tab.h"
|
||||
#include "t2p.h"
|
||||
#include "tumble.h"
|
||||
#include "pdf.h"
|
||||
|
||||
|
||||
@ -78,8 +76,8 @@ bool close_pdf_output_files (void);
|
||||
void usage (void)
|
||||
{
|
||||
fprintf (stderr, "\n");
|
||||
fprintf (stderr, "t2p - Copyright 2001-2003 Eric Smith <eric@brouhaha.com>\n");
|
||||
fprintf (stderr, "http://www.brouhaha.com/~eric/software/t2p/\n");
|
||||
fprintf (stderr, "tumble - Copyright 2001-2003 Eric Smith <eric@brouhaha.com>\n");
|
||||
fprintf (stderr, "http://www.brouhaha.com/~eric/software/tumble/\n");
|
||||
fprintf (stderr, "\n");
|
||||
fprintf (stderr, "usage:\n");
|
||||
fprintf (stderr, " %s [options] -s spec\n", progname);
|
||||
|
||||
6
tumble.h
6
tumble.h
@ -1,9 +1,7 @@
|
||||
/*
|
||||
* t2p: Create a PDF file from the contents of one or more TIFF
|
||||
* bilevel image files. The images in the resulting PDF file
|
||||
* will be compressed using ITU-T T.6 (G4) fax encoding.
|
||||
* tumble: build a PDF file from image files
|
||||
*
|
||||
* $Id: tumble.h,v 1.12 2003/03/12 23:59:10 eric Exp $
|
||||
* $Id: tumble.h,v 1.13 2003/03/13 00:57:05 eric Exp $
|
||||
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user