Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-01-2012, 11:31 AM   PM User | #1
coolumanga
Regular Coder

 
Join Date: Sep 2010
Posts: 106
Thanks: 6
Thanked 0 Times in 0 Posts
coolumanga is an unknown quantity at this point
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
coolumanga is offline   Reply With Quote
Old 02-01-2012, 01:12 PM   PM User | #2
wldrumstcs
Regular Coder

 
Join Date: Jul 2009
Location: Chicago, IL
Posts: 169
Thanks: 26
Thanked 3 Times in 3 Posts
wldrumstcs is an unknown quantity at this point
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"); 
wldrumstcs is offline   Reply With Quote
Old 02-01-2012, 01:18 PM   PM User | #3
KuriosJon
Regular Coder

 
Join Date: Jan 2012
Posts: 134
Thanks: 0
Thanked 32 Times in 32 Posts
KuriosJon is on a distinguished road
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.
KuriosJon is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:47 PM.


Advertisement
Log in to turn off these ads.