Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,170 members, 7,821,971 topics. Date: Wednesday, 08 May 2024 at 11:03 PM

Webpage To Pdf Conversion# Urgent Help - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Webpage To Pdf Conversion# Urgent Help (1098 Views)

How Can I Export From Webpage To Excel? / Kotlin For Android Developers By Antonio Leiva" Ebook(pdf). / Android App - Jpg To Pdf (2) (3) (4)

(1) (Reply) (Go Down)

Webpage To Pdf Conversion# Urgent Help by Johninyang(m): 7:10pm On Jul 09, 2016
Hello programmers,

I have a webpage am working on but my intention is to have a download button that wheb it's clicked, it will download the webpage in pdf.

Am using php predominantly to develop the portal.

I need urgent help.

God bless
Re: Webpage To Pdf Conversion# Urgent Help by olyjosh(m): 7:16pm On Jul 09, 2016
You can always google something like this. Check the accepted answer here http://stackoverflow.com/questions/28522749/save-web-page-directly-to-pdf-using-js
Re: Webpage To Pdf Conversion# Urgent Help by LordRahl001: 9:38pm On Jul 09, 2016
Try dompdf or mpdf!! U can create a pdf document from Web pages!! Or u can install pdf printers for ur clients, so u just structure ur page so that once they print, its just the same!! U can try foxit, acrobat or Windows 10 print to pdf...
Re: Webpage To Pdf Conversion# Urgent Help by Johninyang(m): 9:50pm On Jul 09, 2016
Thanks guys..
Need more options to try out
Re: Webpage To Pdf Conversion# Urgent Help by 5hyguy: 4:27pm On Jul 10, 2016
take this link, simplehtmltopdf dot com

they have an api that you can implement. all you need do is post the url of your page, be it dynamic or simple page it will convert it to a pdf and drop it for you as a pdf download

look at the below code, all you need is capture the present url of the page which ever way and put in an hidden field, then post it to the part of where u see google within the api.

Infact to carry out a test just run that code and see what happens so you can have a good understanding.

<?php

// convert a web page and store the generated PDF into a $pdf variable
//For the orientation chose Landscape or Portrait at the end of the url
//Set the margin size with the mtop, mleft, mright & mbot value (default 10)
$pdf = file_get_contents('http://api.simplehtmltopdf.com/?link=http://www.google.com&orientation=Portrait&mtop=10&mright=10&mleft=10&mbot=10');

// set HTTP response headers
header("Content-Type: application/pdf"wink;
header("Cache-Control: no-cache"wink;
header("Accept-Ranges: none"wink;
header("Content-Disposition: attachment; filename=\"your_pdf_name.pdf\""wink;

// send the pdf that you create
echo $pdf;

?>
Re: Webpage To Pdf Conversion# Urgent Help by 5hyguy: 4:40pm On Jul 10, 2016
ah bros lolz
LordRahl001:
Try dompdf or mpdf!! U can create a pdf document from Web pages!! Or u can install pdf printers for ur clients, so u just structure ur page so that once they print, its just the same!! U can try foxit, acrobat or Windows 10 print to pdf...
Re: Webpage To Pdf Conversion# Urgent Help by Johninyang(m): 11:04pm On Jul 10, 2016
Thanks @5hyguy.

Will implement tomorrow and get intouch incase I need more help.
I really appreciate bro.

Many thanks
Re: Webpage To Pdf Conversion# Urgent Help by farulz(m): 9:38am On Jul 11, 2016
That's enough. it can be done use google chrome or online tools.. check these page out www.facebook.com/abc9ja

(1) (Reply)

How To Learn Programming In 30minutes / How To Set Up Your Own VPN Using Raspberry Pi / How Do I Develop An Instructional Software For Teaching Database?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.