Page 1 of 6

HPDFPRINT IMAGE Image cannot be loaded

Posted: Thu Nov 21, 2019 12:33 pm
by Algernon
Hy everybody!

I have same programs made with HMG 3.4.3 or before and they work fine, now I'm writting an aplication in HMG 3.4.4. ANSI and want to make a pdf file and also want an image in it. The source is the following

Code: Select all

#include <hmg.ch>
#include "hfcl.ch"
#include "hmg_hpdf.ch"

Function listado_02()
SELECT HPDFDOC "listado.pdf" PAPERSIZE HPDF_PAPER_A4
START HPDFDOC
    START HPDFPAGE
	
	SET HPDFDOC ENCODING TO "WinAnsiEncoding"

		@  85, 100 HPDFPRINT IMAGE 'Images\logofeet.PNG' WIDTH 100 HEIGHT 30 TYPE PNG
		@  25,  10 HPDFPRINT "Listado de Titulaciones"
		@  32,   5 HPDFPRINT LINE TO 32, 200 PENWIDTH 1 
		@ 185, 100 HPDFPRINT IMAGE 'Images\printer.jpg' WIDTH 100 HEIGHT 30 TYPE JPG

    END HPDFPAGE
END HPDFDOC
Execute File 'listado.pdf'
Return Nil
It has not alot of lines just I'm starting to make de header, but it has the following error
Image

I can also compile without error the sample HMG_HPDF_Doc witch has the function HPDFPRINT IMAGE

Sorry for my bad english

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Thu Nov 21, 2019 4:09 pm
by Georg_BA
Try entering the full path to the image.

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Thu Nov 21, 2019 4:11 pm
by Georg_BA
C:\Images\logofeet.PNG

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Thu Nov 21, 2019 4:28 pm
by franco
I am having the same problem. Pictures taken with a normal camera seem to work, but pictures taken with laptop camera with
hmg programmed camera do not work. Pictures taken with the laptop internal camera seem to work. The hmg resource pictures seem to work.
I gave up after a week of trying to figure it out.
What I have to do is print to a normal printer which works, and with preview I print to the disk on the printer. Then give it a pdf name.
Hope someone can figure this one out.
Franco

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Thu Nov 21, 2019 5:59 pm
by mustafa
Hola Algernon
Estoy haciendo pruebas con Hmg 3.4.3 y Hmg 3.4.4
y solo me está dando Error los ficheros jpg ,
los png NO!!
Seguiré Probando
Saludos

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Fri Nov 22, 2019 12:31 am
by franco
Mustafa, thanks for response.
Is there a way to take a png picture with hmg readycam(). This would solve my problem.
I used paint to change a jpg picture I took with readycam to a png picture. It now works with hpdprint image.
I noticed in readycam text to html do you think this may have anything to do with it.
Franco

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Fri Nov 22, 2019 1:28 am
by franco
I have just found if I take a jpg picture with readycam() then open it with paint and do nothing but save it
as a different name.jpg it will now work with hpdprint.
The original size was 194 kb the new file was 25 kb. There must be something wasting space.
Franco

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Fri Nov 22, 2019 1:36 am
by AUGE_OHR
hi,

where do i find "readycam" :?:

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Fri Nov 22, 2019 1:47 pm
by Algernon
mustafa wrote: Thu Nov 21, 2019 5:59 pm Hola Algernon
Estoy haciendo pruebas con Hmg 3.4.3 y Hmg 3.4.4
y solo me está dando Error los ficheros jpg ,
los png NO!!
Seguiré Probando
Saludos
Buenos días Mustafá, hoy he cogido del fichero demo.prg de la carpeta C:\hmg.3.4.4\SAMPLES\HPDF\Demo1 y le añadí la sentencia @ 5, 150 HPDFPRINT IMAGE 'logofeet.JPG' WIDTH 50 HEIGHT 12 TYPE JPG y funciona, pero no los .PNG, pues a mí me muestra los ficheros .JPG y me da error en los .PNG, es algo extraño.

He convertido los ficheros .PNG a .JPG y ahora no me da el error. Ahora bien, si pongo dos sentencia una con un fichero .PNG y otra con uno .JPG, no me muestra ninguno de los dos ficheros y me da el error dos veces, una por cada fichero.

@ 5, 50 HPDFPRINT IMAGE 'logofeet.PNG' WIDTH 50 HEIGHT 12 TYPE PNG
@ 15, 50 HPDFPRINT IMAGE 'logofeet.JPG' WIDTH 50 HEIGHT 12 TYPE JPG

La solución es qua tengo en usar ficheros JPG, aunque son más pesados y ocupan más.

Saludos

Re: HPDFPRINT IMAGE Image cannot be loaded

Posted: Fri Nov 22, 2019 3:36 pm
by mustafa
Hola Algernon
Pues en las pruebas me está dando Error los JPG
te mando mi ejemplo que solo funciona con PNG

Saludos
Mustafa