Coder Social home page Coder Social logo

Comments (9)

crabbly avatar crabbly commented on May 20, 2024

@EricLease Cool. I'll take a look at it as soon as I have a chance.

from print.js.

crabbly avatar crabbly commented on May 20, 2024

Hey @EricLease , I had never take the time to look into this untill now. You branch looks great. I do however, want to keep using es6 let for variables.
I know it is been a while, but if you could do a pull request for the page-break support, that would be great. Thank you.

from print.js.

crabbly avatar crabbly commented on May 20, 2024

I added support for page break with commit 163548d
Thank you @EricLease

from print.js.

chocomail avatar chocomail commented on May 20, 2024

so i already read this and try to add css page-break as the same as @EricLease
but, it seems like im doing it wrong,
the html that i write is like this

<div id="print>
 <table>**content**</table>
 <div class="page-break"></div>
 <table>**content2**</table>
</div>

but when i print it, it doesnt do the page-break.
am i doing it right?

from print.js.

crabbly avatar crabbly commented on May 20, 2024

Hey @chocomail , did you create the class page-break in your project?

from print.js.

chocomail avatar chocomail commented on May 20, 2024

uhm
do you mean create the class page-break is create the css containing page-break?
i tried both, (create css page-break and not create), and not one of them is working.
am i already doing it right for the html?
if so, im afraid i must my other component in my project.
im adding codepen.
what i hope to happen is, the table no.2 is in another page.
https://codepen.io/anon/pen/qKOXNR

okay, as when im using the codepen, i found the one making it not working the page-break is targetStyles. Am i doing it wrong?

printJS({
	maxWidth: 756,
	targetStyles: [
		"border",
		"display",
		"filter",
		"height",
		"left",
		"padding",
		"position",
		"text-align",
		"text-decoration",
		"top",
		"width",
		"font",
		"vertical-align",
		"page-break"
	],
	type: "html",
	printable: "print"
})

okay i found it again, must insert

page-break-after
page-break-inside
page-break-before
break-after
break-inside
break-before

inside targetStyles, strangely enough, in my computer when i use
targetStyles: ['*']
is not working.
thank you

from print.js.

crabbly avatar crabbly commented on May 20, 2024

Glad you figured it out.
You can just pass break and it should works as well:
https://codepen.io/anon/pen/ZRbMMW

I'm not sure why targetStyles: ['*'] is not working. It must be a bug. I'll check on that.
Thank you.

from print.js.

crabbly avatar crabbly commented on May 20, 2024

I found the issue with targetStyles: ['*'] not responding. It has been fixed and pushed to npm.

from print.js.

thomazette avatar thomazette commented on May 20, 2024

Hey @crabbly ,
Your example on https://codepen.io/anon/pen/ZRbMMW
not working, maybe same update from Chrome?

from print.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.