文本文件可以有图像吗? [英] Can a text file have an image?

查看:46
本文介绍了文本文件可以有图像吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现有功能是我们通过以下方式将数据写入文本文件.

The existing functionality is we write data to the text file in the below way.

var 
outfile : Textfile;
begin
  assignfile(outfile,apath);
  Rewrite(Outfile);
  writeln(outfile,'sample');
end;

我们有逻辑来对齐文本文件中的内容,然后将文本文件加载到报表查看器中,在该报表查看器中,用户将能够将文本文件打印为打印输出或PDF.

We have the logic to align the contents in the text file and then load the text file into a report viewer, where the user will be able to print the text file as a printout or PDF.

要求是我们需要将1D和2D条形码图像作为此文本文件的一部分进行打印.有什么方法可以将条形码图像粘贴到文本文件中?我尝试将图像转换成流,然后再次将流保存在文本文件中,但是它返回了我的垃圾数据(不是图像).还有其他选择吗?

The requirement is that we have 1D and 2D bar code images that need to be printed as part of this text file. Is there any way that I can paste the bar code images in the text file? I tried converting the image in to stream and then again saving the stream in the textfile but it returns me junk data (not image). Is there any other option?

推荐答案

Motif/X

The Motif/X UIL specification includes a way to encode an "ICON" into ASCII files in a more-or-less human-readable way.

有一种旧的 X位图格式(XBM),该格式应该可以执行您想要的操作(自条码为单色).XBM文件本质上是C #include .

There's the old X Bitmap format (XBM), which should do what you want (since barcodes are monochrome). XBM files are essentially C #includes.

这些都需要特殊的读者.如果文本"文件本身必须是可直接扫描的,则您要么需要找到一种使用 ASCII的方法艺术,或者您不再谈论文本文件.

Those would all require special readers though. If the "text" file itself has to be directly scannable, you either need to find a way to do it with ASCII Art, or you aren't talking text file anymore.

嗯.让我印象深刻的另一种可能性是,您可以尝试将Postscript命令嵌入到打印机中,以将打印机上的条形码生成到您的文本文件中.但是,您必须欺骗打印机,使其从一个假定的文本"文件中接受并执行它们.您要入侵您的打印机吗?:-)

Hmmm. Another possibility that strikes me is that you could try to embed postscript commands to generate the barcodes on the printer into your text file. You'd have to trick your printer into accepting and executing them from a supposed "text" file though. You up to hacking your printer? :-)

这篇关于文本文件可以有图像吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