Esdras Antonio Mellanes Reyes wrote:
> Y have the following code
> 
>             p = new System.Web.UI.Page();
>             iTextSharp.text.Image imgheadIzq = 
> iTextSharp.text.Image.GetInstance(p.Server.MapPath("~") + 
> "\\Img\\EscudoNacional.png");
>             iTextSharp.text.Image imgheadDer = 
> iTextSharp.text.Image.GetInstance(p.Server.MapPath("~") + 
> "\\Img\\LogoGobierno.png");
> 
>  
> Now wath i want to do is this
> 
> 
> 
>             p = new System.Web.UI.Page();
>             iTextSharp.text.Image imgheadIzq = 
> iTextSharp.text.Image.GetInstance(p.Server.MapPath("~") + VLogotipo1);
>             iTextSharp.text.Image imgheadDer = 
> iTextSharp.text.Image.GetInstance(p.Server.MapPath("~") + vLogotipo2);
> 
> both fo them variable that changes a lot and i need to pass
> 
> can any one help me?

This is something you should have learned when you had your first
Java lessons. Create two member variables VLogotipo1 and vLogotipo2
in your implementation of the Event class. Use setters and getters
to set/get the variables.

Of course, if you'd follow a course in iText, somebody would
probably tell you that it's a bad idea to create a new Image
object in onStartPage. This will lead to huge PDF files.

Instead you should use Image objects as member variables instead
of Strings like VLogotipo1 and vLogotipo2 and set the images with
a setter. This way, each image will be added to the PDF only once
(avoiding redundancy).
-- 
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to