Jump to content

Determining # of Lines in "outputted" HTML / MS Word


Centinul

Recommended Posts

Preface:

 

Currently I'm using PHP to modify an HTML document and once that is finished I pass a header to the user as a Microsoft Word document. Ultimately the user will be using MS Word to view / edit the document.

 

Requirement:

 

On every page > 1 I need to insert the subject line of the letter as the first line on the 2,3,4.... pages.

 

Problem:

 

I don't know how to determine the # of Lines Word would detect the document as. If I knew that I could determine how many pages the document is based on the formatting settings (46 lines per page at the moment). Unfortunately I cannot figure out a way to solve this problem.

 

In short I need to determine how many pages the resulting word document would be so I can insert text at the top of every page > 1.

 

Any thoughts?

 

Thanks.

Paper Size: 8.5x11

Left, Right, Bottom Margins: 1"

Top Margin: 1.4"

Font: Courier New, 12 point.

 

MS Word wraps the text.

 

To be clear, I take an HTML Template and pass it as a MS Word file in the header. The user then opens it up in Word. I need to figure out a way to determine how many pages and then a way of inserting text on the top line of every page after page one.

 

What next?

 

Thanks.

 

Are you running PHP on Windows?  If so, perhaps this package would be of use to you.  I've never used it myself, but it looks like you can create a Word document on-the-fly.  And if you can do that, you may be able to use MS Word's header/footer functionality to generate page numbers without trying to guess where they should go.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.