print text file 
Author Message
 print text file

I created a .txt file with C++ and  I want to print this file in two pages.
Is anyone know the command or ascii code to put inside the .txt file to set
up the endpage code.
Thanks.

Johnny...



Sat, 29 May 2004 06:13:34 GMT  
 print text file

Quote:

> I created a .txt file with C++ and  I want to print this file in two
> pages. Is anyone know the command or ascii code to put inside the .txt
> file to set up the endpage code.

Hi Johnny,
  The form-feed character in ASCII is 0x0C.  Hope that helps!

--
Cheerio!
Brandon Bray                 Progam Manager in the Visual C++ Compiler Team

And now a word from the lawyers: This posting is provided "AS IS" with no
warranties, and confers no rights. You assume all risk for your use. ? 2001
Microsoft Corporation. All rights reserved.



Sat, 29 May 2004 10:12:43 GMT  
 print text file
How can I use this code inside the file. In this way it doesn't work.
Thanks for you help!

   ofstream ofs("start.txt",ios::out);
   if (ofs.good()){
    ofs << endl;
    ofs <<"                                    START LOG PAGE" << endl;
    ofs << endl;
    ofs <<"                                 JOB:" << m_strJob << endl;
    ofs << endl;
    ofs << endl;
    ofs << endl;
    ofs <<"    PRINTER NUMBER    :" << nPrinter << endl;
    ofs << endl;
    ofs << endl;
    ofs << endl;
    ofs <<"    BEGINNING RECORD  :" << nBeginRecord << endl;
    ofs << endl;
    ofs << endl;
    ofs <<"    ENDING RECORD     :" << nEndRecord << endl;
    ofs << endl;
    ofs << endl;
    ofs << endl;
    ofs <<"    RECORDS PER BATCH :" << m_nPrinterQty << endl;
    ofs << endl;
    ofs << 0x0C;  //Doesn't work!!
    ofs << endl;
    ofs <<"    PASS NUMBER       :" << nPasses << endl;
    ofs << endl;
    ofs << endl;
    ofs <<"    PRINTED ON PRINTERS: " << m_nFirstPrinter <<" THRU " <<
m_nLastPrinter << endl;
    ofs << endl;
    ofs << endl;
    ofs <<"    TOTAL OF RECORDS  :" << m_nTotal << endl;
    ofs << endl;
    ofs << endl;
    ofs << endl;
    ofs <<"    FILE NAME   :" << strFileName  << endl;
    ofs << endl;
    ofs << endl;
    ofs << endl;
    ofs <<"    DESCRIPTION :" << m_strDescription  << endl;
    ofs << endl;
    ofs << endl;

    ofs << "**********" <<endl;
   }
   ofs.close();

Quote:
----- Original Message -----

Newsgroups: microsoft.public.dotnet.languages.vc
Sent: Monday, December 10, 2001 9:12 PM
Subject: Re: print text file


> > I created a .txt file with C++ and  I want to print this file in two
> > pages. Is anyone know the command or ascii code to put inside the .txt
> > file to set up the endpage code.

> Hi Johnny,
>   The form-feed character in ASCII is 0x0C.  Hope that helps!

> --
> Cheerio!
> Brandon Bray                 Progam Manager in the Visual C++ Compiler
Team

> And now a word from the lawyers: This posting is provided "AS IS" with no
> warranties, and confers no rights. You assume all risk for your use. ?
2001
> Microsoft Corporation. All rights reserved.




> > I created a .txt file with C++ and  I want to print this file in two
> > pages. Is anyone know the command or ascii code to put inside the .txt
> > file to set up the endpage code.

> Hi Johnny,
>   The form-feed character in ASCII is 0x0C.  Hope that helps!

> --
> Cheerio!
> Brandon Bray                 Progam Manager in the Visual C++ Compiler
Team

> And now a word from the lawyers: This posting is provided "AS IS" with no
> warranties, and confers no rights. You assume all risk for your use. ?
2001
> Microsoft Corporation. All rights reserved.



Sat, 29 May 2004 22:35:25 GMT  
 print text file
Does the following work?

ofs << static_cast<char>(0x0C);

The code below will output it as an int instead of a char.

--
Jonathan Caves
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.

http://www.microsoft.com/info/cpyright.htm.

Quote:
> How can I use this code inside the file. In this way it doesn't work.
> Thanks for you help!

