Skip to main content

Search

Search

Print Compatability

Comments

4 comments

  • Avatar
    Canguita

    Hello,

     

    Thank you very much for your post.

     

    A BarTender document can be printed by calling either the Format.Print method or the Format.PrintOut method. The Format.Print method prints a job to a printer's spooler and returns a BtPrintResult enumeration value. It can either return immediately after spooling the print job or wait to return until printing is complete. 
     
    The Format.PrintOut method will simply execute a print job, giving you the option to display a print job status dialog and/or the print dialog. 
     

    Here you will find a sample about how to do it with Format.Print



    'Declare BarTender variables


    Dim btApp As
    BarTender.Application


    Dim btFormat As
    BarTender.Format


    Dim btPrintRtn As BarTender.BtPrintResult


    Dim btMsgs As
    BarTender.Messages = Nothing


     

    'Create a new instance of BarTender


    btApp = New BarTender.Application


     

    'Set the BarTender application visible


    btApp.Visible = True


     

    'Open a BarTender document


    btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")


     

    'Print the document


    btPrintRtn = btFormat.Print("Job1", True, -1, btMsgs)


     

    'Check to see if there are any error
    messages


    Dim msg As
    BarTender.Message


    If (btPrintRtn <>
    BarTender.btPrintResult.btSuccess) Then


    For Each msg In
    btMsgs


    MessageBox.Show(msg.Message)


    Next msg


    End If


     

    'End the BarTender process


    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)  

     

     

     

    You also can use Format.PrintOut

     

    'Declare a BarTender application variable 
     
    Dim btApp As BarTender.Application 
     
     
    'Declare a BarTender document variable 
     
    Dim btFormat As BarTender.Format 
     
     
    'Create a new instance of BarTender 
     
    btApp = New BarTender.Application
     
     
    'Open a BarTender document 
     
    btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")
     
     
    'Print the document 
     
    btFormat.PrintOut(False, False)
     
     
    'End the BarTender process 
     
    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges) 
     
     
    Thanks,
     
    Carlos
    0
  • Avatar
    Legacy Poster

    Thanks! I am trying each of these now...one question though:

     

    For the PrintOut method, any time I try to open a BT document with the code you have, I get a syntax error. It seems to only accept

     

     

    Set       btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")

     

    And then for some reason the line afterwards also pops up a syntax error

     

    btFormat.PrintOut(False, False)
     
    What am I doing wrong?
    0
  • Avatar
    Legacy Poster

    Hey Carlos,

     

    The first method using the format.Print method works for me. Is there a way to do this without opening BT?

     

    Also, I am currently operating with the Trial version. An error box that popped up said that BT was operating in "demonstration mode". Will demonstration mode turn off once I purchase the full version of BT?

     

    Thanks,

     

    Baltad

    0
  • Avatar
    Canguita

    Hello,

     

    If you are integrating BarTender, you will need to open it, there is not other way to do it unless you will be able to create a Windows Service (but we cannot provide you support on it).

     

    Once that you will purchase BarTender the Demonstration mode message will turn off. If you want, you also can contact us in order to get a Trial Extension code:

     

    Contact details

     

    Thanks,

     

    Carlos.

     

    0

Please sign in to leave a comment.