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 ...
随机推荐
- git 省略 commit message
每次提交使用 git commit --allow-empty-message --no-edit 也可以设置命令别名 git config --global alias.nocommit " ...
- Git的基本使用(只是基本使用)
git上传 1.克隆到本地 git clone + git项目地址 2.添加文件 git add * 添加所有文件到本地仓库 3.查看状态 git status 4.标记 git commit -m ...
- cmake之错误【Modules/ExternalProject.cmake:3206 (_ep_add_download_command)....】
本文的 cmake的version是3.18 本文环境: Ubuntu 64 + CMAKE 3.18 错误描述 1.错误内容 Modules/ExternalProject.cmake:3206 ( ...
- 【九度OJ】题目1179:阶乘 解题报告
[九度OJ]题目1179:阶乘 解题报告 标签(空格分隔): 九度OJ http://ac.jobdu.com/problem.php?pid=1179 题目描述: 输入n, 求y1=1!+3!+-m ...
- 【LeetCode】406. Queue Reconstruction by Height 解题报告(Python & C++ & Java)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.c ...
- 【LeetCode】938. Range Sum of BST 解题报告(Python & C++)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 递归 日期 题目地址:https://leetcod ...
- 【LeetCode】792. Number of Matching Subsequences 解题报告(Python)
[LeetCode]792. Number of Matching Subsequences 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://f ...
- 【LeetCode】840. Magic Squares In Grid 解题报告(Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 利用河图规律 暴力解法 日期 题目地址:https: ...
- hdu-5568SUM (dp)
sequence2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total S ...
- Codeforces 931C:Laboratory Work(构造)
C. Laboratory Work time limit per test : 1 second memory limit per test : 256 megabytes input : stan ...