Crear pdf en visual basic 6

Solo disponible en BuenasTareas
  • Páginas : 4 (771 palabras )
  • Descarga(s) : 0
  • Publicado : 8 de junio de 2011
Leer documento completo
Vista previa del texto
Private Sub Command1_Click() Dim direccion As String Dim indice As Integer Dim nodo_path As String Dim valor As String direccion = "d:/Facturas/JU502.xml" indice = 2 'nodo_path ="/Comprobante/Emisor/DomicilioFiscal" 'valor = buscarnodo(nodo_path, indice, direccion) convertir (direccion) End Sub Private Function buscarnodo(nodo_path As String, indice As Integer, direccion As String) As String DimoParse As MSXML2.DOMDocument Set oParse = New MSXML2.DOMDocument If oParse.Load(direccion) Then Dim Nodos As MSXML2.IXMLDOMNodeList Dim oNodo As MSXML2.IXMLDOMNode Set Nodos = oParse.childNodes SetoNodo = Nodos.Item(0).selectSingleNode(nodo_path) 'MsgBox ("Valor" + oNodo.attributes["Valor1"]) buscarnodo = oNodo.Attributes.Item(indice).nodeValue End If End Function Private Sub convertir(direccionAs String) Dim nodo_path As String Dim indice As Integer Dim valor As String Dim pdf As PdfComLib.PdfDoc Set pdf = New PdfDoc Dim x As Integer Dim y As Integer Dim alto As Integer Dim ancho AsInteger

pdf.AddPage (1)

pdf.SetFont "Arial", "", 10 pdf.SetXY 50, 50 pdf.MultiCell 100, 5, "Texto multilinea prueba de texto extensommmm mmmmmm mmmmmmmoooooooo oooooooooooooooooo oooo", 15, 0, True,2

'x = pdf.GetPageHeight 'y = pdf.GetPageWidth ''################ Imagen ###################### pdf.SetFillColor 255, 228, 181 pdf.Rect 5, 5, 40, 40, 30 '##################### Encabezado########################### Dim inix_enc, iniy_enc As Integer Dim alto_enc As Integer Dim ancho_enc As Integer alto_enc = 12 ancho_enc = 100 iniy_enc = 5 inix_enc = 50''---------------------titulo----------------------------nodo_path = "/Comprobante/Emisor" indice = 1 valor = buscarnodo(nodo_path, indice, direccion) Dim borde As Integer borde = 15 '#############Borde pdf.SetFont "Arial", "", 10 pdf.SetYiniy_enc pdf.SetX inix_enc pdf.Cell ancho_enc, alto_enc, valor, borde, 123, 1, 0, "" pdf.SetXY 50, 100 'pdf.ClippedCell 50, 6, "cccccccccccccccccCLIPpEDCELL", 15, 1, 2, 2, "" '##Clippedcell##celda...
tracking img