Recent

Author Topic: [solved]Printer output - help  (Read 7465 times)

oldfart

  • New Member
  • *
  • Posts: 15
[solved]Printer output - help
« on: October 08, 2021, 10:57:50 pm »
Help please on printer output.
A long story ...
With the help of some people on here, I have nearly completed an application.
Using pfSense to control WiFi access for guests in an apartment complex.
Voucher data is exported from pfSense to a csv file.
My application converts the csv file to a sqlite database.
So that a certificate can be issued for x days and then not re-issued.
The guest is given a voucher with a certificate number, and the number of valid days.
I need to output the data to a label printer.
I have got all the bits working except how to output to printer.
The image shows how the label should look.
There are 3 variables to print alongside an image.
var1, var2 ..
Do I start with a paintbox, or some other method?
Thanks
« Last Edit: October 10, 2021, 10:07:00 pm by oldfart »

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
Re: Printer output - help
« Reply #1 on: October 08, 2021, 11:16:43 pm »
http://scalabium.com/faq/dct0090.htm shows that the simple example is:
Code: Pascal  [Select][+][-]
  1. with Printer do
  2. begin
  3.   BeginDoc;
  4.   Canvas.Draw(X, Y, bmp);
  5.   EndDoc;
  6. end;

korba812

  • Sr. Member
  • ****
  • Posts: 396
Re: Printer output - help
« Reply #2 on: October 08, 2021, 11:20:45 pm »

oldfart

  • New Member
  • *
  • Posts: 15
Re: Printer output - help
« Reply #3 on: October 09, 2021, 01:02:36 am »
First 2 replies won't work, the text on the bitmap doesn't exist until the program has run
That's why I mentioned the variables.

oldfart

  • New Member
  • *
  • Posts: 15
Re: Printer output - help
« Reply #4 on: October 09, 2021, 08:02:49 am »
This image is what the original one looks like,the variables need to be overlaid

oldfart

  • New Member
  • *
  • Posts: 15
Re: Printer output - help
« Reply #5 on: October 09, 2021, 08:08:13 am »
Its very simple, you make a  master bitmap and when you are ready you create another bitmap from the master and then write your text to the secondary bitmap. From there you strecteDraw the secodanry bitmap to the printer canvas.
strecteDraw - ????

loaded

  • Hero Member
  • *****
  • Posts: 825
Re: Printer output - help
« Reply #6 on: October 09, 2021, 09:29:42 am »
8 years ago, I had LDAP authentication done between Pfsense and Zimbra. In memory of those days;
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

oldfart

  • New Member
  • *
  • Posts: 15
Re: Printer output - help
« Reply #7 on: October 09, 2021, 09:37:54 am »
8 years ago, I had LDAP authentication done between Pfsense and Zimbra. In memory of those days;
Thanks - will have a look

korba812

  • Sr. Member
  • ****
  • Posts: 396
Re: Printer output - help
« Reply #8 on: October 09, 2021, 02:28:59 pm »
You can do this in minutes using LazReport. I am attaching a sample project.

oldfart

  • New Member
  • *
  • Posts: 15
Re: Printer output - help
« Reply #9 on: October 09, 2021, 03:13:10 pm »
You can do this in minutes using LazReport. I am attaching a sample project.
Thanks so much, will have a play

error: Unable to find component class TfrDesigner
can't get to the visual form to drop a TfrReport on it
« Last Edit: October 09, 2021, 03:30:57 pm by oldfart »

korba812

  • Sr. Member
  • ****
  • Posts: 396
Re: Printer output - help
« Reply #10 on: October 09, 2021, 03:22:49 pm »
It looks like you don't have lazreport package installed. You can install this package from menu "Package" -> "Install/Uninstall Packages..."

oldfart

  • New Member
  • *
  • Posts: 15
Re: Printer output - help
« Reply #11 on: October 09, 2021, 03:34:26 pm »
It looks like you don't have lazreport package installed. You can install this package from menu "Package" -> "Install/Uninstall Packages..."
thanks .. just playing now

error when building .. project1.lpi(1,2) Fatal: Syntax error, "BEGIN" expected but "<" found
or
when loading from .lpi file, access violation in Lazarus

EDIT
removed Lazarus
Now runs, with Lazreport
Build what you sent .. error the project has no main source file - yet I'm looking at it
« Last Edit: October 09, 2021, 04:21:27 pm by oldfart »

korba812

  • Sr. Member
  • ****
  • Posts: 396
Re: Printer output - help
« Reply #12 on: October 09, 2021, 06:12:26 pm »
Sorry, I'm using a Lazarus trunk. I am sending a revised project.

oldfart

  • New Member
  • *
  • Posts: 15
Re: Printer output - help
« Reply #13 on: October 10, 2021, 10:46:54 am »
Sorry, I'm using a Lazarus trunk. I am sending a revised project.

Thanks for the help, really appreciated!
Got struck somewhere else, hence slow reply.

Will be asking for help if I can't resolve - it involves multiple sqlite SELECT statements
My code (exactly) carries the last result of the first query into all the results of the second query.

oldfart

  • New Member
  • *
  • Posts: 15
Re: Printer output - help
« Reply #14 on: October 10, 2021, 10:06:38 pm »
Thanks for everyone's help
Got it all working

 

TinyPortal © 2005-2018