Skip to content
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 suggestion: allow adding pagedJs to the print view #276

Open
petermorlion opened this issue Apr 26, 2024 · 2 comments
Open

Feature suggestion: allow adding pagedJs to the print view #276

petermorlion opened this issue Apr 26, 2024 · 2 comments

Comments

@petermorlion
Copy link

I know several/many people have been looking to add page numbers to the print result of the "print" button. For the PDF button, this is possible with the following code:

doc.footer = function (currentPage, pageCount) {
    return [
        { 
            text: translations.page + ' ' + currentPage.toString() + ' ' + translations.of + ' ' + pageCount,
            width: '*',
            alignment: 'center'
        }
    ];
};

For the print button, it's not so simple. However, I believe it would be possible if we could add paged.js to the resulting HTML. I've tried adding it in the customize function, but that doesn't work. I assume because it's added after the page has been opened in the browser already, so the paged.js script isn't executed.

Would you consider allowing such a thing? If so how? An option like addPagedJs may be too hard-coupled to that implementation. Maybe something like customScripts which could be an array of scripts URLs that are added to the print page?

@AllanJard
Copy link
Contributor

It is certainly something that I'll consider. A customScripts option might be a good idea - thanks for the suggestion. I'm not yet sure when I'll be able to get to it, but yes, it is something that it would be nice to see.

@petermorlion
Copy link
Author

I created a pull request in the correct repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants