Solved

exporting page breaks to word docs

Posted on 2004-08-06
6
218 Views
Last Modified: 2010-04-06
i'm trying to export records from a mysql db using php.  i can export them into word fine, but i'd like a page break between each record.
i've tried using css page-break-after: always, which works when printing from a web page, but not when it's exported to a word doc.
is this possible?
i'm on a linux server with apache, mysql ,and php.
0
Comment
Question by:DarthScott26
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 

Expert Comment

by:stonefeet
ID: 11739797
Best solution I know of is replacing your <br> tags with the new-line character ('\n') omitting the quote-marks, of course. (:
0
 

Author Comment

by:DarthScott26
ID: 11752206
i want a page break, not a line break.  i don't have any <br> tags.  basically there's a part of my website where users can type messages to loved ones and then a site administrator will print them out and mail them.  these letters can be multiple pages, but at the end of each letter, it needs to have a page break and start the next letter on the next page.
i need it to print with letterhead which is why i'm trying to get it to print from word rather than just printing from the browser with page-break-after:always statements.

0
 
LVL 2

Accepted Solution

by:
kmcorbett2 earned 250 total points
ID: 11807144
The control character for "form feed" is ^L (control-L) or code 12. Form feed is sometimes denoted by the control sequence '\f' in program string literals.

Try emitting ^L directly in your HTML output. I don't think you can use a character entity or control sequence.

You don't provide any details on how you are exporting to Word format. If  you were generating RTF, you would probably be using the corresponding formatting sequences. So I'm assuming you are generating HTML and relying on Word's import functionality.

In my testing, opening an HTML file directly in Word, it behaves somewhat inconsistently with regard to converting formatting control characters. Literal control characters for tab, newline, and form feed all "work", and "&#014" generates a newline, but "&#09" and "&#012" have no effect.

/kmc
0
 
LVL 2

Expert Comment

by:kmcorbett2
ID: 11849199
DarthScott26: have you had a chance to try my suggestion? (^L or ASCII code 12)

/kmc
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question