logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Paul Rayman  
#1 Posted : Wednesday, March 4, 2020 7:54:29 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 111 time(s) in 108 post(s)
Q: Is there any list of supports Unicode languages? Is there a list of not-supported languages?
Is there any way to generate multilingual pdf without enforcing user to download any font or langauge pack?

A: The PDF format has no restrictions on the language used in the page content. Moreover, it assume that font can be embedded into the document. Thus, the ability to display a certain character in a document depends only on what font you use when creating this document.
For example the following c# code produce document like this
multilingual.png (102kb) downloaded 13 time(s).
multilingual.pdf (3,792kb) downloaded 3 time(s).

To Generate this document Code2000.ttf was used.
CODE2000.zip (3,775kb) downloaded 1 time(s).
https://en.wikipedia.org/wiki/Code2000

Code:

enum Align { Left, Right, Center };
public void Generate()
{
    using (var doc = PdfDocument.CreateNew())
    {
        //Read the contents of the font (ttf) file and embed it into a PDF document.
        var data = System.IO.File.ReadAllBytes(@"code2000.ttf");
        var font = PdfFont.CreateEmbeddedFont(doc, data, Patagames.Pdf.Enums.FontCharSet.UNICODE_CHARSET, false);

        //Add first page (1 PDF point is equal to 1/72 enches)
        using (var page = doc.Pages.InsertPageAt(doc.Pages.Count, 8.27f * 72, 11.69f * 72))
        {
            InsertText(page, "Multilingual PDF", font, 4.13f, 11.00f, FS_COLOR.Black, 25, Align.Center);
            InsertText(page, "This is a document illustrating the process of creating a multilingual PDF. The font «Code2000» was", font, 0.30f, 10.60f, FS_COLOR.Black);
            InsertText(page, "used to display the whole variety of languages ( https://en.wikipedia.org/wiki/Code2000 ).", font, 0.30f, 10.40f, FS_COLOR.Black);
            InsertText(page, "Since the font is embedded in the document, you can open and view the document correctly on a", font, 0.30f, 10.20f, FS_COLOR.Black);
            InsertText(page, "system that doesn't have the document's fonts resident.", font, 0.30f, 10.00f, FS_COLOR.Black);
            InsertText(page, "The pangrams below are taken from here: http://clagnut.com/blog/2380/", font, 0.30f, 09.60f, FS_COLOR.Black);
            InsertText(page, "The C # code, creating this document can be found here:", font, 0.30f, 09.40f, FS_COLOR.Black);
            InsertText(page, "https://forum.patagames.com/posts/t682-How-to-generate-multilingual-content-Pdf", font, 0.30f, 09.20f, FS_COLOR.Black);

            float y = 9.20f;
            InsertText(page, "Arabic", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت — يَحظى الضَجيعُ بِها نَجلاءَ مِعطارِ (A poem by Al Farāhīdi)", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Azeri", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Zəfər, jaketini də papağını da götür, bu axşam hava çox soyuq olacaq.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Breton", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Yec’hed mat Jakez ! Skarzhit ar gwerennoù-mañ, kavet e vo gwin betek fin ho puhez.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Bulgarian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Ах чудна българска земьо, полюшвай цъфтящи жита.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Catalan", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "«Dóna amor que seràs feliç!». Això, il·lús company geniüt, ja és un lluït rètol blavís d’onze kWh.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Cherokee", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "ᎠᏍᎦᏯᎡᎦᎢᎾᎨᎢᎣᏍᏓᎤᎩᏍᏗᎥᎴᏓᎯᎲᎢᏔᎵᏕᎦᏟᏗᏖᎸᎳᏗᏗᎧᎵᎢᏘᎴᎩ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ᏙᏱᏗᏜᏫᏗᏣᏚᎦᏫᏛᏄᏓᎦᏝᏃᎠᎾᏗᎭᏞᎦᎯᎦᏘᏓᏠᎨᏏᏕᏡᎬᏢᏓᏥᏩᏝᎡᎢᎪᎢ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ᎠᎦᏂᏗᎮᎢᎫᎩᎬᏩᎴᎢᎠᏆᏅᏛᎫᏊᎾᎥᎠᏁᏙᎲᏐᏈᎵᎤᎩᎸᏓᏭᎷᏤᎢᏏᏉᏯᏌᏊ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ᎤᏂᏋᎢᏡᎬᎢᎰᏩᎬᏤᎵᏍᏗᏱᎩᎱᎱᎤᎩᎴᎢᏦᎢᎠᏂᏧᏣᏨᎦᏥᎪᎥᏌᏊᎤᎶᏒᎢᎢᏡᎬᎢ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ᎹᎦᎺᎵᏥᎻᎼᏏᎽᏗᏩᏂᎦᏘᎾᎿᎠᏁᎬᎢᏅᎩᎾᏂᎡᎢᏌᎶᎵᏎᎷᎠᏑᏍᏗᏪᎩ ᎠᎴ ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ᏬᏗᏲᏭᎾᏓᏍᏓᏴᏁᎢᎤᎦᏅᏮᏰᎵᏳᏂᎨᎢ.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Chinese", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "(Traditional) 視野無限廣,窗外有藍天", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Chinese", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "(Simplified) 中国智造,慧及全球", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);


            InsertText(page, "Croatian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Gojazni đačić s biciklom drži hmelj i finu vatu u džepu nošnje.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Czech", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Nechť již hříšné saxofony ďáblů rozezvučí síň úděsnými tóny waltzu, tanga a quickstepu.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Danish", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Høj bly gom vandt fræk sexquiz på wc", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Dzongkha", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "ཨ་ཡིག་དཀར་མཛེས་ལས་འཁྲུངས་ཤེས་བློའི་གཏེར༎ ཕས་རྒོལ་ཝ་སྐྱེས་ཟིལ་གནོན་གདོང་ལྔ་བཞིན༎ ཆགས་ཐོགས་ཀུན་བྲལ་མཚུངས་མེད་འཇམ་དབྱངསམཐུས༎ མཧཱ་མཁས་པའི་གཙོ་བོ་ཉིད་འགྱུར་ཅིག།", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "Not supported by Code2000 font.", font, 0.30f, y = y - 0.10f, FS_COLOR.DarkRed, 8.0f);

            InsertText(page, "Esperanto", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Eble ĉiu kvazaŭ-deca fuŝĥoraĵo ĝojigos homtipon.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Generated by Pdfium.Net SDK (https://pdfium.patagames.com)", font, 8.20f, 0.10f, FS_COLOR.Black, 8, Align.Right);

            //Before you save the page to a file, or reload the page, or dispose it, you must call the GenerateContent methos. Or the changed information will be lost.
            page.GenerateContent();
        }


        //Add second page (1 PDF point is equal to 1/72 enches)
        using (var page = doc.Pages.InsertPageAt(doc.Pages.Count, 8.27f * 72, 11.69f * 72))
        {
            float y = 11.60f;

            InsertText(page, "Estonian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Põdur Zagrebi tšellomängija-följetonist Ciqo külmetas kehvas garaažis", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Finnish", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Wieniläinen sioux’ta puhuva ökyzombie diggaa Åsan roquefort-tacoja.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "French", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Portez ce vieux whisky au juge blond qui a fumé.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "West Frisian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Alve bazige froulju wachtsje op dyn komst", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "German", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "“Fix, Schwyz!” quäkt Jürgen blöd vom Paß", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Greek", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Ταχίστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "Takhístè alôpèx vaphês psèménè gè, draskelízei ypér nòthroý kynós", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Hebrew", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "דג סקרן שט בים מאוכזב ולפתע מצא חברה ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Hindi", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "ऋषियों को सताने वाले दुष्ट राक्षसों के राजा रावण का सर्वनाश करने वाले विष्णुवतार", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "भगवान श्रीराम, अयोध्या के महाराज दशरथ के बड़े सपुत्र थे।", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Hungarian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Jó foxim és don Quijote húszwattos lámpánál ülve egy pár bűvös cipőt készít.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Icelandic", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Svo hölt, yxna kýr þegði jú um dóp í fé á bæ.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Igbo", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Nne, nna, wepụ he’l’ụjọ dum n’ime ọzụzụ ụmụ, vufesi obi nye Chukwu, ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ṅụrịanụ, gbakọọnụ kpaa, kwee ya ka o guzoshie ike; ọ ghaghị ito, nwapụta ezi agwa.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Indonesian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Muharjo seorang xenofobia universal yang takut pada warga jazirah, contohnya Qatar.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Irish", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Ċuaiġ bé ṁórṡáċ le dlúṫspád fíorḟinn trí hata mo ḋea-ṗorcáin ḃig", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Italian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Ma la volpe, col suo balzo, ha raggiunto il quieto Fido.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Japanese", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす(ん)", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "色は匂へど 散りぬるを 我が世誰ぞ 常ならむ 有為の奥山 今日越えて 浅き夢見じ 酔ひもせず(ん)", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "とりなくこゑす ゆめさませ みよあけわたる ひんかしを そらいろはえて おきつへに ほふねむれゐぬ もやのうち", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "鳥啼く声す 夢覚ませ 見よ明け渡る 東を 空色栄えて 沖つ辺に 帆船群れゐぬ 靄の中", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "田居に出で 菜摘むわれをぞ 君召すと 求食り追ひゆく 山城の 打酔へる子ら 藻葉干せよ え舟繋けぬ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Javanese", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "꧋ ꦲꦤꦕꦫꦏ꧈ ꦢꦠꦱꦮꦭ꧈ ꦥꦝꦗꦪꦚ꧈ ꦩꦒꦧꦛꦔ꧉", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "Not supported by Code2000 font.", font, 0.30f, y = y - 0.15f, FS_COLOR.DarkRed, 8.0f);

            InsertText(page, "Generated by Pdfium.Net SDK (https://pdfium.patagames.com)", font, 8.20f, 0.10f, FS_COLOR.Black, 8, Align.Right);

            //Before you save the page to a file, or reload the page, or dispose it, you must call the GenerateContent methos. Or the changed information will be lost.
            page.GenerateContent();
        }

        //Add third page (1 PDF point is equal to 1/72 enches)
        using (var page = doc.Pages.InsertPageAt(doc.Pages.Count, 8.27f * 72, 11.69f * 72))
        {
            float y = 11.60f;
            InsertText(page, "Klingon", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "    ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Korean", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Latin", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Sic fugiens, dux, zelotypos, quam Karus haberis.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Latvian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Muļķa hipiji mēģina brīvi nogaršot celofāna žņaudzējčūsku.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Lithuanian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Įlinkdama fechtuotojo špaga sublykčiojusi pragręžė apvalų arbūzą", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Lojban", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, ".o’i mu xagji sofybakni cu zvati le purdi", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Macedonian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Ѕидарски пејзаж: шугав билмез со чудење џвака ќофте и кељ на туѓ цех.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Malayalam", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "അജവും ആനയും ഐരാവതവും ഗരുഡനും കഠോര സ്വരം പൊഴിക്കെ ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ഹാരവും ഒഢ്യാണവും ഫാലത്തില്‍ മഞ്ഞളും ഈറന്‍ കേശത്തില്‍ ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ഔഷധ എണ്ണയുമായി ഋതുമതിയും അനഘയും ഭൂനാഥയുമായ ഉമ ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ദുഃഖഛവിയോടെ ഇടതു പാദം ഏന്തി ങ്യേയാദൃശം നിര്‍ഝരിയിലെ ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "ചിറ്റലകളെ ഓമനിക്കുമ്പോള്‍ ബാ‍ലയുടെ കണ്‍കളില്‍ നീര്‍ ഊര്‍ന്നു വിങ്ങി.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Mapudungun", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "(Ragileo alphabet) Gvxam mincetu apocikvyeh: ñizol ce mamvj ka raq kuse bafkeh mew", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "(Unified alphabet) Ngütram minchetu apochiküyeṉ: ñidol che mamüll ka rag kushe ḻafkeṉ mew.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "(Azümchefe) Gütxam minchetu apochiküyenh: ñizol che mamüll ka raq kushe lhafkenh mew.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Mongolian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Щётканы фермд пийшин цувъя. Бөгж зогсч хэльюү.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Myanmar", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "သီဟိုဠ်မှ ဉာဏ်ကြီးရှင်သည် အာယုဝဍ္ဎနဆေးညွှန်းစာကို ဇလွန်ဈေးဘေးဗာဒံပင်ထ က် အဓိဋ္ဌာန်လျက် ဂဃနဏဖတ်ခဲ့သည်။", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Norwegian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Vår sære Zulu fra badeøya spilte jo whist og quickstep i min taxi.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Polish", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Jeżu klątw, spłódź Finom część gry hańb! (by Stanisław Barańczak)", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Portuguese", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Luís argüia à Júlia que «brações, fé, chá, óxido, pôr, zângão» eram palavras do português.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Romanian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Muzicologă în bej vând whisky și tequila, preț fix.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Russian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Generated by Pdfium.Net SDK (https://pdfium.patagames.com)", font, 8.20f, 0.10f, FS_COLOR.Black, 8, Align.Right);

            //Before you save the page to a file, or reload the page, or dispose it, you must call the GenerateContent methos. Or the changed information will be lost.
            page.GenerateContent();
        }

        //Add fourth page (1 PDF point is equal to 1/72 enches)
        using (var page = doc.Pages.InsertPageAt(doc.Pages.Count, 8.27f * 72, 11.69f * 72))
        {
            float y = 11.60f;
            InsertText(page, "Sanskrit", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "कः खगौघाङचिच्छौजा झाञ्ज्ञोऽटौठीडडण्ढणः। तथोदधीन् पफर्बाभीर्मयोऽरिल्वाशिषां सहः।। [6]", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Scottish Gaelic", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Mus d’fhàg Cèit-Ùna ròp Ì le ob.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Serbian, Croatian, Bosnian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Gojazni đačić s biciklom drži hmelj i finu vatu u džepu nošnje.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Slovak", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Kŕdeľ šťastných ďatľov učí pri ústí Váhu mĺkveho koňa obhrýzať kôru a žrať čerstvé mäso.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Slovenian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Hišničin bratec vzgaja polže pod fikusom.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Spanish", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Benjamín pidió una bebida de kiwi y fresa; Noé, sin vergüenza, la más exquisita champaña del menú.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "(with ch, ñ, rr and ll) El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y frío;", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "añoraba a su querido cachorro.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Swedish", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Yxskaftbud, ge vår WC-zonmö IQ-hjälp.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Tagalog", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Ang bawat rehistradong kalahok sa patimpalak ay umaasang magantimpalaan ng ñino", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Thai", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน จงฝ่าฟันพัฒนา", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "วิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัด", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "อภัยเหมือนกีฬาอัชฌาสัย ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟัง เอยฯ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Tibetan", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "༈ དཀར་མཛེས་ཨ་ཡིག་ལས་འཁྲུངས་ཡེ་ཤེས་གཏེར། །ཕས་རྒོལ་ཝ་སྐྱེས་ཟིལ་གནོན་གདོང་ལྔ་བཞིན། །ཆགས་ཐོགས་ཀུན་བྲལ་མཚུངས་མེད་འཇམ་བྱངས་མཐུས། །མ་ཧཱ་མཁས་པའི་གཙོ་བོ་ཉིད་གྱུར་ཅིག།", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "Not supported by Code2000 font.", font, 0.30f, y = y - 0.15f, FS_COLOR.DarkRed, 8.0f);

            InsertText(page, "Turkish", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Pijamalı hasta yağız şoföre çabucak güvendi.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Ukrainian", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів!", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Urdu", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "ھنڈ میں، ایک قحط زدہ گاؤں سے گذرتے وقت ایک چڑچڑے، باأثر و فارغ ", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);
            InsertText(page, "شخص کو بعض جل پری نما اژدہے نظر آئے۔", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Uyghur", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "ئاۋۇ بىر جۈپ خوراز فرانسىيەنىڭ پارىژ شەھرىگە يېقىن تاغقا كۆچەلمىدى.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Yoruba", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Ìwò̩fà ń yò̩ séji tó gbojúmó̩, ó hàn pákànpò̩ gan-an nis̩é̩ rè̩ bó dò̩la.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Welsh", font, 0.30f, y = y - 0.40f, FS_COLOR.Black, 14);
            InsertText(page, "Parciais fy jac codi baw hud llawn dŵr ger tŷ Mabon.", font, 0.30f, y = y - 0.20f, FS_COLOR.Black);

            InsertText(page, "Generated by Pdfium.Net SDK (https://pdfium.patagames.com)", font, 8.20f, 0.10f, FS_COLOR.Black, 8, Align.Right);

            //Before you save the page to a file, or reload the page, or dispose it, you must call the GenerateContent methos. Or the changed information will be lost.
            page.GenerateContent();
        }

        //Save document
        doc.Save(@"test.pdf", Patagames.Pdf.Enums.SaveFlags.NoIncremental);
    }
}
private void InsertText(PdfPage page, string text, PdfFont font, float x, float y, FS_COLOR FS_COLOR, float fontSize = 11.04f, Align align = Align.Left)
{
    PdfTextObject textObject = PdfTextObject.Create(text, x * 72, y * 72, font, fontSize);
    textObject.FillColor = FS_COLOR;
    page.PageObjects.Add(textObject);
    if (align != Align.Left)
    {
        float w = textObject.BoundingBox.Width / (align == Align.Center ? 2 : 1);
        textObject.Location = new FS_POINTF(textObject.Location.X - w, textObject.Location.Y);
    }
}

Edited by user Saturday, March 7, 2020 1:00:18 AM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.