Aller au contenu principal

Recherche

Recherche

Missing Data On Label When Printing To Zebra Printers And Hp Printers

Commentaires

4 commentaires

  • Avatar
    Ian Cummings
    Modérateur

    How are you going about printing the labels?  Is this done from within the BarTender application in a manual sense, or is this automated through something like Commander?  If the latter then I suggest you assign more desktop heap memory in the in the BarTender command handler.  Check the Commander trouble shooter for more details: http://forums.seagullscientific.com/index.php?/topic/55-commander-troubleshooting/

    0
  • Avatar
    Legacy Poster

    Hi, thank you for the replay

     

    I'm using .NET SDK for printing a label from C#

    0
  • Avatar
    Legacy Poster

    hello again, this is my code that i'm using in order to print

     

            public static void PrintLabel(string formatName, string printerName, Dictionary<string, string> parameters, int identicalCopiesOfLabel, int numberSerializedLabels, UdiScriptBase parent, bool failIfParamMissing = false)
            {
                // get the label document format from the engine, using the format name and printer name
                LabelFormatDocument document = BTEngine.Documents.Open(formatName, printerName);
    
                // go over all substrings in the label format
                for (int index = 0; index < document.SubStrings.Count; index++)
                {
                    // check if the parameters dictionary 
                    if (parameters.Keys.Contains(document.SubStrings[index].Name))
                    {
                        string value = parameters[document.SubStrings[index].Name];
    
                        if (!String.IsNullOrEmpty(value))
                        {
                            document.SubStrings[index].Value = value;
                        }
                    }
                    else // there is no value in the parameters dictionary for this substring
                    {
                        string value = " ";
                        document.SubStrings[index].Value = value;
    
                        // check if we need to fail this print
                        if (failIfParamMissing)
                        {
                            throw new Exception(String.Format("There is no value in the parameters dictionary for the {0} substring of the label: {1}.", document.SubStrings[index].Name, formatName));
                        }
                    }
                }
    
                // set copies and serialized copies
                document.PrintSetup.IdenticalCopiesOfLabel = identicalCopiesOfLabel;
                document.PrintSetup.NumberOfSerializedLabels = numberSerializedLabels;
    
                Messages btMessages = null;
                bool printResult=true;
    
                if (document.Print(formatName, out btMessages) != Result.Success)
                {
                    printResult = false;
                }
    
                if (printResult == false)
                {
                    throw new Exception("Failed to Print BT!!");
                }
            }
    
    
    0
  • Avatar
    Ian Cummings
    Modérateur

    Is your project building an application or a Windows service.  If the latter then you might be getting the same desktop heap issue as what Commander can suffer from.  Have you tried doing a full uninstall of the printer driver, reboot, and then reinstall of the latest?  Perform a factory default reset on the printer just in case there is a glitch in memory.  Enable printer code recording in the printer driver under the tools tab.  You can then check to see if the printer code we generate is 100% valid or "contains" the missing items.  At least that way we will know better where to look.  What type of label object is it that goes missing, is it a device or graphical item, static or variable, and is it always that object only that is sometimes lost?

    0

Vous devez vous connecter pour laisser un commentaire.