Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2010
    Posts
    135
    Thanks
    6
    Thanked 0 Times in 0 Posts

    dompdf how to pass url name

    hear i have the code

    $html ='www.yahoo.com';

    $dompdf = new DOMPDF();
    $dompdf->load_html($html);
    $dompdf->render();
    $dompdf->stream("sample.pdf");

    how do i pass the www.yahoo.com page to to pdf

    hear if i use like above it will give only the text

    plzz help me to do that

  2. #2
    Regular Coder
    Join Date
    Jul 2009
    Location
    Chicago, IL
    Posts
    169
    Thanks
    26
    Thanked 3 Times in 3 Posts
    You have to get the contents of www.yahoo.com, not just pass in the name. Try this:
    PHP Code:
    $html file_get_contents("http://www.yahoo.com");
    $dompdf = new DOMPDF();
    $dompdf->load_html($html);
    $dompdf->render();
    $dompdf->stream("sample.pdf"); 

  3. #3
    Regular Coder
    Join Date
    Jan 2012
    Posts
    134
    Thanks
    0
    Thanked 32 Times in 32 Posts
    Good luck with DOMPDF. It's actually pretty good for what it does, but the last time I used it a year or two ago it had trouble with anything even remotely advanced (like nested tables).

    Using DOMPDF on the yahoo home page will probably give you some really weird results.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •