Dynamic Page-Numbers and Numbered Table of Contents
Posted: Thu Dec 09, 2004 10:58 pm
Alright. I've started a project for a client of the shop I work for.
The details:
Take a 350 page policy and procedure manual that is currently in a monolithic PDF document, dump it into an SQL database, and set up a PhP driven, intuitive and dynamic web-interface for it.
The requirements:
Joe-idiot manager at this company has to be able to add, delete and edit items in the manual without aditional software or training.
There must be a dynamic menu for browsing, and a search function
There must be support for images, tables, lists, etc. within the policy items
The entire manual MUST be available to be printed at any time, with a full table of contents that includes page numbering.
I can figure out how to do everything except for the page numbered table of contents and numbered pages for print. I mean, it's easy to just get all of the Chapters, sections, and topics from MySQL and print a list of them in order, but I can't figure out a way to get PhP to figure out how to separate information by 8 1/2 * 11 printable pages. If I could do that, numbering and adding the Table of Contents would be a snap.
And there has to be dynamically numbered pages because if Joe-idiot manager goes and adds thirteen paragraphs to section 17-2b, then that would offset the numbering scheme on all of the pages after that, and they would have to be recalculated.
The good news:
Because my shop supports (and made) all of the computers that this business runs on, I know what my target browser / OS / printer setup is, and I have limited access to the server that it's running on, so I can set up custom scripts and programs (linux) if I need to.
Ideas that I had:
finding out how many lines of text are in a page at my specified font, and counting lines (but this is made harder by the presence of images and tables)
XML/XSL-FO page formatting options
The details:
Take a 350 page policy and procedure manual that is currently in a monolithic PDF document, dump it into an SQL database, and set up a PhP driven, intuitive and dynamic web-interface for it.
The requirements:
Joe-idiot manager at this company has to be able to add, delete and edit items in the manual without aditional software or training.
There must be a dynamic menu for browsing, and a search function
There must be support for images, tables, lists, etc. within the policy items
The entire manual MUST be available to be printed at any time, with a full table of contents that includes page numbering.
I can figure out how to do everything except for the page numbered table of contents and numbered pages for print. I mean, it's easy to just get all of the Chapters, sections, and topics from MySQL and print a list of them in order, but I can't figure out a way to get PhP to figure out how to separate information by 8 1/2 * 11 printable pages. If I could do that, numbering and adding the Table of Contents would be a snap.
And there has to be dynamically numbered pages because if Joe-idiot manager goes and adds thirteen paragraphs to section 17-2b, then that would offset the numbering scheme on all of the pages after that, and they would have to be recalculated.
The good news:
Because my shop supports (and made) all of the computers that this business runs on, I know what my target browser / OS / printer setup is, and I have limited access to the server that it's running on, so I can set up custom scripts and programs (linux) if I need to.
Ideas that I had:
finding out how many lines of text are in a page at my specified font, and counting lines (but this is made harder by the presence of images and tables)
XML/XSL-FO page formatting options