scissors.pdf is damaged.

Paulo

________________________________
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, June 23, 2010 10:04 PM
To: [email protected]
Subject: Re: [iText-questions] [itextsharp]: PdfContentByte.AddImage no longer 
showing image with update to 5.x version

Hi Paulo,

I've attached a ZIP file of a complete standalone sample (including the image I 
use, which worked with the earlier versions of iTextSharp).



>You'll have to provide a complete standalone example so that the problem can 
>be reproduced.



>Paulo



________________________________
From: [email protected]
To: [email protected]
Subject: [itextsharp]: PdfContentByte.AddImage no longer showing image with 
update to 5.x version
Date: Tue, 8 Jun 2010 13:22:30 -0500

Hello,

I updated my application to use the updated version of iTextSharp (5.0.1.1) 
only to find that code that I used to insert an image at an absolute position 
no longer shows the image. I updated to 5.0.2 as well, and still encounter the 
same issue.

I receive no exceptions from my code nor does Acrobat report any syntax issues 
with the generated PDF. The code adds an image (loaded from a PDF) and places 
it at the lower-left-hand corner of the table on the TableLayout event. In the 
handler I also draw a dashed border around the table, which continues to work 
as expected, just my image isn't visible any longer. My code is as follows:


public void TableLayout(PdfPTable table, float[][] width, float[] heights, int 
headerRows, int rowStart, PdfContentByte[] canvases)
{
float[] widths = width[0];
PdfContentByte cb = canvases[PdfPTable.TEXTCANVAS];
PdfGState gState = null;
gState = new PdfGState();
gState.FillOpacity = 1f;
gState.StrokeOpacity = 1f;

cb.SaveState();
cb.SetLineWidth(1f);
cb.SetRGBColorStroke(0, 0, 0);
cb.SetLineDash(4f, 2f, 0f);
cb.Rectangle(widths[0], heights[heights.Length - 1], widths[widths.Length - 1] 
- widths[0], heights[0] - heights[heights.Length - 1]);
cb.Stroke();

PdfReader reader = new PdfReader(iconsFolderPath + "myicons.pdf");
PdfImportedPage importedPage = writer.GetImportedPage(reader, 1);
Image icon = Image.GetInstance(importedPage);

cb.SetGState(gState);
icon.Alignment = Image.ALIGN_LEFT | Image.ALIGN_TOP;
icon.SetAbsolutePosition(widths[0] - (icon.ScaledWidth / 2f), 
heights[heights.Length - 1] - (icon.ScaledHeight / 2f) - 2f);
cb.AddImage(icon);

cb.RestoreState();

// clean-up
importedPage = null;
icon = null;
reader.Close();
reader = null;

}



Any help in correcting this would be appreciated. Thank you.



Mark



________________________________
Look 'em in the eye: FREE Messenger video chat Chat 
Now!<http://go.microsoft.com/?linkid=9734382>
________________________________
Enter for a chance to get your town photo on Bing.ca! Submit a Photo Now! 
<http://go.microsoft.com/?linkid=9734383>


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.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to