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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merging a txt and a gif file

Status
Not open for further replies.

Walbe

Programmer
Jun 3, 2003
2
IT
I have this problem:

I have a program that creates a report that is a txt format file; moreover I have a gif image that stands for the standard company layout.

I need to merge this two file in 1 file and send it to a pcl printer.

Is there anyone that knows how to do it with a C program?

Thanks in advance
 
So the GIF is like a form, and the text file contains the data for fields on the form?

> Is there anyone that knows how to do it with a C program?
Is this a requirement (do it in C), or just a guess at a solution?

 
No it's not a game quiz, I have this requirement so I'm looking for some useful tips.

As you said, the gif image contains the label and I need to put the information of the txt file in the right position, so that at the end I have just 1 file to print.
 
I think tools are available for this - probably priced much lower than the price of your hard work.

How about doing it this way :

1) Load the image into a tool that can handle the image (MS Word?).
2) Put some text on the canvas - right where you want it. Make sure the text is in a font supported by the printer (This will ensure that the text is sent to the printer as text).
3) Configure the printer driver to print to a file.
4) Print the page (to a file).
Now you should have a PCL datastream that you can analyze. Replace the text within it to the text required.

Will it work ? I don't know, but I can't see why it shouldn't.
You will probably need a PCL reference in order to understand the datastream and modify it correct.

Good luck !

/JOlesen
 
> I need to merge this two file in 1 file and send it to a pcl printer
I don't suppose it does postscript as well does it?

Do you have the gif2ps converter?

Here's what I might try
gif2ps the logo (store in logo.ps)
txt2ps the text file (store in text.ps)

Postscript files are just text files, so it should then be relatively easy to remove the 'endpage' from logo.ps and the 'beginpage' from text.ps and combine the result.
 
if the logo just comes before the txt it may just a simple matter of printing the graphic then print the text.

no merging of files necessary.

tomcruz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top