Solved

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

Posted on 2007-03-27
8
2,823 Views
Last Modified: 2013-11-22
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;
0
Comment
Question by:vonburg
  • 4
  • 2
8 Comments
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18800378
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.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18800450
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.
0
 

Author Comment

by:vonburg
ID: 18806715
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.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 26

Expert Comment

by:EddieShipman
ID: 18807136
The documents say that there is a paper size setup in the Printer Options screen.
0
 

Author Comment

by:vonburg
ID: 18807230
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!
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 250 total points
ID: 18807763
Well, I couldn't find anyway to do it programatically. I would suggest either
downloading the SDK I mentioned earlier and using the COMObject to print
or contacting their support group to ask them how to do it using Windows API calls.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21156504
Forced accept.

Computer101
EE Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now