Solved

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

Posted on 2007-03-27
8
2,873 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 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