The image is bigger than the page, you'll have to scale it or make the page 
bigger.

Paulo

________________________________
From: Barry Dysert [mailto:barry.dys...@one-view.com]
Sent: Thursday, September 08, 2011 6:04 PM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] tiff image is being cropped in pdf created by 
iTextSharp

As a test, I'm trying to create a simple pdf to represent a one-page tiff.  
When I use iTextSharp to create the pdf from the tiff, though, the tiff image 
is being cropped.  However, if I create the pdf by going into Adobe Acrobat and 
importing the tiff, the resulting pdf is fine.   The files are attached.  
Here's the code I'm using:

            string overlay = @"c:\temp\overlay.tif";
            string pdffile = @"c:\temp\overlay_iTextSharp.pdf";

            // setup
            pdfdoc = new iTextSharp.text.Document(new 
iTextSharp.text.Rectangle(72 * 8.5f, 72 * 11f), 0, 0, 0, 0);
            PdfWriter.GetInstance(pdfdoc, new FileStream(pdffile, 
FileMode.Create));
            pdfdoc.Open();

            // overlay
            iTextSharp.text.Image img = 
iTextSharp.text.Image.GetInstance(overlay);
            img.Alignment = iTextSharp.text.Image.UNDERLYING;
            pdfdoc.Add(img);

            pdfdoc.Close();


Can someone please tell me what I'm doing wrong?  I'd like to use iTextSharp 
and not have the tiff image be cropped.  Thanks!

-----------------
Barry Dysert
bdys...@one-view.com


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.
------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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