>    ofstream ofs("start.txt",ios::out);
>    if (ofs.good()){
>     ofs << endl;
>     ofs <<"                                    START LOG PAGE" << endl;
>     ofs << endl;
>     ofs <<"                                 JOB:" << m_strJob << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs <<"    PRINTER NUMBER    :" << nPrinter << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs <<"    BEGINNING RECORD  :" << nBeginRecord << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs <<"    ENDING RECORD     :" << nEndRecord << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs <<"    RECORDS PER BATCH :" << m_nPrinterQty << endl;
>     ofs << endl;
>     ofs << 0x0C;  //Doesn't work!!
>     ofs << endl;
>     ofs <<"    PASS NUMBER       :" << nPasses << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs <<"    PRINTED ON PRINTERS: " << m_nFirstPrinter <<" THRU " <<
> m_nLastPrinter << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs <<"    TOTAL OF RECORDS  :" << m_nTotal << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs <<"    FILE NAME   :" << strFileName  << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs << endl;
>     ofs <<"    DESCRIPTION :" << m_strDescription  << endl;
>     ofs << endl;
>     ofs << endl;

>     ofs << "**********" <<endl;
>    }
>    ofs.close();

> ----- Original Message -----

> Newsgroups: microsoft.public.dotnet.languages.vc
> Sent: Monday, December 10, 2001 9:12 PM
> Subject: Re: print text file


> > > I created a .txt file with C++ and  I want to print this file in two
> > > pages. Is anyone know the command or ascii code to put inside the .txt
> > > file to set up the endpage code.

> > Hi Johnny,
> >   The form-feed character in ASCII is 0x0C.  Hope that helps!

> > --
> > Cheerio!
> > Brandon Bray                 Progam Manager in the Visual C++ Compiler
> Team

> > And now a word from the lawyers: This posting is provided "AS IS" with
no
> > warranties, and confers no rights. You assume all risk for your use. ?
> 2001
> > Microsoft Corporation. All rights reserved.




> > > I created a .txt file with C++ and  I want to print this file in two
> > > pages. Is anyone know the command or ascii code to put inside the .txt
> > > file to set up the endpage code.

> > Hi Johnny,
> >   The form-feed character in ASCII is 0x0C.  Hope that helps!

> > --
> > Cheerio!
> > Brandon Bray                 Progam Manager in the Visual C++ Compiler
> Team

> > And now a word from the lawyers: This posting is provided "AS IS" with
no
> > warranties, and confers no rights. You assume all risk for your use. ?
> 2001
> > Microsoft Corporation. All rights reserved.



Sun, 30 May 2004 00:47:24 GMT  
 print text file
Unfortunately it doesn't work. I'm using Visual C++ compiler under windows
98.
Thanks a lot.

Johnny..



Quote:
> Does the following work?

> ofs << static_cast<char>(0x0C);

> The code below will output it as an int instead of a char.

> --
> Jonathan Caves
> Microsoft Corporation

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
> reserved.

> http://www.microsoft.com/info/cpyright.htm.


> > How can I use this code inside the file. In this way it doesn't work.
> > Thanks for you help!

> >    ofstream ofs("start.txt",ios::out);
> >    if (ofs.good()){
> >     ofs << endl;
> >     ofs <<"                                    START LOG PAGE" << endl;
> >     ofs << endl;
> >     ofs <<"                                 JOB:" << m_strJob << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs <<"    PRINTER NUMBER    :" << nPrinter << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs <<"    BEGINNING RECORD  :" << nBeginRecord << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs <<"    ENDING RECORD     :" << nEndRecord << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs <<"    RECORDS PER BATCH :" << m_nPrinterQty << endl;
> >     ofs << endl;
> >     ofs << 0x0C;  //Doesn't work!!
> >     ofs << endl;
> >     ofs <<"    PASS NUMBER       :" << nPasses << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs <<"    PRINTED ON PRINTERS: " << m_nFirstPrinter <<" THRU " <<
> > m_nLastPrinter << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs <<"    TOTAL OF RECORDS  :" << m_nTotal << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs <<"    FILE NAME   :" << strFileName  << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs << endl;
> >     ofs <<"    DESCRIPTION :" << m_strDescription  << endl;
> >     ofs << endl;
> >     ofs << endl;

> >     ofs << "**********" <<endl;
> >    }
> >    ofs.close();

> > ----- Original Message -----

> > Newsgroups: microsoft.public.dotnet.languages.vc
> > Sent: Monday, December 10, 2001 9:12 PM
> > Subject: Re: print text file


> > > > I created a .txt file with C++ and  I want to print this file in two
> > > > pages. Is anyone know the command or ascii code to put inside the
.txt
> > > > file to set up the endpage code.

> > > Hi Johnny,
> > >   The form-feed character in ASCII is 0x0C.  Hope that helps!

> > > --
> > > Cheerio!
> > > Brandon Bray                 Progam Manager in the Visual C++ Compiler
> > Team

> > > And now a word from the lawyers: This posting is provided "AS IS" with
> no
> > > warranties, and confers no rights. You assume all risk for your use. ?
> > 2001
> > > Microsoft Corporation. All rights reserved.




> > > > I created a .txt file with C++ and  I want to print this file in two
> > > > pages. Is anyone know the command or ascii code to put inside the
.txt
> > > > file to set up the endpage code.

> > > Hi Johnny,
> > >   The form-feed character in ASCII is 0x0C.  Hope that helps!

