BarTender调用示例
安装BarTender 软件后,会注册一个COM
然后在项目中添加BarTender COM 引用
BarTender模板中的条码右键属性-数据源类型-嵌入的数据-名称(比如设置为 barcode
public class MyBarTender
{
BarTender.Application btapp;
BarTender.Format btformat; public static string fileName = ConfigurationManager.AppSettings["btw"]; public int Test(string barcode = "1234567890123",int num=1)
{
if (fileName.IsNullOrEmpty())
{
return 0;
}
try
{ btapp = new BarTender.Application();//创建BarTender进程
btformat = btapp.Formats.Open(fileName, false, "");//打开模板
btformat.PrintSetup.NumberSerializedLabels = 1;//设置打印份数
btformat.SetNamedSubStringValue("barcode", barcode);//数据源-嵌入的数据-名称 btformat.PrintSetup.IdenticalCopiesOfLabel = num; //设置同序列打印的份数 btformat.PrintOut(true, false);//第二个参数设置是否跳出打印属性 }
catch (Exception)
{
return -1;
throw;
}
finally
{
btapp.Quit(BarTender.BtSaveOptions.btSaveChanges);//退出时同退退出BarTender进程
}
return 1;
} }
参考:
https://blog.csdn.net/u013934107/article/details/82974647
https://greambwang.blog.csdn.net/article/details/103829785
BarTender调用示例的更多相关文章
- 股票数据调用示例代码php
<!--?php // +---------------------------------------------------------------------- // | JuhePHP ...
- WebService核心文件【server-config.wsdd】详解及调用示例
WebService核心文件[server-config.wsdd]详解及调用示例 作者:Vashon 一.准备工作 导入需要的jar包: 二.配置web.xml 在web工程的web.xml中添加如 ...
- Windows API 调用示例
Ø 简介 本文主要记录 Windows API 的调用示例,因为这项技术并不常用,属于 C# 中比较孤僻或接触底层的技术,并不常用.但是有时候也可以借助他完成一些 C# 本身不能完成的功能,例如:通 ...
- C#中异步调用示例与详解
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServi ...
- HTML 百度地图API调用示例源码
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- C#全能数据库操作类及调用示例
C#全能数据库操作类及调用示例 using System; using System.Data; using System.Data.Common; using System.Configuratio ...
- 利用JavaScriptSOAPClient直接调用webService --完整的前后台配置与调用示例
JavaScriptSoapClient下载地址:https://archive.codeplex.com/?p=javascriptsoapclient JavaScriptSoapClient的D ...
- Web Api跨域访问配置及调用示例
1.Web Api跨域访问配置. 在Web.config中的system.webServer内添加以下代码: <httpProtocol> <customHeaders> &l ...
- 搭建coreseek(sphinx+mmseg3)详细安装配置+php之sphinx扩展安装+php调用示例(转)
一个文档包含了安装.增量备份.扩展.api调用示例,省去了查找大量文章的时间. 搭建coreseek(sphinx+mmseg3)安装 [第一步] 先安装mmseg3 cd /var/install ...
随机推荐
- Photoshop学习笔记(一)
1.Alt+delete,用前景色填充选区 2.按住shift键可以新加选区 3.按住alt键可以减去选区 4.第一次选择选区时按住shift键制作出正方形或者圆形 5.第一次选择选区时按住alt键将 ...
- JAVA判断某个元素是否在某个数组中
先把数组转为list 然后再利用contains方法 String[] strArr = new String[] { "a1", "b1", "c1 ...
- c++读取文件操作和写入文件
在C++中与读取文件和写入文件简单操作有关的类分别有ifstream(文件读入).ofstream(文件写出).fstream (文件读入和写出). 名称 作用 ifstream 文件读入 ofstr ...
- 一个VScode主题网站
分享一个我常用的VScode主题网站 https://vscodethemes.com/dark 它提供了 深色和浅色主题供大家选择 查看主题插件 下载 深色 浅色
- 【LeetCode】42. Trapping Rain Water 接雨水 (C++)
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 暴力求解 保存左右最大值 单调栈 日期 题目地址:ht ...
- 【LeetCode】415. Add Strings 解题报告(Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 [LeetCode] 题目地址:https:/ ...
- 【九度OJ】题目1108:堆栈的使用 解题报告
[九度OJ]题目1108:堆栈的使用 解题报告 标签(空格分隔): 九度OJ http://ac.jobdu.com/problem.php?pid=1108 题目描述: 堆栈是一种基本的数据结构.堆 ...
- 【LeetCode】858. Mirror Reflection 解题报告(Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.c ...
- 【LeetCode】529. Minesweeper 解题报告(Python & C++)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 DFS 日期 题目地址:https://leetco ...
- 【LeetCode】449. Serialize and Deserialize BST 解题报告(Python)
[LeetCode]449. Serialize and Deserialize BST 解题报告(Python) 标签: LeetCode 题目地址:https://leetcode.com/pro ...