-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Extra Header / Footer Options #12
Comments
Hi, Thank you for using it. 👍😁 Nice. I also have some useful features in mind, but I'm not sure how many users this package has. I'll be happy to develop it as long as it can help a few people. By the way, I'm open to any PR. |
i use this package sinces many months to generate people presentations : description, photos, admin documents, ... pretty nice rendering |
Thank you @rafipiccolo |
I love this package as it lets me render properly footer and headers due to DPI change. What would be nice to have is the code for header and footer to be on a different html, so it's styles doesn't have to be on the main HTML also. |
I have been searching this last week of some good library to generate pdf using nodejs at backend, the ones I found I get some problems like: performance, problems to render different header/footer, and the ones that solve these problems has a terrible syntax to code. Maybe this one is gonna get what I need. Gonna have a look. |
This feature is a dealbreaker for us, as we just want a header on the first page of the reports we make. We're currently using MPDF and would switch to this if it had that function |
@beeing I'm here with a piece of good news :) I'm working on a new React Lib (like React-pdf) but using puppeteer as the pdf generator in order to support HTML/CSS/JS. And that will resolve all these issues. We can customize the rendering algorithm in any way. So there will be all of the requested features with way more like footer notes, left/right static parts, custom tables, watermarks, etc. I'll link all other requests to this one; hopefully, we will have a beta version in a month or two. |
great news! love the mockups |
Hi, I am considering using this. At this point, we are generating static HTML with react and react-dom/server, then feeding that html into Puppeteer's page, and rendering PDF. I don't even care about the page numbers themselves, I just want a different footer on the first page, and a different on all of the other pages. The current "api" for detecting that is rather... Unappealing. Beside, having a footer like this: <div id="footer">
<div id="footer-innner">
pageNumber: <span className="pageNumber" />
</div>
</div> And included script like this: document.getElementById("footer").setAttribute("onchange", "onChange(this)");
function onChange(element) {
const pageNumberElement = element.getElementsByClassName("pageNumber")[0];
if (pageNumberElement.textContent === "1") {
document.getElementById("footer-innner").style.display = "none";
}
if (pageNumberElement.textContent === "2") {
pageNumberElement.style.color = "red"
}
if (pageNumberElement.textContent === "3") {
pageNumberElement.style.color = "blue";
}
} Just hides "the first" footer, but prints red on the first page, blue on the second page and nothing on the third page. Why can't they just finish the darn CSS Paged Media Module Level 3 thing... As I understand.. You cut then detecting the changes would be sipler - <!-- This would be injected by the puppeteer-report -->
<script>
window.pageNumber = {x};
window.pageCount = {y};
window.title= {z};
</script>
<!-- This would be copy/pasted from our HTML -->
<script>
if (window.pageNumber % 2 === 0) {
document.getElementById("footer").classList.add("odd");
} else {
document.getElementById("footer").classList.add("even");
}
</script> |
@PejmanNik , you were not sure how many people would use this package... So after a few hours of banging my head against puppeteer's built-in pdf rendering, and particularly its issues around header and footer, your library is a lifesaver. It is so simple to use and I don't have to split main body, header and footer into different htmls and somehow hardcode/load them, they all just stay in one document and it's so convenient. Not only that - but works like charm too. Thank you very much for it! To everyone who came here from Puppeteer issues list, definitely give this lib a try! |
@PejmanNik Hi there :) Can you share with us what is the current progress? Maybe we can help somehow with the development? |
@zacol Hi, Thank you, sure. I'll try to clean the project and make it ready for the test, maybe you or anyone else have time to run more tests, and we can finally publish a beta version. So in summary, the project needs a lot of tests + documentation. |
As an update I'm working on documentation now, I have only weekends and can take a while but I had great progress, also published this blog today about it: |
Hi @PejmanNik, I've been quite hyped when you released your article, been following the progress since you announced your project, and I am really interested into helping testing / contributing. Are we gonna see an alpha/beta hit soon? Do you need any help to finalize / document the project? Anyway, thanks for your work, even puppeteer-report is really well made, looking forward to see Jikji in action 😄 |
Hi @ChronicStone, thank you for your interest. ❤ https://github.com/PejmanNik/jikji ah, Thank you very much 🤩 |
@PejmanNik Hi there, Went through the docs, and this really looks amazing ! Some parts of the docs are a bit confuse, but guess I first need to play around with the lib to help improve it. Can't wait to try the beta. when can he expect to start playing with it? |
Fair enough. I think it should be ready by next weekend. |
@ChronicStone or anyone interested, I just publish the entire library and appreciate any feedback. |
Hi, this is a library that I've thought of as an idea earlier. And thanks for sharing such useful library.
Just to make this library more versatile, there's some features that may be useful for more presentable reports.
Hope you can consider the above options for your library.
Thanks in advance.
The text was updated successfully, but these errors were encountered: