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

Header/Footer special classes dissapear when i modify style font size #708

Closed
cdespinosaagmx opened this issue Mar 13, 2020 · 3 comments
Closed

Comments

@cdespinosaagmx
Copy link

I'm sending this html to footerTemplate using the jsreport SDK.

var footer = '<span style="font-size:12px">Page&nbsp;<span class="pageNumber"></span>&nbsp;of&nbsp;<span class="totalPages"></span></span>';
my code in controller is it:

image

the result after print is this:

image

if i don't add <span style="font-size:12px"> to my html footerTemplate it shows the class pageNumber but too small in the PDF, when i try to change the font-size in the html footerTemplate the class pageNumber is not appearing in the PDF, any ideas what it could be?

PD: I'm using the last versión Binary. 2.7.1, i changed it today. When i was using the versión 2.6.1 it was not happening, i had the same code and it was working fine.

@pofider pofider transferred this issue from jsreport/jsreport Mar 16, 2020
@pofider pofider transferred this issue from jsreport/jsreport-dotnet Mar 16, 2020
@pofider
Copy link
Contributor

pofider commented Mar 16, 2020

Thank you..
I post here some details we will analyze.
The long store short for you now is to use margin "1.1.cm" instead of "1cm".

With the puppeteer 2.0.0 we use in jsreport 2.7.1 the header template in some cases doesn't display the page number.

I uploaded the test. It doesn't display numbers with jsreport 2.7.1 but works with 2.6.1
Changing the margin from 1cm to 1.1cm helps.
export (72).zip

I am not sure if this has something to do with this announced change or not.
puppeteer/puppeteer#5080
We will need to find out if we should just ignore it or change some viewport settings somehow.

@cdespinosaagmx
Copy link
Author

cdespinosaagmx commented Mar 17, 2020

Chaging the margin from 1cm to 1.1cm is working, thanks for your answer, ill be checking if there is another solution for this.

@bjrmatos
Copy link
Collaborator

we investigated and did not found more information about this, so we assume this is an internal change about how the pdf is measured in chrome. changing the viewport does not have any effect.

this is the new behaviour of recent version of chrome so we can not do anything about it, but in case you find something else let us know.

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

3 participants