Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

printable file

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly do you mean by "a printable file"?
/Mike
 
Per Lovdinger
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Count 80 characters.
Go backwards until you find a space.
Insert "\n".
Start over.
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic