2009-12-16 5 views
1

je suis en train de changer la police sur une pdftable et j'ai cette astuce en Java, mais ont besoin d'aide pour mettre en vb.netiTextSharp: java à VB.NET

PdfPTable table = new PdfPTable(3); 
    table.AddCell("Cell 1"); 
    PdfPCell cell = new PdfPCell(new Phrase("Cell 2", new Font(Font.HELVETICA, 8f, Font.NORMAL, Color.YELLOW))); 

Répondre

2
Imports iTextSharp.text 
Imports iTextSharp.text.pdf 

Module Module1 

    Sub Main() 

     Dim table As New PdfPTable(3) 
     table.AddCell("Cell 1") 
     Dim f As New Font(Font.HELVETICA, 8.0F, Font.NORMAL, Color.YELLOW) 
     Dim ph As New Phrase("Cell 2", f) 
     Dim cell As New PdfPCell(ph) 

    End Sub 

End Module 
+0

il dit HELVÉTICA n'est pas membre de system.drawing.font –

+2

Dans VB.NET, lorsque 'Imports iTextSharp.text' est utilisé, vous pouvez obtenir un conflit car Visual Studio ne sait pas si vous voulez System.Drawing.Font ou iTextSharp.text. Police de caractère. En qualifiant complètement l'objet Font que vous voulez, vous pouvez le résoudre. – Stewbob

+0

merci beaucoup vous êtes super –