1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Print a webpage server side

Discussion in 'General PHP and MySQL Discussions' started by allewreK, Jan 15, 2014.

  1. allewreK

    allewreK Active Member


    This question i not related to xenforo.

    Is there a way to print a webpage (as firefox or chrome does), in pdf, but server side ? Because browsers are printing a page exactly as it's shown up to the visitor, with complex CSS stuff etc...

    Best regards.
  2. Jeremy

    Jeremy Well-Known Member

  3. Vincent Gabriel

    Vincent Gabriel Active Member

    You can grab the page source. save it as html then user wkhtmltopdf to save the contents as PDF.

    allewreK and gfc like this.
  4. allewreK

    allewreK Active Member

    That is what I was thinking about, but the problem with that kind of class is that it's not rendering complex CSS, only normals stuffs like borders and backgrounds.
  5. Vincent Gabriel

    Vincent Gabriel Active Member

    You'll have to ask in the google groups about that but i've used it to generate a 14-18 pages PDF's with, styles, css, google maps and images. it worked great.
  6. allewreK

    allewreK Active Member

    Oh maybe I tried the wrong class a while a ago, I will give a touch to that one, thanks you very much :)

Share This Page