> > > --
> > > Cheerio!
> > > Brandon Bray                 Progam Manager in the Visual C++ Compiler
> > Team

> > > And now a word from the lawyers: This posting is provided "AS IS" with
> no
> > > warranties, and confers no rights. You assume all risk for your use. ?
> > 2001
> > > Microsoft Corporation. All rights reserved.



Sun, 30 May 2004 01:20:09 GMT  
 print text file
Actually now I think about it I doubt that '\f' (0x0C) will work with any
modern printers -You'll need to find out exactly how to force your printer
to skip to the next paper. There is no 100% portable why to do this in the
C++ language.

--
Jonathan Caves
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.

http://www.microsoft.com/info/cpyright.htm.

Quote:
> Unfortunately it doesn't work. I'm using Visual C++ compiler under windows
> 98.
> Thanks a lot.

> Johnny..



> > Does the following work?

> > ofs << static_cast<char>(0x0C);

> > The code below will output it as an int instead of a char.

> > --
> > Jonathan Caves
> > Microsoft Corporation

> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > You assume all risk for your use. ? 2001 Microsoft Corporation. All
rights
> > reserved.

> > http://www.microsoft.com/info/cpyright.htm.


> > > How can I use this code inside the file. In this way it doesn't work.
> > > Thanks for you help!

> > >    ofstream ofs("start.txt",ios::out);
> > >    if (ofs.good()){
> > >     ofs << endl;
> > >     ofs <<"                                    START LOG PAGE" <<
endl;
> > >     ofs << endl;
> > >     ofs <<"                                 JOB:" << m_strJob << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs <<"    PRINTER NUMBER    :" << nPrinter << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs <<"    BEGINNING RECORD  :" << nBeginRecord << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs <<"    ENDING RECORD     :" << nEndRecord << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs <<"    RECORDS PER BATCH :" << m_nPrinterQty << endl;
> > >     ofs << endl;
> > >     ofs << 0x0C;  //Doesn't work!!
> > >     ofs << endl;
> > >     ofs <<"    PASS NUMBER       :" << nPasses << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs <<"    PRINTED ON PRINTERS: " << m_nFirstPrinter <<" THRU " <<
> > > m_nLastPrinter << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs <<"    TOTAL OF RECORDS  :" << m_nTotal << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs <<"    FILE NAME   :" << strFileName  << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs << endl;
> > >     ofs <<"    DESCRIPTION :" << m_strDescription  << endl;
> > >     ofs << endl;
> > >     ofs << endl;

> > >     ofs << "**********" <<endl;
> > >    }
> > >    ofs.close();

> > > ----- Original Message -----

> > > Newsgroups: microsoft.public.dotnet.languages.vc
> > > Sent: Monday, December 10, 2001 9:12 PM
> > > Subject: Re: print text file


> > > > > I created a .txt file with C++ and  I want to print this file in
two
> > > > > pages. Is anyone know the command or ascii code to put inside the
> .txt
> > > > > file to set up the endpage code.

> > > > Hi Johnny,
> > > >   The form-feed character in ASCII is 0x0C.  Hope that helps!

> > > > --
> > > > Cheerio!
> > > > Brandon Bray                 Progam Manager in the Visual C++
Compiler
> > > Team

> > > > And now a word from the lawyers: This posting is provided "AS IS"
with
> > no
> > > > warranties, and confers no rights. You assume all risk for your use.
?
> > > 2001
> > > > Microsoft Corporation. All rights reserved.




> > > > > I created a .txt file with C++ and  I want to print this file in
two
> > > > > pages. Is anyone know the command or ascii code to put inside the
> .txt
> > > > > file to set up the endpage code.

> > > > Hi Johnny,
> > > >   The form-feed character in ASCII is 0x0C.  Hope that helps!

> > > > --
> > > > Cheerio!
> > > > Brandon Bray                 Progam Manager in the Visual C++
Compiler
> > > Team

> > > > And now a word from the lawyers: This posting is provided "AS IS"
with
> > no
> > > > warranties, and confers no rights. You assume all risk for your use.
?
> > > 2001
> > > > Microsoft Corporation. All rights reserved.



Sun, 30 May 2004 02:49:54 GMT  
 print text file
Still not working!! I'm using HP 5si and HP 4si.
Thanks.

Johnny...



Sun, 30 May 2004 03:52:06 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. problem in printing text file

2. Print text File from with in the app

3. Printing text files under Microsoft Visual C++ 5.0

4. Print a text file in text mode to the printer

5. How To Print a Text File in C ?

6. How to print a Rich Text (RTF) file?

7. Print a text file in Visual C

8. Printing a text file

9. any quick way to print a text file?

10. Help: Printing ANSI files in a text window?

11. How to print a Rich Text (RTF) file?

12. Printing A Text File

 

 
Powered by phpBB® Forum Software