Page 2 of 2

Re: Images from server / Fotos desde servidor

Posted: Sun Feb 21, 2021 11:49 pm
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 !!!!

Re: Images from server / Fotos desde servidor

Posted: Tue Feb 23, 2021 7:43 pm
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...

Re: Images from server / Fotos desde servidor

Posted: Tue Feb 23, 2021 10:04 pm
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 )

Re: Images from server / Fotos desde servidor

Posted: Wed Feb 24, 2021 12:18 am
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

Re: Images from server / Fotos desde servidor

Posted: Wed Feb 24, 2021 3:36 am
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

Re: Images from server / Fotos desde servidor

Posted: Wed Feb 24, 2021 10:33 am
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.