i need to add a tittle to my pdf but when i try the pdfcontentbyte
it's throw a "the Document is not open" error :/
how can i solve it (here a bit of my code where i declare and everything BUT some words are in spanish)
THANKS :)
Dim sr As New StringReader(sw.ToString())
Dim pdfDoc As New Document(PageSize.B3, 10.0F, 10.0F, 300.0F, 0.0F)
Dim htmlparser As New HTMLWorker(pdfDoc)
PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
Dim cb As PdfContentByte
Dim linea As PdfContentByte
Dim rectangulo As PdfContentByte
Dim fuente1 As iTextSharp.text.pdf.BaseFont
pdfDoc.Open()
cb = pdfw.DirectContent
linea = pdfw.DirectContent
rectangulo = pdfw.DirectContent
'Agregamos una pagina.
'Iniciamos el flujo de bytes.
cb.BeginText()
fuente1 = FontFactory.GetFont(FontFactory.HELVETICA, iTextSharp.text.Font.DEFAULTSIZE, iTextSharp.text.Font.NORMAL).BaseFont 'fuente negrita
cb.SetFontAndSize(fuente1, 8) 'llamada a la fuente y tamaño
'Seteamos el color del texto a escribir.
cb.SetColorFill(iTextSharp.text.BaseColor.BLUE)
cb.ShowTextAligned(PdfContentByte.ALIGN_CENTER, "TEXTO de prueba (centro)", 315, 730, 0)
' Agregamos una pagina.
pdfDoc.NewPage()