Imprimir PNG

11 views
Skip to first unread message

avazq...@gmail.com

unread,
Jun 17, 2026, 7:11:14 PM (6 days ago) Jun 17
to oo...@googlegroups.com

Buenas
Con oohg + Harbour es posible imprimir un archivo en PNG?
Es para imprimir el QR de la AEAT para las facturas con Verifactu.
Las consigo crear pero en PNG y ahora no las puedo imprimir.

 

Hay alguna función que las transforme el archivo PNG a JPG o BMP? Esos formatos sí los puedo imprimir.

 

Gracias

Saludos

Antonio Vázquez

José Santos Arias Vega

unread,
Jun 17, 2026, 8:31:06 PM (6 days ago) Jun 17
to oo...@googlegroups.com
Hola Antonio,

Buscando en la ayuda de Tprint en  doc/manual/TPRINT.HTM en main · oohg/doc · GitHub

::PrintImage( nSRow, nSCol, nERow, nECol, cImage, aResol, aSize )

  Prints an image.

  Parameters:
    nSRow  = y coordinate of the upper left corner.
             Defaults to 1.
    nSCol  = x coordinate of the upper left corner.
             Defaults to 1.
    nERow  = y coordinate of the lower right corner.
             Defaults to 4.
    nECol  = x coordinate of the lower right corner.
             Defaults to 4.
    cImage = name of the image to print. Must point to a file.
             MINIPRINT and HBPRINTER also accept images from the resource
             file. See note. Defaults to "<>".
    aResol = array specifing horizontal and vertical resolution of the
             image (or a number if both values are the same). Unit: DPI.
    aSize  = array specifing width and height of the image (or a number
             if both values are the same). Unit: 1/100 mm.

  Notes:
    MINIPRINT and HBPRINTER support ICO, BMP, JPG and GIF formats.
    EXCELPRINT and HTMLPRINTFROMEXCEL support formats supported by Excel.
    CALCPRINT and HTMLPRINTFROMCALC support formats supported by Calc.
    PDFPRINT supports JPG and GIF formats. Beware that cImage must point
    to a file with TIF, TIFF, JPG or JPEG extension.
    DOSPRINT, RAWPRINT, SPREADSHEETPRINT, RTFPRINT and CSVPRINT do not
    support image printing.
    When using HTMLPRINT, supported formats depend on the underlying app
    installed on the system (if both Excel and Calc are installed, the
    first takes precedence; you can test DATA cPrintLibrary to identify
    which one is being used).

  Parameter support by printing mode:
    aResol and aSize are supported by CALCPRINT mode only.
    Specify aResol to print the image at its original size. To find the
    image resolution use a graphics software like IrfanView.
    Specify aSize to print the image at a different size.
    If both parameters are specified, resolution takes precedence.
    If none is specified the resulting size is defined by Calc.
Pero usando hmg oficial se puede imprimir PNG

SELECT HPDFDOC cPdf PAPERLENGTH 300 PAPERWIDTH 300 LOG
SET HPDFDOC COMPRESS ALL
START HPDFDOC
    START HPDFPAGE

SET HPDFDOC ENCODING TO "WinAnsiEncoding"

*                _HMG_HPDF_IMAGE ( 'codigobarras.png', ntimbre, 1, 20, 50, )

Ojalá te sirva de ayuda.


José



Saludos.


José Arias Vega

--
Has recibido este mensaje porque estás suscrito al grupo "[oohg]" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a oohg+uns...@googlegroups.com.
Para ver este debate, visita https://groups.google.com/d/msgid/oohg/01bd01dcfeae%24951024a0%24bf306de0%24%40gmail.com.

Walter Fedeli

unread,
Jun 18, 2026, 7:24:16 AM (6 days ago) Jun 18
to [oohg]
Hola,
Como estas?
Yo para imprimir el QR en la factura utilizo  la Tprint de esta forma:


 w_afip_cod_qr:='{"ver":1,"fecha":"' + alltrim(FT_XTOY(wfiso , 'C')) + '","cuit":' + alltrim(FT_XTOY(n_nucuit, 'C')) + ',"ptoVta":' + alltrim(FT_XTOY(aEncabe[5] , 'C')) + ',"tipoCmp":' + alltrim(FT_XTOY(FT_XTOY(aEncabe[1] , 'N'), 'C')) + ',"nroCmp":' + alltrim(FT_XTOY(aEncabe[6] , 'C')) + ',"importe":' + alltrim(FT_XTOY(str(aPie[20] * 100 , 0)  , 'C')) + ',"moneda":"PES","ctz":1,"tipoDocRec":' + alltrim(FT_XTOY(WXTIPDOCU_CAE , 'C')) + ',"nroDocRec":' + alltrim(StrTran(FT_XTOY(aEncabe[11] , 'C'),"-","")) + ',"tipoCodAut":"E","codAut":' + alltrim(FT_XTOY(aPie[21] , 'C') ) + '}'

* Codifico en base64 ========================================================
w_afip_cod_qr64 := hb_base64Encode( w_afip_cod_qr ) // Funci¢n de Harbour
*============================================================================*

wvarQR_n:= alltrim(w_afip) + alltrim(w_afip_cod_qr64) 

oprint:printbarcode(262, 12, wvarQR_n, "QRCODE", {0,0,0} , .f. , 23 , 23 )

Espero que te sirva

Saludos!!

Walter Fedeli
Reply all
Reply to author
Forward
0 new messages