justravis Posted January 15, 2013 Share Posted January 15, 2013 I want to be able to enter a url and have it converted to pdf. Since I have a shared hosting account without access to PDFLib or compilers to install software, my options seem limited. FPDF's documentation says it will not serve this purpose. DOMPDF sounds like a good fit, but... <?php require_once("dompdf_config.inc.php"); //include dompdf config $old_limit = ini_set("memory_limit", "16M"); $dompdf = new DOMPDF(); //$dompdf->load_html("YOUR HTML TEXT"); $dompdf->load_html_file('http://www.reuters.com/finance/stocks/companyProfile?rpc=66&symbol=SNE'); $dompdf->set_paper("PAPER SIZE HERE", "ORIENTATION HERE"); $dompdf->render(); $dompdf->stream("dompdf_out.pdf"); exit(0); ?> returned -> http://powerontechnologies.com/_functions/php/pdf/dompdf/TEST.php What do you reccomend?? THANKS! Quote Link to comment https://forums.phpfreaks.com/topic/273216-easiest-html-to-pdf-php-class-or-script-for-shared-hosting-account/ Share on other sites More sharing options...
justravis Posted January 15, 2013 Author Share Posted January 15, 2013 btw, in the DOMPDF config file: define("DOMPDF_ENABLE_REMOTE", true); and in my php ini: allow_url_fopen On On Quote Link to comment https://forums.phpfreaks.com/topic/273216-easiest-html-to-pdf-php-class-or-script-for-shared-hosting-account/#findComment-1405997 Share on other sites More sharing options...
illbzo1 Posted January 18, 2013 Share Posted January 18, 2013 I work at Expected Behavior, and we've developed an HTML to PDF API called DocRaptor. DocRaptor uses Prince XML for PDF generation, and we use HTTP POST requests to create PDFs. You can try this example: http://docraptor.com/documentation/examples_php However, this requires the pecl_http extension, so it may not work for you. In that case, you could try this wrapper one of our users wrote: https://github.com/krewenki/php-docraptor/ DocRaptor is a subscription-based service, but we also have a free plan that allows users to create up to 5 documents per month at no cost. All plans have a 30 day trial, and you can create unlimited test documents. I hope this helps, or at least provides an alternative for you. Quote Link to comment https://forums.phpfreaks.com/topic/273216-easiest-html-to-pdf-php-class-or-script-for-shared-hosting-account/#findComment-1406776 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.