このページには、ドロップダウン リスト、テキスト入力、日付が含まれています。実行するwkhtmltopdf
と空白で保存されます。これに対する回避策は何でしょうか。そして、どうすればダウンロードのように保存できますか。また、デバッグ結果はどこで確認できますか? ありがとう。
testpdf.php
echo shell_exec("C:\wkhtmltopdf\wkhtmltopdf.exe http://localhost/bigkpo/po/select.php --debug-javascript C:\Taopix\MediaAlbumWeb\webroot\bigkpo\PO\pdf\PO.pdf");
送信時のjquery
$(document).ready(function(){
//disable not 1st select
$("#description").attr("disabled","disabled");
$("#orientation").attr("disabled","disabled");
$("#page").attr("disabled","disabled");
//start----------------------compny
$("select#company").change(function()
{
$("#description").empty();
$("#description").html("<option>wait...</option>");
var id = $("#company option:selected").attr('value');
$.post("./includes/select_type.php", {id:id},
function(data0){
$("#description").removeAttr("disabled");
$("#description").html(data0);
});
});
//start----------------------page
$("#description").change(function()
{
$("#page").empty();
$("#page").html("<option>wait...</option>");
var id2 = $("#description option:selected").attr('value');
$.post("./includes/select_producprice_n_showpage.php", {id2:id2},
function(data1){
$("#page").removeAttr("disabled");
$("#page").html(data1);
//show price---------------------------
$("#productPrice").html(data1);
$("#productPrice2").html(data1);
});
});
//start----------------------orientation
$("#page").change(function()
{
$("#orientation").empty();
$("#orientation").html("<option>wait...</option>");
var id3 = $("#page option:selected").attr('value');
$.post("./includes/select_pageprice_n_showrientation.php", {id3:id3},
function(data2){
$("#orientation").removeAttr("disabled");
$("#orientation").html(data2);
//show insidepagePrice-----------------
$("#insidepagePrice").html(data2);
$("#insidepagePrice2").html(data2);
});
var quantity = $("#qty").val();
var id2 = $("#description option:selected").attr('value');
$.post("./includes/select_total.php", {id2: id2, id3: id3, quantity:quantity},
function(data3){
//computation------------------------------
$("#total").html(data3);
var vat = Math.round(data3 / 1.12 * 0.12).toFixed(2);
$("#vat").html(vat);
$("#sub").html(data3 - vat);
});
});
$("form#select_form").submit(function(){
var side = $("#select_form").html();
console.log(side);
});
});
PHPフォーム
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
<?php include "./includes/select.class.php"; ?>
<div id="wraper">
<div id="header">
</div>
<div id="content">
<div class="contenthead">
<img src="css/img/kdi.jpg" align="left" />
<h1> PURCHASE <br> ORDER </h1>
<table align="right">
<tr>
<td><b> Date: </b> </td> <td> <?php echo date('jS \of F Y'); ?></td>
</tr>
<tr>
<td><b> Ref Number: </b> </td> <td> 271 </td>
</tr>
</table>
</div>
<div class="contentbody">
<form id="select_form" action="testpdf.php" method="post">
<table width="900px">
<thead>
<tr align="left">
<th class="boldlabel" colspan="3"> Company Name:<br>
<select id="company">
<?php echo $opt->ShowCategory(); ?>
</select>
</th>
<th class="boldlabel" colspan="2"> <b> Ship to: </b>
</tr>
<tr>
<td width="110" align="center" class="boldlabel"> QTY </td>
<td width="110" align="center" class="boldlabel"> UOM </td>
<td width="456" align="center" class="boldlabel"> Description </td>
<td width="100" align="center" class="boldlabel"> UNIT PRICE </td>
<td width="100" align="center" class="boldlabel"> TOTAL </td>
</tr>
</thead>
<tbody>
<tr class="top row">
<td width="100" align="center"> <input id="qty" type="text" name="qty" style="width: 50px; text-align:center" align="middle"> </td>
<td align="center"> <select>
<option> PC </option>
<option> BOX</option>
<option> PACK</option>
</select>
</td>
<td align="left"> <select id="description"></select> </td>
<td align="center"> <label id="productPrice"></label> </td>
<td align="center"> <label id="productPrice2"></label> </td>
</tr>
<tr class="side">
<td align="center"> </td>
<td align="center"> </td>
<td align="left"> <select id="page"></select>
</td>
<td align="center"> <label id="insidepagePrice"></label> </td>
<td align="center"> <label id="insidepagePrice2"></label> </td>
</tr>
<tr class="side">
<td align="center"> </td>
<td align="center"> </td>
<td align="left"> <select id="orientation"></select> </td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr class="bottom row">
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tfoot>
<tr>
<td colspan="3"> </td>
<td class="leftfoot" align="left"> <b> subtotal </b></td>
<td class="rightfoot" align="center"> <label id="sub"></label></td>
</tr>
<tr>
<td colspan="3"> </td>
<td class="leftfoot" align="left"><b> 12% VAT </b></td><br />
<td class="rightfoot" align="center"> <label id="vat"> </label> </td>
</tr>
<tr>
<td colspan="3"> </td>
<td class="buttomleftfoot" align="left"> <b> Total Amount </b></td>
<td class="buttomrightfoot" align="center"> <label id="total"> </label> </td>
</tr>
</tfoot>
</tbody>
</table>
<div class="contentfoot">
<table width="900px">
<tr>
<td width="194"> Requested by: <br> <input type="text" name="qty" style="width: 200px; text-decoration:underline" align="middle"> </td>
<td width="476"> </td>
<td width="214"> Noted by: <br> _____________________ </td>
</tr>
<tr>
<td colspan="1"> </td>
<td>
<input type="button" value=" Print ">
<br>
<input type="submit" value=" Submit " name="submit"/>
</td>
</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript" src="./scripts/jquery-1.8.2.js"></script>
<script type="text/javascript" src="scripts/process.js"> </script>
</div>
</body>
</html>