render to pdf with page breaks?

1.999 weergaven
Naar het eerste ongelezen bericht

Greg Lappen

ongelezen,
21 apr 2012, 20:09:2921-04-2012
aan phan...@googlegroups.com
Hello,

First off, phantomjs rocks.  I'm looking for a solution for converting web pages to pdf, but I can imagine all kinds of interesting uses for this!  Anyway, here's my real question:

Has anyone had success using phantomjs to render pages to pdf with page breaks?  In other words,I'd like to use the standard css page-break-before, page-break-after, page-break-inside rules to get some control over where pages are breaking - right now it seems that phantomjs ignores them.  Is this a know issue, or is it expected to generally work?

Thanks again,

Greg

Milian Wolff

ongelezen,
25 apr 2012, 08:08:2725-04-2012
aan phan...@googlegroups.com
hey there,

I've spent some time on improving these things and afaik it should "just work" if you use PhantomJS 1.5. Note though that WebKit only supports these css attributes for block elements...

If something is not working, please provide a proper example so one can take a look at it and try to fix the issues.

Rp k

ongelezen,
26 jun 2014, 16:14:1726-06-2014
aan phan...@googlegroups.com
Hi Greg,
Were you able to achieve this? I'm unable to get the page-break css rules work with phantomjs 1.9.7.
Please let me know; would be of great help.

Greg Lappen

ongelezen,
26 jun 2014, 16:37:3426-06-2014
aan phan...@googlegroups.com
We had to abandon phantomjs and use wkhtmltopdf. That was 2 years
ago and I haven't tried it since....sorry I couldn't be more helpful!
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "phantomjs" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/phantomjs/7d22wP_Ho8Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> phantomjs+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/phantomjs.
> For more options, visit https://groups.google.com/d/optout.

Rp k

ongelezen,
26 jun 2014, 16:48:4626-06-2014
aan phan...@googlegroups.com
Np, Greg. It's a bit late in the game even to think of options other than phantomjs, so I'll keep looking for answers. Thanks for your help.

Darren Cook

ongelezen,
26 jun 2014, 17:19:0426-06-2014
aan phan...@googlegroups.com
> Np, Greg. It's a bit late in the game even to think of options other than
> phantomjs, so I'll keep looking for answers. Thanks for your help.

I noticed SlimerJS just fixed a PDF-related bug; I've not used it
myself, but I assume that means making PDFs works.

It might also be worth trying some tests with PhantomJS 2.0
(https://github.com/ariya/phantomjs/wiki/PhantomJS-2) as this may simply
be an old bug (or missing feature) that has now been fixed (added).

Darren





--
Darren Cook, Software Researcher/Developer
My new book: Data Push Apps with HTML5 SSE
Published by O'Reilly: (ask me for a discount code!)
http://shop.oreilly.com/product/0636920030928.do
Also on Amazon and at all good booksellers!

Rp k

ongelezen,
27 jun 2014, 11:15:1027-06-2014
aan phan...@googlegroups.com


On Thursday, 26 June 2014 17:19:04 UTC-4, Darren Cook wrote:
> Np, Greg. It's a bit late in the game even to think of options other than
> phantomjs, so I'll keep looking for answers. Thanks for your help.

I noticed SlimerJS just fixed a PDF-related bug; I've not used it
myself, but I assume that means making PDFs works.

It might also be worth trying some tests with PhantomJS 2.0
(https://github.com/ariya/phantomjs/wiki/PhantomJS-2) as this may simply
be an old bug (or missing feature) that has now been fixed (added).

Darren

Thanks for looking into it Darren. I relied on the phantomjs 2.0 binaries built by another dev at: https://groups.google.com/forum/#!topic/phantomjs/cgTH-jqCSGg/discussion. Phantom would simply hang when I use the windows version of the binaries from above link. I didn't attempt building it myself as it took me quite a bit of time to build phantom.exe from the trunk; hence, it would take even longer to build phantom2 as it uses additional 3rd party tools.

kannan Fa

ongelezen,
25 apr 2016, 01:48:4725-04-2016
aan phantomjs
Is there any solution for page break work in phantom js please let me know ...
Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten