aspose file tools*
The moose likes Beginning Java and the fly likes printable file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "printable file" Watch "printable file" New topic
Author

printable file

Per Lovdinger
Ranch Hand

Joined: Jun 11, 2001
Posts: 35
Hi,
I want to create a printable file.
What is the correct way to indicate Linefeed, is there
a carriage return needed ? Does the order matter ?

What is the correct way to indicate new page ?
regards Per
Mikael Jonasson
Ranch Hand

Joined: May 16, 2001
Posts: 158
What exactly do you mean by "a printable file"?
/Mike
Per Lovdinger
Ranch Hand

Joined: Jun 11, 2001
Posts: 35
Let's say I want to create a file in such a way that it includes the proper escape-kodes for linefeed and newPage.
So that when I open the file in notepad and print it, it will for example print 6 lines,break for newpage, print next 5 lines and
so on.

I want to write a file to disk and when I open that file in
notepad
Mikael Jonasson
Ranch Hand

Joined: May 16, 2001
Posts: 158
I don't think notepad has support for page-break.
Otherwise, ascii 13 is Carrige Return(CR).
I think 10 is Linefeed and 12 is formfeed, or if it is the other way around.
As far as notpad is concerned, I thing you only need CR for it to work.
Doesn't the \n notation work in Java (I'm mainly used to C++). If so, that will work as new line.
/Mike
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

Count 80 characters.
Go backwards until you find a space.
Insert "\n".
Start over.


Please ignore post, I have no idea what I am talking about.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: printable file