?
Solved

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

Posted on 2007-03-27
8
Medium Priority
?
2,892 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
Technology Partners: 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 1000 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

Industry Leaders: 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

762 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