HPDFPRINT IMAGE Image cannot be loaded

Moderator: Rathinagiri

User avatar
Algernon
Posts: 40
Joined: Sat Mar 20, 2010 10:36 am
DBs Used: DBF
Location: Arucas, Gran Canaria, Canary Islands

HPDFPRINT IMAGE Image cannot be loaded

Post by Algernon » Thu Nov 21, 2019 12:33 pm

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

Javier Suárez

La obra humana más bella es la de ser útil al prójimo. (Sófocles)
The most beautiful work of man is to be useful to others. (Sófocles)

Georg_BA
Posts: 41
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF
Been thanked: 1 time

Post by Georg_BA » Thu Nov 21, 2019 4:09 pm

Try entering the full path to the image.

Georg_BA
Posts: 41
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF
Been thanked: 1 time

Post by Georg_BA » Thu Nov 21, 2019 4:11 pm

C:\Images\logofeet.PNG

franco
Posts: 370
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 11 times

Post by franco » Thu Nov 21, 2019 4:28 pm

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
Franco Bushie
Canada

User avatar
mustafa
Posts: 862
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 132 times
Contact:

Post by mustafa » 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

franco
Posts: 370
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 11 times

Post by franco » Fri Nov 22, 2019 12:31 am

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
Franco Bushie
Canada

franco
Posts: 370
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 11 times

Post by franco » Fri Nov 22, 2019 1:28 am

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
Franco Bushie
Canada

User avatar
AUGE_OHR
Posts: 313
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 34 times
Been thanked: 41 times

Post by AUGE_OHR » Fri Nov 22, 2019 1:36 am

hi,

where do i find "readycam" :?:

User avatar
Algernon
Posts: 40
Joined: Sat Mar 20, 2010 10:36 am
DBs Used: DBF
Location: Arucas, Gran Canaria, Canary Islands

Post by Algernon » Fri Nov 22, 2019 1:47 pm

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

Javier Suárez

La obra humana más bella es la de ser útil al prójimo. (Sófocles)
The most beautiful work of man is to be useful to others. (Sófocles)

User avatar
mustafa
Posts: 862
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 132 times
Contact:

Post by mustafa » Fri Nov 22, 2019 3:36 pm

Hola Algernon
Pues en las pruebas me está dando Error los JPG
te mando mi ejemplo que solo funciona con PNG

Saludos
Mustafa
Attachments
PDF_Sample-PNG.zip
(2.24 MiB) Downloaded 13 times

Post Reply