React-to-print: Why are there css that don't appear when printed?

Created on 15 May 2019  路  21Comments  路  Source: gregnb/react-to-print

this display in the browser :
Screen Shot 2019-05-15 at 22 21 58

this print view :
Screen Shot 2019-05-15 at 22 23 04

this code:
Screen Shot 2019-05-15 at 22 24 28
Screen Shot 2019-05-15 at 22 24 36

and SASS
Screen Shot 2019-05-15 at 22 24 46

help me thanks

question

All 21 comments

@MatthewHerbst

Can you please ensure that you have the background graphics options turned on when you are in the print preview?
Screen Shot 2019-05-15 at 2 28 00 PM

I have the same problem on Chrome -- with background graphics turned on

What version of the library are you using @ronmaple ?

2.1.2

@ronmaple any chance you could make a codesandbox please replicating the issue?

https://codesandbox.io/embed/compassionate-dew-txilb

I'm trying to center the QRCode component, and the p tag

Thanks @ronmaple! I'll try and take a look tonight but may not be able to get to it until this weekend

@MatthewHerbst hello helpme please

@putrairawan992 can you please make a condesandbox with your code so I can see it live?

@ronmaple your issue is that your text-align: center is on the App class but that class is on the parent of the component being printed, not on the component itself.

@MatthewHerbst Oh! I see, that fixes it. I didn't realise that the print view might have been different from the web view, in terms of how (I'm assuming) the library uses the component to render the view. Thanks!

why can't the background color and image appear

@putrairawan992 I don't see a difference between the codesandbox render and the print output. I'm on Chrome 74. What browser are you using?

Screen Shot 2019-05-15 at 4 43 48 PM
Screen Shot 2019-05-15 at 4 44 03 PM

Screen Shot 2019-05-16 at 08 28 50
Os Macbook

@putrairawan992 is there something in the screen shots I shared that is not being displayed?

i dont show background
Screen Shot 2019-05-16 at 08 28 50

Screen Shot 2019-05-16 at 08 32 46

@putrairawan992 can you show me the options under "More settings"? On mine I can replicate what you see by turning "Background graphics" off. You need to turn that on.

solved brother thanks

Was this page helpful?
0 / 5 - 0 ratings