Need help on save texts format by Textout to a text file 
Author Message
 Need help on save texts format by Textout to a text file

Thanks for your help. Here is my situation:
I have an dialog based application which prints a text report. The
text report will not display on the screen. It is composed and sent to
printer by using MFC function TextOut and passing printer's device
context to TextOut.

What I want to do is to add a functionality of saving the report to a
text file while still keeping the ability to print it directly to
printer. The reason that I don't want to accomplish it by changing
TextOut to fprintf is because during composing the text report, x/y
coordinate is used to decide where the texts will go on the report and
I want to keep it that way.

Could anybody help me on this?



Sat, 13 Dec 2003 04:27:24 GMT  
 Need help on save texts format by Textout to a text file
Is there some reason why you can't just save the data in a file, then load
the file and print? Or do you want this report to be printed by some other
app?

Jase


Quote:
> Thanks for your help. Here is my situation:
> I have an dialog based application which prints a text report. The
> text report will not display on the screen. It is composed and sent to
> printer by using MFC function TextOut and passing printer's device
> context to TextOut.

> What I want to do is to add a functionality of saving the report to a
> text file while still keeping the ability to print it directly to
> printer. The reason that I don't want to accomplish it by changing
> TextOut to fprintf is because during composing the text report, x/y
> coordinate is used to decide where the texts will go on the report and
> I want to keep it that way.

> Could anybody help me on this?



Tue, 16 Dec 2003 11:43:10 GMT  
 Need help on save texts format by Textout to a text file
Hi, Jason,

Thanks for the reply.

The reason I don't want to save it to a file before printing is
because I am doing modication on a existing code base. The original
code is written as writing texts to printer's DC. I'd like to make
minimum changes on the original code. It would be the best if there is
any way I can use to directly save the texts in memory to a file. I
was trying to find something like a text printer with no success.

Wendy

Quote:

> Is there some reason why you can't just save the data in a file, then load
> the file and print? Or do you want this report to be printed by some other
> app?

> Jase



> > Thanks for your help. Here is my situation:
> > I have an dialog based application which prints a text report. The
> > text report will not display on the screen. It is composed and sent to
> > printer by using MFC function TextOut and passing printer's device
> > context to TextOut.

> > What I want to do is to add a functionality of saving the report to a
> > text file while still keeping the ability to print it directly to
> > printer. The reason that I don't want to accomplish it by changing
> > TextOut to fprintf is because during composing the text report, x/y
> > coordinate is used to decide where the texts will go on the report and
> > I want to keep it that way.

> > Could anybody help me on this?



Sat, 20 Dec 2003 23:28:13 GMT  
 Need help on save texts format by Textout to a text file
There are probably various possible solutions for saving "the texts in
memory to a file", but first, perhaps it would help for us to have a bit
more clarification.

Since you know you want to use TextOut or similar function to generate the
report, would the TextOut use the data before it is written to the text file
or would it be used to process the data from the text file that has been
stored in it? In other words, if the TextOut uses the data before the data
is written to the text file, then the output of TextOut would be stored in
the text file. This is probably not what you are trying to do, since it is
essentially not possible.

So I am assuming that the text file will consist of the text as well as
coordinates and other formatting information. Does that sound correct? So
for printing you want to pre-process the data and store a summarized version
of it that consists of just text and related data for printing in the new
format? If so, then you will need a separate function that reads the
generated data and formats it using specialized processing, correct? If so,
then it is probably possible to do that except it is probably also possible
to bypass the temporary file.


Quote:
> Hi, Jason,

> Thanks for the reply.

> The reason I don't want to save it to a file before printing is
> because I am doing modication on a existing code base. The original
> code is written as writing texts to printer's DC. I'd like to make
> minimum changes on the original code. It would be the best if there is
> any way I can use to directly save the texts in memory to a file. I
> was trying to find something like a text printer with no success.

> Wendy




Quote:
> > Is there some reason why you can't just save the data in a file, then
load
> > the file and print? Or do you want this report to be printed by some
other
> > app?

> > Jase



> > > Thanks for your help. Here is my situation:
> > > I have an dialog based application which prints a text report. The
> > > text report will not display on the screen. It is composed and sent to
> > > printer by using MFC function TextOut and passing printer's device
> > > context to TextOut.

> > > What I want to do is to add a functionality of saving the report to a
> > > text file while still keeping the ability to print it directly to
> > > printer. The reason that I don't want to accomplish it by changing
> > > TextOut to fprintf is because during composing the text report, x/y
> > > coordinate is used to decide where the texts will go on the report and
> > > I want to keep it that way.

> > > Could anybody help me on this?



Sun, 21 Dec 2003 01:04:27 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to save a file in Microsoft word format(.doc) or Rich text format

2. can not save help file as rich text format

3. Need help on how to save to a text file

4. Need help on how to save to a text file

5. Format to save text file to be fscanfed?

6. Problem with saving data into a text file in pre-formatted form

7. Excel automation: saving a text file in Excel format

8. Saving a richtext format to a standard text format

9. Save Format Text in RTF file

10. Help Saving Data in Text (ASCII) format

11. saving text from textbox in a text file at client

12. formatting text into a text file

 

 
Powered by phpBB® Forum Software