I have lot of EPS and TIFF images that needs to be manually verified.
So I wanted to create a PDF with those images.
I recently learned to do this with iText as a first step toward another
goal. My code follows.
System: Windows 2000
Packages available: Perl 5.8, Image magick and Ghost Script.
I don't know of any reason you shouldn't be able to install iText
http://www.lowagie.com/iText/
and Jython
http://www.jython.org/
on such a system.
--kyler
========================================================================
#!/usr/bin/env jython
import sys
sys.path.append('/usr/share/java/itext.jar')
import com.lowagie
import java
document = com.lowagie.text.Document(
com.lowagie.text.PageSize.LETTER.rotate(),
page_size,
0, 0, 0, 0
)
com.lowagie.text.pdf.PdfWriter.getInstance(document, java.io.FileOutputStream('foo.pdf'));
document.open()
image_filenames = [
'/home/kyler/common/images/disk0022/img_1279.jpg',
'/home/kyler/common/images/disk0022/img_1284.jpg',
'/home/kyler/common/images/disk0022/img_1304.jpg',
]
width = document.getPageSize().width()
height = document.getPageSize().height()
for image_filename in image_filenames:
print 'adding %s' % (image_filename)
image = com.lowagie.text.Image.getInstance(image_filename)
#image.scalePercent(40)
image.scaleToFit(width, height)
document.add(image)
document.close()