Make a PDF of Chinese (Simplified)

Source: Internet
Author: User
Tags pdflib
Some people in Chinese also have trouble with Php_pdf to do Chinese PDF.
Php_pdf Kits Crawl Here, remember to recompile oh. There will be mark on the shelf.
Http://www.pdflib.com/pdflib/index.html

This is the php_pdf with Iconv turn UTF-16 do easy to make Chinese PDF example.
This part does not contain typesetting. My brother is writing another example of typesetting.

?
$pdf = pdf_new ();

pdf_open_file($pdf, "./test.pdf" );
pdf_set_info($pdf, "Creator", iconv( "BIG5","UTF-16","Little Penguin" ));

pdf_begin_page($pdf, 595, 842 );
## bookmark to use UTF-16 Unicode oh
$ Parent = pdf_add_bookmark ( ,  iconv ( "BIG5" "UTF-16" "Traditional Chinese" ));
pdf_add_bookmark($pdf, Iconv("BIG5"), "UTF-16","Font One"),$Parent );
$font = pdf_findfont($pdf, " Mhei-medium ", " eten-b5-h", 0 );
pdf_setfont($pdf, $font );
pdf_show_xy($pdf, "hainan bo Lang dao lang bo South Sea", 50 , 750 );
pdf_end_page($pdf );


pdf_begin_page($pdf, 595, 842 );
pdf_add_bookmark($pdf, Iconv("BIG5 ","UTF-16","font One "),$Parent );
$font = pdf_findfont($pdf, "Msung-light", "Eten-b5-h", 0 );
pdf_setfont($pdf, $font );
pdf_show_xy($pdf, "Bai Sha Ming Moonlight Moon Bright Sand white", 750 );
pdf_end_page($pdf );

pdf_begin_page($pdf, 595, 842 = pdf_add_ Bookmark $pdf ,  iconv "BIG5" Font color= "#007700", "UTF-16" "Simplified Chinese" ));
pdf_add_bookmark($pdf, Iconv("BIG5"), "UTF-16","Font One"),$Parent );
$font = pdf_findfont($pdf, " Stsong-light ", " gbk-euc-h", 0 );
pdf_setfont($pdf, $font );
pdf_show_xy($pdf, "奻 paint 赻 understand 赻 paint 奻", 50 , 750 );
pdf_show_xy($pdf, "笢 刓 Sweet Ling hao 刓 笢", 650 );
pdf_end_page($pdf );

/*
Part of Chinese encoding
{"Gb-euc-h", Cc_simplified_chinese},
{"Gb-euc-v", Cc_simplified_chinese},
{"Gbpc-euc-h", Cc_simplified_chinese},
{"Gbpc-euc-v", Cc_simplified_chinese},
{"Gbk-euc-h", Cc_simplified_chinese},
{"Gbk-euc-v", Cc_simplified_chinese},
{"Unigb-ucs2-h", Cc_simplified_chinese},
{"Unigb-ucs2-v", Cc_simplified_chinese},

{"B5pc-h", Cc_traditional_chinese},
{"B5pc-v", Cc_traditional_chinese},
{"Eten-b5-h", Cc_traditional_chinese},
{"Eten-b5-v", Cc_traditional_chinese},
{"Etenms-b5-h", Cc_traditional_chinese},
{"Etenms-b5-v", Cc_traditional_chinese},
{"Cns-euc-h", Cc_traditional_chinese},
{"Cns-euc-v", Cc_traditional_chinese},
{"Unicns-ucs2-h", Cc_traditional_chinese},
{"Unicns-ucs2-v", Cc_traditional_chinese},
Part of the Chinese character type

"Mhei-medium",
"Msung-light",
"Stsong-light",

*/

Pdf_close($pdf);
pdf_delete($pdf );
?>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.