Java String.format problem

I include the form feed code \f at the end of my format string but is does not form feed to the next page before it starts printing the balance of the document.  Any Ideas
sargent240Asked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
try:

            totaloutputString = String.format("\n%62s      %.2f\f", "Total Due",
                    stmtTotal);
0
 
sargent240Author Commented:
Forgot to include the line of code so here it is

            totaloutputString = String.format("\n%62s      %.2f", "Total Due",
                    stmtTotal, "\f");
0
 
sargent240Author Commented:
Thanks objects:  I moved the \f to follow the %.2f with the same results.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
objectsCommented:
have you checked if the form feed is actually in the string?
Problem may not be with that line of code
0
 
sargent240Author Commented:
I write several invoices into a file and I would like each invoice to be on it's own page of course.  I am printing all the invoices to one file and trying to put a form feed between each one.  I am attaching the code I am using and the line you suggested is toward the bottom. Everything prints properly I am only lacking the form feed.   Hope this helps.
Cheers
 WriteFile.java
0
 
objectsCommented:
are you sure your printer supports form feeds?
0
 
sargent240Author Commented:
I have tried it on a Brother DCP 7020 and an Okidata 320 using the Epson FX emulation.  They both react the same.  We have several hundred Okidata printers in another application and we use the form feed there.  I'm not curtain about the Brother and am not sure how to find the info.
0
 
sargent240Author Commented:
Are we at a lose on this one.
Cheers sargent240
0
 
objectsCommented:
the code is writing the form feed to the string so I'm stuck as to why its not working
0
 
sargent240Author Commented:
Are you aware of the two printers I have tried?
Thanks
0
 
objectsCommented:
i'm not sorry
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.