Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

PDF::API2::Resource::CIDFont::CJKFont

Name PDF::API2::Resource::CIDFont::CJKFont
Version 2.043
Located at /usr/local/share/perl5
File /usr/local/share/perl5/PDF/API2/Resource/CIDFont/CJKFont.pm
Is Core No
Search CPAN for this module PDF::API2::Resource::CIDFont::CJKFont
Documentation PDF::API2::Resource::CIDFont::CJKFont
Module Details PDF::API2::Resource::CIDFont::CJKFont


NAME

PDF::API2::Resource::CIDFont::CJKFont - Deprecated base class for CJK fonts


DESCRIPTION

This is not the CJK font support you are looking for. It dates back to the days when Unicode was young and poorly supported. PDFs created using this class are not portable.

Instead, use a regular TrueType or OpenType font that includes Unicode support and create your PDF normally:

    use PDF::API2;
    use utf8;
    my $pdf = PDF::API2->new();
    my $font = $pdf->font('/path/to/font.ttf');
    my $page = $pdf->page();
    my $content = $page->text();
    $content->font($font, 24);
    # Chinese
    $content->translate(72, 72 * 9);
    $content->text('你好');
    # Japanese
    $content->distance(0, -72);
    $content->text('こんにちは');
    # Korean
    $content->distance(0, -72);
    $content->text('안녕하세요');
    $pdf->save('hello.pdf');

Note: The maintainer is not familiar with CJK languages and has deprecated this class based on his current understanding of Unicode and from reading many bug reports. If you are successfully using the CJK support from this class and think it should not be deprecated, please contact him to discuss.


DEPRECATED METHODS

$font = $class->new($pdf, $cjk_font_name, %options)
Returns a CJK font object. The requested font will not be embedded in the PDF, so it will only be readable on computers that have the font installed.

Available fonts:

Chinese (Traditional)
Ming, Ming-Bold, Ming-Italic, and Ming-BoldItalic

Chinese (Simplified)Chinese (Simplified)
Song, Song-Bold, Song-Italic, and Song-BoldItalic

Korean
MyungJo, MyungJo-Bold, MyungJo-Italic, and MyungJo-BoldItalic

Japanese (Mincho Serif)
KozMin, KozMin-Bold, KozMin-Italic, and KozMin-BoldItalic

Japanese (Gothic Sans Serif)Japanese (Gothic Sans Serif)
KozGo, KozGo-Bold, KozGo-Italic, KozGo-BoldItalic

If the text isn't UTF-8, include an -encode option with the encoding to be used.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024