
24/03/2009, 03:27
|
 | | | Fecha de Ingreso: marzo-2009
Mensajes: 3
Antigüedad: 16 años, 1 mes Puntos: 0 | |
Respuesta: Algún experimentado en iTextSharp generando PDFs Hola, estoy empezando con iTextSharp, y queria hacerles una pregunta, a ver si me pueden ayudar. tengo una tabla de tres columnas y una fila, en dos de esas columnas tengo unas imagenes que no consigo centrar dentro de las celdas.
las imagenes las añado a un objeto PdfPCell y esta celda a la tabla, les dejo el código:
PdfPTable tablaImagenes = new PdfPTable(3);
iTextSharp.text.Image imgP = iTextSharp.text.Image.GetInstance("caracol.png");
imgP.Alignment = Element.ALIGN_CENTER;
iTextSharp.text.Image imgM = iTextSharp.text.Image.GetInstance("abrazo.png");
imgM.Alignment = Element.ALIGN_CENTER;
PdfPCell imgProveedor = new PdfPCell();
imgProveedor.AddElement(imgP);
//imgProveedor.HorizontalAlignment = iTextSharp.text.Rectangle.ALIGN_CENTER;
PdfPCell imgMarca = new PdfPCell();
imgMarca.AddElement(imgM);
//imgMarcar.HorizontalAlignment = iTextSharp.text.Rectangle.ALIGN_CENTER;
tablaImagenes.AddCell(imgProveedor);
tablaImagenes.AddCell(imgMarca);
He probado con alinear la imagen, y eso no hace ni caso. También he probado con alinear la celda, y tampoco.
no sé si se me escapa algo, o estoy haciendo algo mal.
Gracias por su tiempo!!! |