Hi, 
PDFs generated by a number of different scanners are processed by iText-5.0.5,
and watermark is applied over scanned image. It works like charm, but just one
new scanner produces his pdfs in such a format, that makes the stamp somehow
invisible (or misplaced). (Files produced by this scanner match even the PDF/A
test, so the file itself should be OK)


The particular pdf file is located here: http://www.sendspace.com/file/tl0swj

Code snipped used to stamp over pdf page is identical with example from the book
part2.chapter06.StampText: http://itextpdf.com/examples/iia.php?id=117

 public static void stamp(String src, String dest)throws Exception {
        PdfReader reader = new PdfReader(src);
        PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
        PdfContentByte canvas = stamper.getOverContent(1);
        ColumnText.showTextAligned(canvas,
                Element.ALIGN_LEFT, new Phrase("Hello people!"), 36, 540, 0);
        stamper.close();
 } 

It looks like the stamp is applied correctly, because the resulting file is a
bit larger, than the source file, but the stamp is not visible. 
Fiddling with this file, i have found out, that the PdfName.MEDIABOX has his X
value negative: reader.getPageN(1).getAsArray(PdfName.MEDIABOX) prints [0,
-1670.40002, 2373.12012, 0]. Is it a hint?


Your help is appreciated :)


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to