How to print an image & data on it

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

How to print an image & data on it

Post by swapan »

Dear All:

Plz. go thru the attached image file....

Its meant for label printing.....

On the label sheet (A4 size with two labels) I've to print this image file & the user's data as entered...........

1 entry program in hmg with dbf as backend can be made for this.
But how to print user's those data on this image??

Thanks!

Swapan
Attachments
Sample.JPG
Sample.JPG (54.62 KiB) Viewed 4678 times
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: How to print an image & data on it

Post by Roberto Lopez »

swapan wrote:Dear All:

Plz. go thru the attached image file....

Its meant for label printing.....

On the label sheet (A4 size with two labels) I've to print this image file & the user's data as entered...........

1 entry program in hmg with dbf as backend can be made for this.
But how to print user's those data on this image??

Thanks!

Swapan
You have full control of the print output via @...PRINT commands, you can print images besides text and lines.

You can position the text and images exactly in the place you want without regarding printer or paper size used.

Please, take a look at 'Print Commands' at HMG docs: hmgdoc/hmgdoc.htm
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mol
Posts: 3805
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How to print an image & data on it

Post by mol »

Here is my application, which can print labels.
Maybe it will be useful for you.
You need to recompile it.
Attachments
lemar.zip
(381 KiB) Downloaded 387 times
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How to print an image & data on it

Post by swapan »

Thanks Roberto Sir for your reply..........
And Mol its a great gesture on your part to share your label program with us.

Will revert after going through the project..

Thanks & Regards,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How to print an image & data on it

Post by swapan »

Can I accomplish the job using Report Writer?

I've used this kind of code:

DEFINE REPORT Report1
* Report Layout ***********************************************
BEGIN LAYOUT
PAPERSIZE PRINTER_PAPER_A4
ORIENTATION PRINTER_ORIENT_PORTRAIT
END LAYOUT
* Header Band *************************************************
BEGIN HEADER
BANDHEIGHT 25


Its generating 2 labels in 1 A4 sized sheet, but no. of copies option is disabled, how can I initialize this value and the user can put values for No. of copies??

For Dot Matrix Printer (local) its coming, but for others (network printers) which are deskjets - no. of copies is disabled.... Not sure if the network printers at my office are right now offline or not....
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How to print an image & data on it

Post by swapan »

swapan wrote:Can I accomplish the job using Report Writer?

I've used this kind of code:

DEFINE REPORT Report1
* Report Layout ***********************************************
BEGIN LAYOUT
PAPERSIZE PRINTER_PAPER_A4
ORIENTATION PRINTER_ORIENT_PORTRAIT
END LAYOUT
* Header Band *************************************************
BEGIN HEADER
BANDHEIGHT 25


Its generating 2 labels in 1 A4 sized sheet, but no. of copies option is disabled, how can I initialize this value and the user can put values for No. of copies??

For Dot Matrix Printer (local) its coming, but for others (network printers) which are deskjets - no. of copies is disabled.... Not sure if the network printers at my office are right now offline or not....
How to enable the option 'No. of Copies' in the printer dialog with above kind of coding.....?

thanks,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to print an image & data on it

Post by sudip »

Dear Swapan,

You can set number of copies to be printed from print preview.

You can also find some helpful codes from \hmg\samples\print folder.

Please check following codes taken from that folder:

Code: Select all

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

	// Measure Units Are Millimeters

	SELECT PRINTER DIALOG TO lSuccess 

	If lSuccess == .T.
		PrintDoc()
		MsgInfo('Print Finished')
	EndIf

Return
With best regards.

Sudip
With best regards,
Sudip
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How to print an image & data on it

Post by swapan »

sudip wrote:Dear Swapan,

You can set number of copies to be printed from print preview.

You can also find some helpful codes from \hmg\samples\print folder.

Please check following codes taken from that folder:

Code: Select all

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

	// Measure Units Are Millimeters

	SELECT PRINTER DIALOG TO lSuccess 

	If lSuccess == .T.
		PrintDoc()
		MsgInfo('Print Finished')
	EndIf

Return
With best regards.

Sudip
Sudip........Thanks for your attention.

I've taken help from hmg\samples\report.advanced1\demo.prg

But its - the no. of copies option is in disabled state in Print Preview in my coding:

DEFINE REPORT Report1
* Report Layout ***********************************************
BEGIN LAYOUT
PAPERSIZE PRINTER_PAPER_A4
ORIENTATION PRINTER_ORIENT_PORTRAIT
END LAYOUT
* Header Band *************************************************
BEGIN HEADER
BANDHEIGHT 25
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to print an image & data on it

Post by sudip »

Hi Swapan,

I have 3 local (virtual) printers installed in my computer. No. of copies is enabled in only one of them (BULLZIP PDF PRINTER).

But I just tested C:\hmg\SAMPLES\PRINT\ImageFromResource\Bmp. When I choose select printer with settings, it gave me option for specifying no. of copies as follows.
printcopy.jpg
printcopy.jpg (31.1 KiB) Viewed 4568 times
So, IMHO, there is a problem in case of preview (if I am not wrong).

With best regards.

Sudip
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: How to print an image & data on it

Post by Roberto Lopez »

swapan wrote:Can I accomplish the job using Report Writer?

I've used this kind of code:

DEFINE REPORT Report1
* Report Layout ***********************************************
BEGIN LAYOUT
PAPERSIZE PRINTER_PAPER_A4
ORIENTATION PRINTER_ORIENT_PORTRAIT
END LAYOUT
* Header Band *************************************************
BEGIN HEADER
BANDHEIGHT 25


Its generating 2 labels in 1 A4 sized sheet, but no. of copies option is disabled, how can I initialize this value and the user can put values for No. of copies??

For Dot Matrix Printer (local) its coming, but for others (network printers) which are deskjets - no. of copies is disabled.... Not sure if the network printers at my office are right now offline or not....
Number of copies will be enabled only when the printer driver supports it, so it depends upon the printer you are using.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply