Help with real-life pdf project

Hi everyone, thanks for reading.

In the real world, I have been asked to convert a page with complex tables into a pdf with a repeating header and pagination. The pages are generated with php and I have managed to capture them using obstart and obflush. I’ve even re-created the page in html using this output.

I have a couple apps I have looked at to convert the captured data into a pdf, with repeating headers, but most of them are lacking in instructions.

Additionally, I can’t figure out how to make a print button that runs the script on the current page, then brings up a print/save option for the generated pdf. Everything I see puts the script in the bottom of the page, then runs it when the page loads.

Also, I am thinking that the header, which itself is multiple tables and different on each page, should be converted to an image. The problem is, the last row of the header, is my table headers and needs to line up with the remainder of the page.

Any suggestions, ideas, pointers? Thanks!

Really what I need to know is If use, for example, html2pdf, how do I get the function to run only when the “print” button is pushed. Something like how the javascript print function prints the page.

Can you tell me which challenge would be best? I’ve already don 13 hours:HTML & CSS, Responsive Design with Bootstrap, jQuery and about 90% of Basic JavaScript (I’m up to Generate Random Whole Numbers within a Range.)

It’s not my program, and it’s not something I can put on codepen. It’s written in PHP mostly and Javascript, uses a handful of GitHub applications. It uses a basic javascript to print the page right now, but the client wants a precise layout.

Maybe stack overflow would be a better forum to ask this? Just my thought. I get my specific questions from there while general programming insight here. Maybe It will help to do some comparisons of the apps your talking about, that convert to the pdf. xyzToPDf vs atoBPDF. or reviews in google.
But like randel is saying We cant help much if: 1 you cant post the code your working on, and accurately describe what it is you’re trying to have accomplished. =(
With no context, its very easy to be misunderstood, and have a complete different answer to your original question.