Generate Bitmap Preview Of Btw File フォローする

0
Avatar
Legacy Poster

Hello,

 

I have a .net production management system that uses Bartender ActiveX API to modify formats at runtime. This application stores the BTW file contents in the database and when editing a process or product record I show a bitmap preview of the bartender file. Or at least I used to. I was using a C++ library that I created 10 years ago that relied on the "BarTender.ThumbnailExtension" COM object to retrieve the preview image. I actually found most of the source on a Seagull CD or something like that, I can't remember but I know I didn't develop it from scratch.

Development for my application stopped for a few years and during that period we upgraded to Windows 7 and upgraded Bartender editions as well. My BTW preview component no longer works.

 

Before I spend the time to try to debug and fix this component I thought I'd ask if there was another way to generate a raster preview of a BTW file? I've asked Seagull over the years for a supported .Net component/source code and they've never delivered.

 

Anyone here have a trick or method to generate a raster preview of a BTW file?

 

In case anyone is interested I've added the C++ library source code in the attached zip

Regards,

Steve

3 コメント

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

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
コメントアクション Permalink

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
モデレータ
コメントアクション Permalink

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.

ログインしてコメントを残してください。