안녕하세요ㅠㅠ pdf 관련..
본문
안녕하세요. 여기 개발자 분들이 많으셔서 질문드려봅니다ㅠㅠ
워드프레스로 홈페이지 개발중인데요..
플러그인중에 db를 pdf로 export 시키는 게 있어요
근데 이게 한글이 모두 물음표로 출력되어 깨지네요..........ㅠ^ㅠ
-----------------------------customizing---------------------------------
<?php
/**
* PDF Included With Form Submission
*
* @author Patrick Rauland
* @version 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="pdf.css" rel="stylesheet" />
</head>
<body>
안녕하세요.
<h1><?php echo $title; ?></h1>
<?php echo $table; ?>
</body>
</html>
----------------------------------------------------------------------
---------------------------export pdf -----------------------------------
<?php
define("NF_PDF_TEMPLATE_URL", apply_filters( 'nf_pdf_template_url', 'ninja-forms-pdf-submissions/' ) );
/**
* Get other templates passing attributes and including the file.
*
* @access public
* @param mixed $template_name
* @param array $args (default: array())
* @param string $template_path (default: '')
* @param string $default_path (default: '')
* @return void
*/
function nf_pdf_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
if ( $args && is_array($args) ) {
extract( $args );
}
$located = nf_pdf_locate_template( $template_name, $template_path, $default_path );
do_action( 'nf_pdf_before_template_part', $template_name, $template_path, $located, $args );
include( $located );
do_action( 'nf_pdf_after_template_part', $template_name, $template_path, $located, $args );
}
/**
* Locate a template and return the path for inclusion.
*
* This is the load order:
*
* yourtheme / $template_path / $template_name
* yourtheme / $template_name
* $default_path / $template_name
*
* @access public
* @param mixed $template_name
* @param string $template_path (default: '')
* @param string $default_path (default: '')
* @return string
*/
function nf_pdf_locate_template( $template_name, $template_path = '', $default_path = '' ) {
// set a default template directory url
if ( ! $template_path ) {
$template_path = NF_PDF_TEMPLATE_URL;
}
if ( ! $default_path ) {
$default_path = NF_PDF_TEMPLATE_URL . '/templates/';
}
// Look within passed path within the theme - this is priority
$template = locate_template(
array(
trailingslashit( $template_path ) . $template_name, $template_name
)
);
// Get default template if we couldn't find anything in the theme
if ( ! $template ) {
$template = $default_path . $template_name;
}
// Return what we found
return apply_filters( 'nf_pdf_locate_template', $template, $template_name, $template_path );
}
--------------------------------------------------------------------
-----------------------css-------------------------------------------
table {
border-collapse: collapse;
font-family: 'Nanum Gothic', sans-serif;
width: 100%;
}
table, th, td {
border: 1px solid black;
padding: .5em;
}
table tr:nth-child(even) {
background-color: #DDD;
}
--------------------------------------------------------------------------------
좀 도와주실 수 있을까요ㅠㅠ
답변을 작성하시기 전에 로그인 해주세요.