Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.form_calc .btn_wrap .btn-download').click(function(){
- //Скачать предложение
- var path = '/pdf/pdf.php';
- var formData = $("#form").serialize();
- formData += "&action=download";
- var success = function( response ){
- if (response.status == "OK") {
- /*if (typeof (window.open) == "function") {
- window.open(response.message);
- }
- else {
- window.location.href = response.message;
- }*/
- //alert (response.message;);
- window.location.href = response.message;
- }
- else {
- alert (response.message);
- }
- }
- $.post(path, formData, success, "json");
- return false;
- });
- <?php
- require_once('../dompdf/autoload.inc.php');
- use DompdfDompdf;
- // instantiate and use the dompdf class
- $dompdf = new Dompdf();
- $html = '../index1.html';
- $content = file_get_contents($html);
- $dompdf->loadHtml($content);
- // (Optional) Setup the paper size and orientation
- $dompdf->setPaper('A4', 'landscape');
- // Render the HTML as PDF
- $dompdf->render();
- // Output the generated PDF to Browser
- $dompdf->stream();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement