Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using a image from file system

Status
Not open for further replies.

maurosilva

Programmer
Mar 21, 2010
5
0
0
BR
Hi,

Could anyone of you please tell me if there is a command in PCL to load an image from my file system?

I know that other options to add an image is possible (converting a JPG to PCL for example), but my in my case the image (in an appropriated format) is ready to use.

Thanks!

mauro
 
First, the only appropriate format is a PCL image.

As such, there is no PCL command to download an image to your printer. It is the responsibility of the application to provide a timely download of the image when needed.

Very often it is advantageous to configure the images as macrod and direct them all to the printer at the head of the job, and then call them as needed using the appropriate macro ID number later when needed.

What OS are you using? We really ne more information as to what you are after.

Jim Asman
 
Actually, I'm trying to send for printer an image available on the file system. In general, the function of my system has three parameters: the first one is the fileName; and the second and third, the PCLCommand. The first parameter, for example, can be typed by user.

Something like that:

string printImage(string FileName, string PCLCommandBegin, string PCLCommandEnd)
{
...
return (PCLCommandBegin + FileName + PCLCommandEnd);
}

For example:
<esc>&l#S", where # could be a full path to access an image file (C:\myFolder\myImage.bmp)

I've read something related to macro, but I didn't find the correct command to add the file (name and path). There are commands to define position, resolution, raster image, text, etc, but I'm not sure if there is a command to insert an file name. Could you show me any example about it?

Windows XP is my OS.

Thanks
mauro
 
>> ... I'm not sure if there is a command to insert an
>> file name ...

There is no such command in PCL.

If the 'file' you want to use is already a PCL5 raster image format, then you just need to copy the contents of the specified file to the target printer port.

Note that if the image file DOES contain a PCL5 raster image, then you will only be able to 'view' it on screen if you have a suitable PCL5 parser/interpreter (e.g. SwiftView, PCLWorks, etc.)

But if the image is not in PCL raster image format (e.g. it is a .BMP, or .PNG, or .TIFF, or .JPG file) then you'll have to convert it first to PCL5 raster image format - this is not a trivial exercise, although there are probably quite a few library routines available to assist in this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top