Skip to main content

Search

Search

How To Export Picturce?

Comments

9 comments

  • Avatar
    Ian Cummings
    Moderator

    From the BarTender Help system you'll find the below code example.  Obviously you'll need to adapt the below VB.NET example for use in FoxPro.

     

    'Declare a BarTender application variable 
    Dim btApp As BarTender.Application 
    
    'Declare a BarTender document variable 
    Dim btFormat As BarTender.Format 
    
    'Declare a BarTender messages variable 
    Dim msgs 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, "")
    
    'Export document to a print preview 
    Dim res As BarTender.BtPrintResult
    res = btFormat.ExportPrintPreviewToImage("c:\", "Label_%PageNumber%_Preview.jpg", "jpg", BarTender.BtColors.btColors24Bit, 200, 13117215, BarTender.BtSaveOptions.btSaveChanges, true, true, msgs)
    
    'End the BarTender process 
    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges) 
    
    
    0
  • Avatar
    Legacy Poster

    From the BarTender Help system you'll find the below code example.  Obviously you'll need to adapt the below VB.NET example for use in FoxPro.

     

    'Declare a BarTender application variable 
    Dim btApp As BarTender.Application 
    
    'Declare a BarTender document variable 
    Dim btFormat As BarTender.Format 
    
    'Declare a BarTender messages variable 
    Dim msgs 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, "")
    
    'Export document to a print preview 
    Dim res As BarTender.BtPrintResult
    res = btFormat.ExportPrintPreviewToImage("c:\", "Label_%PageNumber%_Preview.jpg", "jpg", BarTender.BtColors.btColors24Bit, 200, 13117215, BarTender.BtSaveOptions.btSaveChanges, true, true, msgs)
    
    'End the BarTender process 
    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges) 
    
    

    Thanks,I have read helps and create the Object on VB ,it can export the picture successful,but I can't expot in VF

    here my code:

    btFormat.ExportPrintPreviewToImage("c:\", "Label_Preview.jpg", "jpg", BarTender.BtColors.btColors24Bit, 200, 13117215, 1, .t., .t., '')
    

     

    it show me a message:Object bartender is not found

    and it can't create the object of "BarTender.BtPrintResult" in VFP

    0
  • Avatar
    Ian Cummings
    Moderator

    Sorry, but I have little to no knowledge of Visual FoxPro.

     

    I trust that the BarTender object is being spawned properly?  Check the Windows task manager for the appearance of a "bartend.exe" process.

     

    The method you're calling requires the Enterprise Automation edition of a sufficient version?  What edition/version of BarTender are you running?

    0
  • Avatar
    Legacy Poster

    Sorry, but I have little to no knowledge of Visual FoxPro.

     

    I trust that the BarTender object is being spawned properly?  Check the Windows task manager for the appearance of a "bartend.exe" process.

     

    The method you're calling requires the Enterprise Automation edition of a sufficient version?  What edition/version of BarTender are you running?

    I'm sure a "bartend.exe" is running and I find it in  the Windows task manager.My BarTender's version is 9.4.

    0
  • Avatar
    Ian Cummings
    Moderator

    Please also confirm the edition your software is activated as.  Is it Basic, Professional, Automation, or  Enterprise Automation?

    0
  • Avatar
    Legacy Poster

    Please also confirm the edition your software is activated as.  Is it Basic, Professional, Automation, or  Enterprise Automation?

    Professional version

    0
  • Avatar
    Fernando Ramos Miracle

    Unfortunately in order to use this method you'll need a higher edition of BarTender (namely the Enterprise Automation edition), with your Professional edition you won't be able to automate BarTender in the required way.

     

    Regards.

    0
  • Avatar
    Legacy Poster

    Unfortunately in order to use this method you'll need a higher edition of BarTender (namely the Enterprise Automation edition), with your Professional edition you won't be able to automate BarTender in the required way.

     

    Regards.

    I have  update bartender's edition,the edition is "Enterprise Automation edition" now,but still can't use the method like ExportPrintPreviewToImage and XMLScript,I think the main problem is bartender is not found in VF9,because I found "bartend.exe" in the system,but I still can't create Object "bartender.XXXXXXXX" .  "BarTender.BtColors.btColors24Bit" attribute could not find also.

    0
  • Avatar
    Fernando Ramos Miracle

    Hello Kaholi,

     

    Have you upgraded your license to Enterprise Automation or are you emulating the latter? If emulating please note that not all functions are available this way, being the ExportPrintPreviewToImage method one of these.

     

    If you have certainly upgraded your license, I would recommend getting in contact directly with our technical support, as this issue is probably better suited to be treated directly by our support team. You'll find their contact details in the below webpage:

    http://www.bartenderbarcodesoftware.com/label-software/technical-support.aspx

     

    *Also remember to attach your new support number (from BarTender's "Help>About..." dialog) when sending the email to our technical support department.

     

    Regards

    0

Please sign in to leave a comment.