Jump to content
Ian Branch

Print a jpeg from a table blob field?

Recommended Posts

Success!!!!

I looked at the contents of the link and there were two things not in our code.

Title & Copies.

I took a punt and added a Title.  "LPrinter.Title := 'Test';"  and it all works.  🙂

I don't know if this is a Win11 thing or a Printer thing, but it is at least resolved.

Thank you all for your contributions and p2k for your patience.

 

Regards,

Ian

Edited by Ian Branch

Share this post


Link to post

Hi Team,

One last aspect.

I don't need to att, but if the Customer asks, where/how would I incorporate a printersetup dialog so they could select the printer and parameters?

 

Regards & TIA,

Ian

Share this post


Link to post
7 hours ago, Ian Branch said:

Hi Team,

One last aspect.

I don't need to att, but if the Customer asks, where/how would I incorporate a printersetup dialog so they could select the printer and parameters?

 

Regards & TIA,

Ian

Launch the dialog before you do anything with the Printer object (i.e. construct your print job). The VCL TPrintDialog and TPrinterSetupDialog components modify the Printer properties according to the user's selection in these dialogs.

Share this post


Link to post
13 hours ago, Ian Branch said:

where/how would I incorporate a printersetup dialog

if you can create yourself "Form" with options more used, and define it in your "LPrinter" object, ex:

	xFrmPrintSetup.ShowModal;
...
	if xFrmPrintSetup.ModalResult = mrOk then
    begin
          LPrinter.BeginDoc;
          if LPrinter.Printing then  // if you use press OK to print!!!
            begin
              LPrinter.Title  := xFrmPrintSetup.LMyTitle;   // from "Printer form result" -> public properties, for example
              LPrinter.Copies := xFrmPrintSetup.LMyCopyNumber;
              // ...
              LPrinter.Canvas.Draw(0, 0, LJPEG);
              LPrinter.EndDoc;
            end;
    end;
    ... xFrmPrintSetup.Free;
...

 

Edited by programmerdelphi2k

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×