翻譯|使用教程|編輯:黃竹雯|2019-04-29 13:13:50.000|閱讀 321 次
概述:TFORMer SDK能夠自動(dòng)化打印和導(dǎo)出規(guī)范報(bào)表和標(biāo)簽。介于各版本的編程接口,TFORMer SDK可輕松地集成到您的應(yīng)用程序。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
TFORMer能提供專業(yè)的打印方案,用于大多數(shù)應(yīng)用程序中,如:報(bào)告,標(biāo)簽,郵件,商業(yè)窗體等等。TFORMer能滿足您的標(biāo)簽應(yīng)用程序, 條形碼,和其他報(bào)表以及窗體打印的需要。
TFORMer SDK能夠自動(dòng)化打印和導(dǎo)出規(guī)范報(bào)表和標(biāo)簽。介于各版本的編程接口,TFORMer SDK可輕松地集成到您的應(yīng)用程序。
TFORMer V7.5.20 +
使用標(biāo)準(zhǔn)的EXE安裝程序,可以公開下載。您可以使用特定功能選項(xiàng)選擇要安裝的功能 - 例如,如果您只想安裝.NET組件并以安靜模式運(yùn)行tfprint,請(qǐng)按以下方式運(yùn)行安裝:
TFORMer_SDK.exe / quiet FeatTemplates = 0 FeatCmdLine = 1 FeatDLL = 0 FeatCOM = 0 FeatNET = 1 FeatJava = 0 FeatQuickPrint = 0 FeatDocu = 0
可選:添加參數(shù)InstallFolder = C:\ MyInstallDir以安裝到特定目錄中。您還可以使用InstallVCRuntime = 0禁止安裝VC ++ Runtime
Ps:安裝程序包含32位和64位組件,這些組件根據(jù)目標(biāo)Windows版本自動(dòng)選擇。默認(rèn)情況下,安裝程序從Microsoft下載Visual C ++ Redistributable,如果目標(biāo)系統(tǒng)上不存在,則安裝它。或者,如果沒(méi)有下載連接,您可以將vc_redist.x86.exe和vc_redist.x64.exe(必須是V14.0.24215!)復(fù)制到設(shè)置路徑中。
存儲(chǔ)庫(kù)中的數(shù)據(jù)字段
Repository repository = new Repository ("C:\\Path\\Labels.tfr", false, false); Project project = repository.GetProject("BarcodeLabels"); FormLayout formlayout = project.GetFormLayout("Label1"); // iterate through all DataFields in the project for (DataField field = project.FirstDataField; field != null; field = field.Next) { // check if the DataField is used in the FormLayout DataFieldUsage usage = formlayout.GetDataFieldUsage(field.Name); if (usage == DataFieldUsage.Normal) { // DataField used in the FormLayout } }
TFF中的數(shù)據(jù)字段
// create a Repository-instance using a stand-alone FormLayout Repository repo = new Repository("C:\\Path\\Label.tff", false, false); // retrieves the global project Project project = repo.GlobalProject; // retrieves the one and only FormLayout (stand-alone form) FormLayout formlayout = project.FirstFormLayout; // retrieving the data fields: // use the same code as with the repository (see above)
TFORMer .NET
// record set data source DataSourceRecordSet recordSet = new DataSourceRecordSet(); Record record = new Record(); record.NumberOfCopies = 10; recordSet.Records.Add(record); // CSV, ODBC and other data sources DataSourceCsv dsCsv = new DataSourceCsv(csvFile, ',', '"'); Job printJob = new TECIT.TFORMer.Job(); printJob.DataSource = dsCsv; printJob.RecordCopyDataField = "Copies";
以下示例代碼顯示如何將CSV導(dǎo)入與TFF布局文件中定義的CSV數(shù)據(jù)源一起使用(使用TFORMer Designer)。
TFORMer Java API
// create new job job = new Job(); File file = new File ("c:\\Temp\\MyTemplate.tff"); job.setRepositoryName(file.getAbsolutePath()); // Select the Data Source named 'ImportFromCSV' (defined in the Form Layout) JobDataDataSource jobData = new JobDataDataSource ("ImportFromCSV"); // Set the Data Source Parameter named 'parFilePath' jobData.setParameterValues ("parFilePath", "C:\\Temp\\myImportFile.csv"); // Set the output format: // e.g. EPrinterType.PDFFile, EPrinterType.ZPLFile, EPrinterType.ImagePng job.setPrinterType(EPrinterType.PDFFile); // Output file name job.setOutputName(System.getProperty("user.dir") + File.separator + "MyLabel.PDF"); System.out.println("Printing to " + job.getOutputName()); // Generate Output job.setJobData(jobData); job.print();
PS:使用布局中定義的數(shù)據(jù)源的優(yōu)點(diǎn):數(shù)據(jù)源定義可能包含導(dǎo)入字段和布局字段之間的映射,此外,您還可以添加計(jì)算字段(按需)。可選的數(shù)據(jù)源參數(shù)使您可以靈活地進(jìn)行編程或命令行交互。
這是因?yàn)镈LL讀取了Default Settings“高級(jí)”選項(xiàng)卡中的找到的內(nèi)容,Designer會(huì)Printing Preferences在“常規(guī)”選項(xiàng)卡中讀取找到的內(nèi)容。
解決方案:調(diào)整General Settings打印機(jī)驅(qū)動(dòng)程序,使其具有與Default SettingsTFORMer SDK 相同的值,反之亦然。
以上是TFORMer SDK常見的問(wèn)答,希望對(duì)你有所幫助。如果你在使用的過(guò)程中遇到其他困擾,可在下方評(píng)論區(qū)留言,或進(jìn)入資源列表查看更多教程。
TFORMer SDK現(xiàn)已加入慧都平臺(tái),在線訂購(gòu)享獨(dú)家優(yōu)惠!>>立即咨詢購(gòu)買
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn