Well that is embarassing and so rookie of me; I didn't check the simplest 
thing. I apologize for taking up your time and thank you for taking the time.
 
>scissors.pdf is damaged.
 
>Paulo

 



From: [email protected]
To: [email protected]
Subject: RE: [itextsharp]: PdfContentByte.AddImage no longer showing image with 
update to 5.x version
Date: Wed, 23 Jun 2010 16:04:22 -0500



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! 


Enter for a chance to get your town photo on Bing.ca! Submit a Photo Now! 


Enter for a chance to get your town photo on Bing.ca! Submit a Photo Now!       
                                  
_________________________________________________________________
Look 'em in the eye: FREE Messenger video chat
http://go.microsoft.com/?linkid=9734386
------------------------------------------------------------------------------
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