Recent

Author Topic: Error printing to zebra printer [SOLVED]  (Read 792 times)

magleft

  • Full Member
  • ***
  • Posts: 125
Error printing to zebra printer [SOLVED]
« on: October 05, 2024, 01:07:15 pm »
Hi everyone.
The problem I'm having is that when I try to print to a zebra printer I get the following error:

Invalid floating point operation.
Pres OK to ignore end risk data corruption.
Press Abort to cancel the program.


When I run the app on a computer that doesn't have the zebra printer connected everything works fine.
The code who call the report is here

 
Code: Pascal  [Select][+][-]
  1.       frReport2.LoadFromFile(ExtractFilePath(Application.ExeName)+'Reports\Arithmisi.lrf');
  2.       frReport2.ShowReport  ;
  3.  
       

Note that the printer prints on labels.
Also an older version of the program worked fine.
Does anyone have any idea what the problem is and how it can be fixed?
Thanks in advance for any help..
« Last Edit: October 27, 2024, 05:59:47 pm by magleft »
windows 10 64

Blacha

  • New Member
  • *
  • Posts: 46
Re: Error printing to zebra printer
« Reply #1 on: October 09, 2024, 02:32:50 pm »
Hi.  :)
I suggest the following solution, which works for me (Zebra ZC100) - export the labels to BMP format in LazReport and send this format to Zebra. Although you will have each label in a separate file, then you will not have problems with printing on Zebra.

magleft

  • Full Member
  • ***
  • Posts: 125
Re: Error printing to zebra printer
« Reply #2 on: October 10, 2024, 08:06:34 pm »
First of all I would like to thank you for your reply.
My problem is that each label is different as numbering is printed.
In the previous version of the application the labels were printed normally.
I will try by "teasing" various parameters of the form.
If it works, I'll let you know.
windows 10 64

Blacha

  • New Member
  • *
  • Posts: 46
Re: Error printing to zebra printer
« Reply #3 on: October 10, 2024, 08:58:12 pm »
That's right. My code generates BMP files and each with different content according to the query database content. I had to spend some time determining the report page size. The only thing I need to work on is the resolution of the generated BMPs (only 3dpi), but for the purposes of printing black text, this is completely sufficient. The main question - is the preview of your report displayed correctly?

rvk

  • Hero Member
  • *****
  • Posts: 6480
Re: Error printing to zebra printer
« Reply #4 on: October 10, 2024, 09:04:57 pm »
That's right. My code generates BMP files and each with different content according to the query database content.
Isn't that much slower. Especially if each label is different.
(I once even programmed that for multiple labels, just one label is sent with command to print multiple. Sending each label was much slower, even woth text.)

@magleft Does the report also crash during printing if you print to a normal printer (just to know if it's useful to test this, because I don't have a Zebra myself.)

Blacha

  • New Member
  • *
  • Posts: 46
Re: Error printing to zebra printer
« Reply #5 on: October 10, 2024, 09:17:12 pm »
It may indeed be the case that we are talking about two different problems. My Zebra is used to print RFID cards and each card takes long enough to print that sending the next file in the queue is not a problem.
It may be different with printing labels...

rvk

  • Hero Member
  • *****
  • Posts: 6480
Re: Error printing to zebra printer
« Reply #6 on: October 10, 2024, 09:57:31 pm »
It may indeed be the case that we are talking about two different problems. My Zebra is used to print RFID cards and each card takes long enough to print that sending the next file in the queue is not a problem.
It may be different with printing labels...
Yes, my use-case was printing labels with text for packaging.
And if you need to print hundreds of labels, speed matters  ;)

Also an older version of the program worked fine.
Does anyone have any idea what the problem is and how it can be fixed?
You didn't mention the versions of Lazarus + bitness (32/64bit) and fpReport you are using.

When I run the app on a computer that doesn't have the zebra printer connected everything works fine.
Was printing to a different printer (i.e. Print to PDF) possible on that same machine with a Zebra printer connected to it?

Just tried to print the report to a PDF printer and could print 12000+ pages without any problems in Lazarus trunk 64bit with LazReport 1.0.
So I'm not sure if it has to do with the label-dimensions.

magleft

  • Full Member
  • ***
  • Posts: 125
Re: Error printing to zebra printer
« Reply #7 on: October 13, 2024, 05:17:36 pm »
Hi everyone.
When I run the program on my computer the preview of the form works fine but when run on the computer that the zebra printer is connected to during the preview nothing is displayed.
Even when I set the default printer to "default printer", it still could not be previewed.
windows 10 64

rvk

  • Hero Member
  • *****
  • Posts: 6480
Re: Error printing to zebra printer
« Reply #8 on: October 13, 2024, 07:18:49 pm »
Even when I set the default printer to "default printer", it still could not be previewed.
Then make a test project (including the report itself) for us to test and mention the type of Zebra and driver you have installed.

We can install the driver without needing to actually print.
I've seen printer drivers mess up values but it's strange if it happens without even debugging selecting the Zebra.


magleft

  • Full Member
  • ***
  • Posts: 125
Re: Error printing to zebra printer
« Reply #9 on: October 27, 2024, 05:58:32 pm »
For some reason it "loses" the dimensions of the page. Finally I installed the zebra printer on my calculator, selected the printer in the form, and it worked. I will try to generate the form with code but the mvDownloadEngine library is missing. Does anyone know where I can find her?
windows 10 64

rvk

  • Hero Member
  • *****
  • Posts: 6480
Re: Error printing to zebra printer
« Reply #10 on: October 31, 2024, 10:06:26 am »
For some reason it "loses" the dimensions of the page. Finally I installed the zebra printer on my calculator, selected the printer in the form, and it worked. I will try to generate the form with code but the mvDownloadEngine library is missing. Does anyone know where I can find her?
Not sure what "mvDownloadEngine library" is (might be a type)?

Otherwise try to make a small example project showing the problem (with just the Lazarus libraries).

korba812

  • Sr. Member
  • ****
  • Posts: 428
Re: Error printing to zebra printer [SOLVED]
« Reply #11 on: October 31, 2024, 11:52:45 am »

 

TinyPortal © 2005-2018