Images from server / Fotos desde servidor

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Images from server / Fotos desde servidor

Post by Claudio Ricardo »

Hi Franco...
I will take a piece of each code to put together what I need, yours will be very useful to me.
Thank You so much !!!!
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Images from server / Fotos desde servidor

Post by franco »

I found in this demo I can not print to pdf from jpg size changes. The only one that I can print to pdf is if I use 1 as size and it is the smallest.
I am going to need help with this. I have tried some of the pdf print problem post with no result. When I open the sized jpg file with notepad
The first line is changed in all but the size 1. I do not think the program knows it is a jpg any more.
I can print to text file but not pdf.
Any thought`s...
All The Best,
Franco
Canada
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Images from server / Fotos desde servidor

Post by AUGE_OHR »

hi franco,

as i can say you do use BT_CreateDC() and Bitmap Structure which is need to assign device context (DC) for a device ( Printer )
have fun
Jimmy
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Images from server / Fotos desde servidor

Post by franco »

Jimmy, thanks for response. Can you give me more idea of what you are suggesting.
This is my print trial, which works on size 1 but others say ** image a can not be loaded ** but rest of pdf is there.
I have tried some different Coding but to no avail,

Code: Select all

Procedure PrintTest5()
*------------------------------------------------------------------------------*
Local i 
Local lSuccess
	

	SELECT PRINTER PDF 'pdfprintdemo.pdf' TO lSuccess

	If lSuccess == .T.
		PrintDoc()
		MsgInfo('Print Finished')
      if file( 'pdfprintdemo.pdf')
         execute file 'pdfprintdemo.pdf'
      endif   
	EndIf

Return

Procedure PrintDoc
*------------------------------------------------------------------------------*

*	HB_SETCODEPAGE("ESWIN")
	// Measure Units Are Millimeters

*	IF _HMG_SYSDATA [ 513 ] == .T.		//SELECT PRINTER PDF
*		SET HPDFDOC ENCODING TO "CP1252"
*	ENDIF
		START PRINTDOC 
			START PRINTPAGE
				@ 5,020 print IMAGE 'Test-1a.jpg' WIDTH 70  HEIGHT 50 type jpg  
				@ 5,100 print IMAGE 'Test-3a.jpg' WIDTH 70  HEIGHT 50 type jpg  					
				@ 160,20 PRINT 'Nice Day  Today' size 10			
                     END PRINTPAGE
		END PRINTDOC
*	HB_SETCODEPAGE("ES")
Return
All The Best,
Franco
Canada
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Images from server / Fotos desde servidor

Post by AUGE_OHR »

hi,

have you try to load your "*JPG" with other Apps :idea:

Code: Select all

ACTION {|| {Mlr:=val(inputbox('Enter Size, 0, 1, 3'))}, {resize('Test-1.jpg')}}

ACTION {|| {Mlr:=val(inputbox('Enter Size, 0, 1, 3'))}, {resize('Test-3.jpg')}}  

nTypePicture := mlr   
BT_BitmapSaveFile (hBitmap, cFileName, nTypePicture)
c:\hmg.3.4.4\INCLUDE\BosTaurus.ch

Code: Select all

// BT_BMP_SAVEFILE() 
   // nTypePicture
   #define BT_FILEFORMAT_BMP   0
   #define BT_FILEFORMAT_JPG   1 
   #define BT_FILEFORMAT_GIF   2
   #define BT_FILEFORMAT_TIF   3
   #define BT_FILEFORMAT_PNG   4
IMHO your "JPG" as Extension it is wrong for "3" which is "TIF" ... not sure if you can use it for PDF
have fun
Jimmy
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Images from server / Fotos desde servidor

Post by franco »

Jimmy, thank you for clarifying the resize numbers. I did not know how they worked. I new they made different file sizes but did not know they
changed the file type. I found only jpg-1 and png-4 will work with a pdf printout.
Thanks again.
All The Best,
Franco
Canada
Post Reply