este es el codigo
Código PHP:
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Imports iTextSharp.text
Imports iTextSharp.text.pdf
Imports iTextSharp.text.html
Imports iTextSharp.text.html.simpleparser
Imports System.Text
Partial Class repuesto_detalle
Inherits System.Web.UI.Page
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "attachment;filename=Equipo.pdf")
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Dim sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
GridView_titulo.AllowPaging = False
GridView_titulo.DataBind()
GridView_titulo.RenderControl(hw)
DetailsView_repuesto.AllowPaging = False
DetailsView_repuesto.DataBind()
DetailsView_repuesto.RenderControl(hw)
Dim sr As New StringReader(sw.ToString())
Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 0.0F)
Dim htmlparser As New HTMLWorker(pdfDoc)
PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
pdfDoc.Open()
htmlparser.Parse(sr)
pdfDoc.Close()
Response.Write(pdfDoc)
Response.End()
End Sub
Protected Function GetUrl(ByVal page As String) As String
Dim splits As String() = Request.Url.AbsoluteUri.Split("/"c)
If splits.Length >= 2 Then
Dim url As String = splits(0) & "//"
For i As Integer = 2 To splits.Length - 2
url += splits(i)
url += "/"
Next
Return url + page
End If
Return page
End Function
Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
Verifies that the control is rendered
End Sub
End Class