Link to home
Start Free TrialLog in
Avatar of sargent240
sargent240Flag for United States of America

asked on

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
Avatar of sargent240
Flag of United States of America image


Forgot to include the line of code so here it is

            totaloutputString = String.format("\n%62s      %.2f", "Total Due",
                    stmtTotal, "\f");
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks objects:  I moved the \f to follow the %.2f with the same results.
have you checked if the form feed is actually in the string?
Problem may not be with that line of code
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.
are you sure your printer supports form feeds?
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.
Are we at a lose on this one.
Cheers sargent240
the code is writing the form feed to the string so I'm stuck as to why its not working
Are you aware of the two printers I have tried?
i'm not sorry