Link to home
Start Free TrialLog in
Avatar of vonburg
vonburg

asked on

Setting the paper size in Delphi for a endless label: Brother Printer QL 550

In Delphi I can set the paper size of a label Printer (see code below). But I can't set the paper size in the Brother QL 550 when the Label is endless.

So if I have labels 38mm x 90mm the procedure works well. When I have a endless label I get a error from the Brother Printing Driver saying the the label is endless and not compatible.






***********************************************************************
    Printer.GetPrinter(Device, Driver, Port, DeviceMode);
    OpenPrinter(Device, hPrinter, nil);
    try
      DevMode := PDevMode(GlobalLock(DeviceMode));
      try
        with DevMode^ do
        begin
          dmFields := dmFields or DM_PAPERSIZE;
          dmPaperSize := DMPAPER_USER;
          dmFields := dmFields or DM_PAPERWIDTH;
          dmPaperWidth := 380; //  39 mm : in 1/ 10 mm;
          dmFields := dmFields or DM_PAPERLENGTH;
          dmPaperLength := 900; // 90 mm : in 1/ 10 mm
          ResetDC(Printer.Handle, DevMode^);
        end;
      finally
        GlobalUnlock(DeviceMode);
      end;
    finally
      ClosePrinter(hPrinter);
    end;
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

From what I can see, you set the size in the Printer Options dialog NOT the Print Job Options.
There seems to be a separate setup called Label Format definiiton that you must perform
using the Printer Setup. I'm not sure if the Printer devMode fields will hold that info. It is
more than likely stored in the registry.

What I'd do, if I had one of these printers, is fill the label format definition and then show the
DevMode values for the printer in a test program. Then you shoul dbe able to use the same
values when you want to set them. I'd also check the registry for that info.

Last resort, I'd contact Borther's Support group to see if they have any info. I could not gather
how to do it from the available downloadable docs.
Also, if you get the p-SDK, you can use the COMObject to do the printing and not have
to worry about this as you would create a label template to set the dimensions.
Avatar of vonburg
vonburg

ASKER

If I do not set the size in the Printer Option, I get only a error message.
With all fixed sized Labels, setting the Printer Option works fine!  Same with Dymo LabelWriter 400.

It's not practicable to set the size of a label in the Printer Setup. And there is no setup for that in the Brother Tools.

The documents say that there is a paper size setup in the Printer Options screen.
Avatar of vonburg

ASKER

No I get a screen with the actual size and with the selected size - only two buttons for abort and restart (if the labels where changed)

I don't like to setup any size in a Printer Option screen. It has to be made under program controll (Delphi)

Once again fixed label size work without any Printer Option screen!
ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin