Ben Anderson wrote:

actually I tried using the Tiff2Pdf tool:

   public void testTiff2PdfTest() {
       String tiffFile =  rootDir+"400dpiCCITTGroup4.tif";
       String pdfFile =  rootDir+"pdfer.pdf";
       Tiff2Pdf.main(new String[] {tiffFile, pdfFile});
   }

This works, but the top margin is way too big and the filename is
being put at the top of the page (which makes is not acceptable for
us). Is there any way to control these things?


Yes, there is.
If you choose 'original' as pagesize in the JWS app,
the PDF pages have the same size as the TIFF pages.

Remark that you are probably looking at the 1.3 code.
For the JWS app, I am already using new code
(you'll find the complete javafile in the CVS repository):

for (int c = 0; c < comps; ++c) {
Image img = TiffImage.getTiffImage(ra, c + 1);
if (img != null) {
if (adjustSize) {
document.setPageSize(new Rectangle(img.scaledWidth(),
img.scaledHeight()));
document.newPage();
img.setAbsolutePosition(0, 0);
}
else {
if (img.scaledWidth() > 500 || img.scaledHeight() > 700) {
img.scaleToFit(500, 700);
}
img.setAbsolutePosition(20, 20);
document.newPage();
document.add(new Paragraph(tiff_file + " - page " + (c + 1)));
}
cb.addImage(img);
System.out.println("Finished page " + (c + 1));
}
}


Create your Document with the size of the first page in the tiff.
Then change the pageSize for every new page BEFORE you
trigger a newPage().

br,
Bruno


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to