Print Multiple "labelformatdocument"s Together フォローする

0
Avatar
Legacy Poster

I am using C# as programming language.  I need to print filled up Bartender templates to the printer using LabelFormatDocument object. 

 

reference: http://www.seagullscientific.com/media/101571/controlling-barcode-label-software-using-c-sharp-and-vbnet-english.pdf

 

This method creating a new print job to the printer for each LabelFormatDocument Print() command.  

 

Is there any way I can send multiple "LabelFormatDocument"s documents to the printer together as a batch so that it creates only one job for multiple LabelFormatDocument print.

 

Current code that we are using:

 

using (Engine bartenderEngine = new Engine())
                {
 
 bartenderEngine.Start();
LabelFormatDocument lblDocument = bartenderEngine.Documents.Open(templatePath);
if (lblDocument != null)
                    {
 
         string printerName = GetPrinterName(printConfigPath);
         lblDocument.PrintSetup.PrinterName = printerName;
 
                     foreach (printobject  in printobjects)
                        {
 
                           // fill up  template with stored value
                           lblDocument.Print(); //This create a new print job for each object in printobjects list
                        }
                 }
          }
 
Expected Result:
 
To print multiple lblDocuments  (of type LabelFormatDocument) in a single print command so that it create only one job to the printer
 
 

 

3 コメント

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

Each call to the Print() method will by definition create a new, spooled print job that is sent to the printer.  Question: Are your print requests for the same label design, just with different variable data per label to print, or is each label to print in your batch also of a different layout from what went before it?  If the former, then you should connect your document to a temporary data file that contains CSV record data for printing one label for each record.  If the latter, then perhaps you might wish to make use of the templates feature in the BarTender "Page Set-up" label design as this allows you to have multiple layouts that can print sequentially and/or conditionally in a single print job from a single print request.

0
Avatar
Legacy Poster
コメントアクション Permalink

Right now its same template with different data but it's a uni-code data (Thai character font), so instead of CSV we are pooling data from Database and loading it into "printobjects" list in them in memory. 

 

But the problem is:- as the Print function is associated with "LabelFormatDocument" it is creating a new job for each print command. Sometimes we are running into memory issue when printing it overseas (it is printing blank after some random prints). So wanted to know is there any way to load all the LabelFormatDocuments in a single print job and fire Print command only one per job instead of per LabelFormatDocument.

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

Assemble your records into a single record set, and then call Print to print them.  Basically as I said in the first response.

サインインしてコメントを残してください。