Hi Paulo
This is the example with problem.

public void newMethod(PdfWriter writer, Document document) {
                        Color BorderColor = new Color(255,255,255);
                        Color ColordeFondo = new Color(245,244,245);
                        Color Blanco = new Color(255,255,255);
            Font font15 = FontFactory.getFont(FontFactory.HELVETICA_BOLD,
15);
            Font font12 = FontFactory.getFont(FontFactory.HELVETICA_BOLD,
12);
            Font font8Bold = FontFactory.getFont(FontFactory.COURIER_BOLD,
8);            
            Font font6 = FontFactory.getFont(FontFactory.HELVETICA, 8);
            Font font10 = FontFactory.getFont(FontFactory.COURIER, 10);
            Font font10Enc = FontFactory.getFont(FontFactory.HELVETICA, 10);
            Font fontEnc = FontFactory.getFont(FontFactory.COURIER, 8);
                        Font fontTit =
FontFactory.getFont(FontFactory.COURIER, 8);
                        Font fontDato =
FontFactory.getFont(FontFactory.COURIER_BOLD, 8);                       
            Font font9 = FontFactory.getFont(FontFactory.COURIER, 9);
            Font font8 = FontFactory.getFont(FontFactory.COURIER, 8);
            Font fontTextoPie = FontFactory.getFont(FontFactory.COURIER, 6);

                        PdfPCell cell= new PdfPCell(new Phrase("",
fontDato));
                        cell.setBorderColor(ColordeFondo);
                        cell.setPadding(2);
           try {

                   //Tabla Principal

                    document.newPage();
                        PdfPTable table = new PdfPTable(2);
                    int Widthtable[] = {55,45};                 
            table.getDefaultCell().setBorderColor(BorderColor);
            table.setTotalWidth(105);
                    table.setWidthPercentage(100);
 
table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
 
table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
                    table.setWidths(Widthtable);
                    
            PdfPCell SubTitcell = new PdfPCell(new Phrase("POL", font15));
            SubTitcell.setBorderColor(BorderColor);
            SubTitcell.setPadding(3);

                        //Tabla Encabezado
                        
            PdfPTable secondTable = new PdfPTable(3);
 
secondTable.getDefaultCell().setBorderColor(ColordeFondo);
 
secondTable.getDefaultCell().setBackgroundColor(ColordeFondo);
                        secondTable.getDefaultCell().setPadding(5);

                        int widthsecondTable[] = {30,30,40};
                        secondTable.setWidths(widthsecondTable);
                    secondTable.addCell(new Phrase("RAM", fontEnc));
              secondTable.addCell("");
                        secondTable.addCell(new Phrase("", fontEnc));
                        secondTable.addCell(new Phrase("SUB-RAM", fontEnc));
                    secondTable.addCell("");                    
                        secondTable.addCell(new Phrase("", fontEnc));
                        secondTable.addCell(new Phrase("N� POL", fontEnc));
                        secondTable.addCell(new Phrase("", fontEnc));
                        secondTable.addCell(new Phrase("ITEM:      ",
fontEnc));
                        secondTable.addCell(new Phrase("POL ANT", fontEnc));
                        secondTable.addCell(new Phrase("-", fontEnc));
                        secondTable.addCell("");
                                
            cell.setPadding(4);
            cell.setBackgroundColor(new Color(255, 255, 255));
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setBorderColor(BorderColor);
            table.addCell(SubTitcell);
            table.addCell("");
            table.addCell(secondTable);
            table.addCell("");

                        
            //Tabla Vigencia

                        PdfPTable vigenciaTable = new PdfPTable(4);
 
vigenciaTable.getDefaultCell().setBorderColor(ColordeFondo);
 
vigenciaTable.getDefaultCell().setBackgroundColor(ColordeFondo);
                        vigenciaTable.getDefaultCell().setPadding(4);
                        int widthsvigenciaTable[] = {25,25,25,25};
                        vigenciaTable.setWidths(widthsvigenciaTable);

            vigenciaTable.addCell(new Phrase("NOMBRE", fontTit));
                        vigenciaTable.addCell(new Phrase("APELLIDO",
fontTit));
                        vigenciaTable.addCell(new Phrase("APELLIDO",
fontTit));                      
                        vigenciaTable.addCell(new Phrase("CIUDAD",
fontTit));
            vigenciaTable.addCell(new Phrase("NANDO", fontDato));
                        vigenciaTable.addCell(new Phrase("ROC", fontDato));
                        vigenciaTable.addCell(new Phrase("", fontDato));

                        vigenciaTable.addCell(new Phrase("SANTIAGO",
fontDato));
                        vigenciaTable.addCell(new Phrase("", fontDato));
                        vigenciaTable.addCell(new Phrase("", fontDato));
                        vigenciaTable.addCell(new Phrase("", fontDato));
                        vigenciaTable.addCell(new Phrase("", fontDato));


                        //Celda Vigencia
                        PdfPCell cellvigenciaTable= new
PdfPCell(vigenciaTable);
        
cellvigenciaTable.setHorizontalAlignment(Element.ALIGN_CENTER);
        
cellvigenciaTable.setVerticalAlignment(Element.ALIGN_MIDDLE);
                        cellvigenciaTable.setColspan(2);
                        cellvigenciaTable.setPadding(2);
                        cellvigenciaTable.setBorderColor(BorderColor);
                        cellvigenciaTable.setBackgroundColor(ColordeFondo);
                        table.addCell(cellvigenciaTable);

                        PdfPCell cellTitAseg= new PdfPCell(new
Phrase("DATOS", font12));
 
cellTitAseg.setHorizontalAlignment(Element.ALIGN_CENTER);
                        cellTitAseg.setColspan(2);
                        cellTitAseg.setPadding(12);                     
                        cellTitAseg.setBorderColor(BorderColor);
                        cellTitAseg.setBackgroundColor(BorderColor);

                        table.addCell(cellTitAseg);

                        document.add(table);
           }
                catch(Exception de) {
            System.err.println(de.getMessage());
                }
        
}



-----Mensaje original-----
De: Paulo Soares [mailto:[EMAIL PROTECTED]]
Enviado el: mi�rcoles 3 de julio de 2002 10:35
Para: 'Rocha Fernando'; '[EMAIL PROTECTED]'
Asunto: RE: [iText-questions] Problems with print cell background


I just fixed a problem with nested tables that may solve it. Can you post a
small runnable example with the problem?

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Rocha Fernando [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, July 03, 2002 15:22
> To:   '[EMAIL PROTECTED]'
> Subject:      [iText-questions] Problems with print cell background
> 
> Hi.
> I have a PdfPtable table to which I add like cell another PdfPtable table
> to
> him, when set him the method setPadding(x) with x < = 4, at the time of
> printing the page in paper, this one comes out well. Now when I add
> another
> right cell under the previous cell, at the time of printing the page by
> printer, the table appears with his color of cut bottom, that is to say,
> she
> does not cover the table totally. I have proven with other printers and
> happens the same. 
> Thanks.
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> No, I will not fix your computer.
> http://thinkgeek.com/sf
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Caffeinated soap. No kidding.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to