Cant Print Bartender Label From C Shar
Hello there,
I can't print label from c sharp my function source code is:
private void Issue_Labels()
{
using(Seagull.BarTender.Print.Engine btEngine= new Seagull.BarTender.Print.Engine())
{
Seagull.BarTender.Print.LabelFormatDocument btFormat;
btEngine.Start();
// Show BarTender UI for debugging purpose (Set "None" to hide)
//btEngine.Window.VisibleWindows = Seagull.BarTender.Print.VisibleWindows.All;
btFormat = btEngine.Documents.Open(Program.LabelPath);
// Print
btFormat.Print();
Thread.Sleep(164);
btEngine.Stop();
}
}
I got an error when i called this function, check please the error1.txt file.
I also changed the app config file to:
</configSection>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
0
-
It looks like BarTender is unable to open the document as the file cannot be found:
Make sure you prefix the path/filename with the @ string literal escape character.
Example: LabelFormatDocument btFormat = btEngine.Documents.Open(@"c:\MyLabel.btw");
I would guess this is why the file is not being found.
0 -
Thanks a lot,
Now it is printing with this code:
using (Seagull.BarTender.Print.Engine btEngine = new Seagull.BarTender.Print.Engine()){Seagull.BarTender.Print.LabelFormatDocument btFormat;btEngine.Start();// Show BarTender UI for debugging purpose (Set "None" to hide)//btEngine.Window.VisibleWindows = Seagull.BarTender.Print.VisibleWindows.All;btFormat = btEngine.Documents.Open(Program.LabelPath);// PrintbtFormat.Print();Thread.Sleep(164);btEngine.Stop();}But it's print 2 labels, I need only one label.Can I set the number of copies ?Best RegardsHamzi0 -
You'd want to set the IndenticalCopiesOfLabel property, otherwise it inherits whatever is set in the document file itself.
// Set the number of copies. btFormat.PrintSetup.IdenticalCopiesOfLabel = 1;
0 -
Thanks a lot for your fat answer, I will check this.
Best regards
Hamzi.
0
Please sign in to leave a comment.
Comments
4 comments