테스트 사이트 - 개발 중인 베타 버전입니다

안녕하세요ㅠㅠ pdf 관련.. 채택완료

tich 9년 전 조회 5,308

안녕하세요. 여기 개발자 분들이 많으셔서 질문드려봅니다ㅠㅠ

 

워드프레스로 홈페이지 개발중인데요.. 

 

플러그인중에 db를 pdf로 export 시키는 게 있어요

 

근데 이게 한글이 모두 물음표로 출력되어 깨지네요..........ㅠ^ㅠ

 

 

-----------------------------customizing---------------------------------
/**
 * PDF Included With Form Submission
 *
 * @author Patrick Rauland
 * @version     1.0.0
 */
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
?>
안녕하세요.

----------------------------------------------------------------------
---------------------------export pdf -----------------------------------
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;
}
--------------------------------------------------------------------------------
좀 도와주실 수 있을까요ㅠㅠ
댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트

영문은 정상적으로 나오는지요?

영문은 정상이고 한글만 물음표라면 해당 DB 문자셋을 확인해 보셔야 할거 같으네요. 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

t
tich
9년 전
네 영문은 정상으로 나오구요. 엑셀로 export 하면 한글 안깨지고 잘 출력됩니다.
pdf에서만 오류가 생기네요.. 제가볼땐 pdf로 저장시 pdf 기본 폰트가 영문이라 깨지는 것 같은데.. ㅠㅠ
pdf저장 시 폰트를 지정해주는 코드 같은건 없을까요? ㅜㅜ

댓글을 작성하려면 로그인이 필요합니다.

어떤 플러그인인지 알 수 있을까요? 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

t
tich
9년 전
ninja forms 라는 form edit 프로그램입니다. ㅜㅜ
해당 업체에 물어봤더니 한글은 지원안된다고 따로 개발하라는 답변만 들었습니다 ㅠ,ㅠ

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인