Zum Hauptinhalt gehen

Suche

Suche

Generate Bitmap Preview Of Btw File

Kommentare

3 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    Recent versions of BarTender support an ExportPrintPreviewToImage() method in the .NET SDK and the COM API, either of which you can call to generate raster images of your label with variable data.  Here is the .NET example:

     

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

    Thank you for the great example, Ian. I have just installed Bartender 10.1 (our most recent licensed version) on a fresh workstation. I found the "BarTender .Net SDK\SDK Documentation" file but I can't find many of the objects you reference in your code sample. I also tried searching for ExportPrintPreviewToImage and that came up with no results.

     

    Is our version too old? Am I looking at the incorrect documentation? 

    0
  • Avatar
    Ian Cummings
    Moderator

    Note that this is an Enterprise Automation edition feature only.  Please take a look at the full reference for this in the BarTender Help system as this will give you all the assistance you need.

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.