0
다음 코드가 있습니다. Chome과 Firefox에서는 PDF를 잘 생성하지만 Internet Explorer에서는 생성을 거부합니다. PDF 파일을 파일로 작성하고 적절한 PDF 헤더를 보낸 다음 브라우저의 파일 내용을 반향 출력하려고 시도했지만 Chrome과 Firefox에서는 다시 작동하지만 IE에서는 렌더링을 거부합니다.Internet Explorer에서 mPDF가 생성되지 않습니다.
무엇이 누락 되었습니까?
<?php
require_once('wp-blog-header.php');
require_once('mpdf/mpdf.php');
$pid = $_GET['product'];
$args = array(
'p' => $pid,
'post_type' => 'any');
$query = new WP_Query($args);
if (!$query->have_posts()) {
die("Invalid Product");
}
if (has_post_thumbnail($_GET['product'])) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id($pid, 'single-post-thumbnail'));
$image = $image[0];
} else {
$image = "<h1>NO IMAGE</h1>";
}
$query->the_post();
$mpdf = new mPDF();
ob_start();
?>
<html>
<head>
<title>Tear Sheet</title>
<style>
body, html {
font-size: 20px;
color: #777777;
margin: 0px;
padding: 0px;
font-family: "Georgia";
}
#main-content {
background: url('IP-Tearsheet-Background.jpg');
/*width: 1530px;
height: 1980px;*/
width: 100%;
height: 100%;
background-size:100% 100%;
display:block;
position: absolute;
left:0px;
top:0px;
}
/*.attachment-full.wp-post-image {
display:block;
//margin:auto;
position:absolute;
top:120px;
left:50%;
margin-left:-100px;
padding-top:350px;
max-width: 100px;
width: 100px !important;
}
img {
width: 100px !important;
}*/
#table-container {
display:table;
margin-top: 580px;
position:relative;
top:100px;
}
#style-number {
display: table-cell;
width: 563px;
}
#width {
display: table-cell;
width: 247px;
}
#depth {
display: table-cell;
width: 238px;
}
#height {
width: 30px;
display: table-cell;
width: 190px;
}
#details {
margin-top: 100px;
margin-left: 80px;
font-size:20px;
}
</style>
</head>
<body>
<div id="main-content">
<br><br><br><br><br>
<table border=0 cellspacing=0 cellpadding=0>
<tr><td width="190px"> </td><td style="text-align: middle;"><?php the_post_thumbnail(array(400, 400)); ?></td></tr>
</table>
<br><br><br><br><br>
<?php //echo '<img src="' . get_the_post_thumbnail('full') . '" class="product-image">'; ?>
<table border=0 cellspacing=0 cellpadding=0 style="margin-left: 87px;margin-top:70px">
<tr>
<td style="width: 345px;"><?php echo get_post_meta($pid, '_sku', true); ?></td>
<td style="width: 150px;"><?php echo get_post_meta($pid, '_width', true); ?> in.</td>
<td style="width: 150px;"><?php echo get_post_meta($pid, '_length', true); ?> in.</td>
<td style="width: 190px;"><?php echo get_post_meta($pid, '_height', true); ?> in.</td>
</tr>
</table>
<br>
<!-- <div id="table-container">
<div id="style-number">
<?php echo get_post_meta($pid, '_sku', true); ?> in.
</div>
<div id="width">
<?php echo get_post_meta($pid, '_width', true); ?> in.
</div>
<div id="depth">
<?php echo get_post_meta($pid, '_length', true); ?> in.
</div>
<div id="height">
<?php echo get_post_meta($pid, '_height', true); ?> in.
</div>
</div> -->
<div id="details">
Details
<?php the_content(); ?>
</div>
</div>
</body>
</html>
<?php
$output = ob_get_clean();
$mpdf->WriteHTML($output);
$mpdf->Output();
exit;
?>