Ask Your Question

can I include a page break in a text file to be imported into .odt

asked 2015-04-08 08:15:39 +0200

JulianB gravatar image

I have a program which generates a simple text file from a database. The text file includes line feeds and tabs as well as printable text. this imports into .odt by cutting and pasting very easily. I want to include some code to generate a page feed in the text file so that when the text file is imported into .odt the page feed is imported.

I have saved an odt document as docbook.xml and can see how a page feed is coded there, and I think my program could generate a suitable docbook file. so if I could import the docbook file somehow that would solve the problem

thanks for any help

edit retag flag offensive close merge delete


Sorry, my answer should have been a comment! To add to it: the file I am generating has a large number of pages, and I don't want to go through it by hand heading page feeds

JulianB gravatar imageJulianB ( 2015-04-08 14:18:45 +0200 )edit

3 Answers

Sort by » oldest newest most voted

answered 2015-04-08 18:17:38 +0200

petermau gravatar image

I am not an expert in imbedding control characters in a text stream. But LibO uses hexadecimal Unicode not decimal US-ASCII values. Is not a Form Feed (U+000C) a hexadecimal number ? (US-ASCII 14) is the decimal value for a form feed. Hexadecimal U+0014 would be a space character. Of course, I may just be confusing the matter...Peter

edit flag offensive delete link more

answered 2015-04-08 10:32:57 +0200

ROSt52 gravatar image

Why don't you simply copy and paste your entire text-file into LibO Writer and do all the formatting in Writer. Simple. Easy. Quick.

If this is not the solution, please explain the reason to enable further help.

edit flag offensive delete link more

answered 2015-04-08 14:15:24 +0200

JulianB gravatar image

No, I'm afraid that won't do. Let us suppose the text file contains a list of names and phone numbers in a single column. some people have more than one phone number, so it looks something like this

Adam Smith

0123 45678

John Doe

0123 456 7654


and so on.

I wish to print out the list in a single column on several pages.

my program counts the number of lines used While it is constructing the list. What I want to do is insert a page feed if the number of lines on the page is greater that or equal to say 60. Then when I import the text file into Writer, the list will be on several pages. I had hoped that a form feed (ASCII 14) embedded in the text file would force Writer to send the text to a new page, but it doesn't.

( the actual file I am constructing is rather more complex, but I think the telephone numbers illustrate what I'm trying to do.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-04-08 08:15:39 +0200

Seen: 414 times

Last updated: Apr 08 '15