Troubleshooting CMYK and International Language PDFs

This article was translated from English: Does it need improvement?
Translated
View the article in English

IronPDFは、Unicodeがサポートするすべての国際言語、および混合言語文書でのHTML-To-PDFをサポートしています。

考慮すべき2つのポイントは<強>フォント</強>と<強>入力エンコーディング</強>であり、詳細はこのFAQページで説明されています: https://ironpdf.com/how-to/utf-8/

文字セットをサポートするフォントがサーバーにインストールされている必要があります。

ドキュメントの入力エンコーディングを指定して正しくレンダリングする必要があるかもしれません。

これを次の方法で達成できます:

  1. HTML「Meta Charset」タグを追加する

    この方法では、HTML <head>セクション内に<meta>タグを含めて文字セットを定義します。 これにより、HTMLドキュメントが正しい文字を使用することが保証されます。

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Your Document Title</title>
    </head>
    <body>
        <p>Your document content goes here...</p>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Your Document Title</title>
    </head>
    <body>
        <p>Your document content goes here...</p>
    </body>
    </html>
    HTML

    <meta charset="UTF-8">タグは、任意のUnicode文字を処理できるUTF-8文字エンコーディングを指定します。

  2. IronPDF HTMLからPDFへのコンバーターのinputEncodingプロパティを設定する

    IronPDFコンバーターのinputEncodingプロパティを設定することで、変換プロセス中に文字エンコーディングを指定できます。

    これはC#コード内で以下のように行うことができます:

    using IronPdf;
    
    class Program
    {
        static void Main()
        {
            // Instantiate a renderer
            var Renderer = new HtmlToPdf
            {
                // Set the input encoding to UTF-8
                RenderOptions = new ChromePdfRendererOptions
                {
                    InputEncoding = "UTF-8"
                }
            };
    
            // Convert HTML to PDF
            var PDF = Renderer.RenderHtmlAsPdf("<p>Sample content with UTF-8 encoding</p>");
    
            // Save the PDF to disk
            PDF.SaveAs("output.pdf");
        }
    }
    using IronPdf;
    
    class Program
    {
        static void Main()
        {
            // Instantiate a renderer
            var Renderer = new HtmlToPdf
            {
                // Set the input encoding to UTF-8
                RenderOptions = new ChromePdfRendererOptions
                {
                    InputEncoding = "UTF-8"
                }
            };
    
            // Convert HTML to PDF
            var PDF = Renderer.RenderHtmlAsPdf("<p>Sample content with UTF-8 encoding</p>");
    
            // Save the PDF to disk
            PDF.SaveAs("output.pdf");
        }
    }
    Imports IronPdf
    
    Friend Class Program
    	Shared Sub Main()
    		' Instantiate a renderer
    		Dim Renderer = New HtmlToPdf With {
    			.RenderOptions = New ChromePdfRendererOptions With {.InputEncoding = "UTF-8"}
    		}
    
    		' Convert HTML to PDF
    		Dim PDF = Renderer.RenderHtmlAsPdf("<p>Sample content with UTF-8 encoding</p>")
    
    		' Save the PDF to disk
    		PDF.SaveAs("output.pdf")
    	End Sub
    End Class
    $vbLabelText   $csharpLabel
    • HtmlToPdf: これはHTML文書をPDFに変換するために使用されるIronPdfライブラリのクラスです。
    • RenderOptions.InputEncoding: このプロパティは入力データのエンコーディングを設定することを許可します。 ここでは、国際言語をサポートするために"UTF-8"に設定されています。
    • RenderHtmlAsPdf: このメソッドは指定されたHTMLコンテンツをPDFフォーマットにレンダリングします。
    • SaveAs: このメソッドはレンダリングされたPDFファイルを指定されたファイルパスに保存するために使用されます。

inputEncodingプロパティについて詳しくはIronPdfのドキュメントをお読みください: IronPdf.ChromePdfRenderOptions.inputEncoding

Curtis Chau
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

準備はいいですか?
Nuget ダウンロード 16,154,058 | バージョン: 2025.11 ただ今リリースされました