How to draw Japanese in PDFgraphic

Hello friends, I’m currently working on a project exporting Japanese report into PDF file.
However, all the Japanese characters are shown as “?” on the page.
I tried string.DefineEncodings but didn’t work.
Can anybody help me with this? Thank you in advance.

I’m afraid you will need dynapdf plugin for that !

1 Like

Hi Pochez, thanks for your reply.
So, PDFGraphic don’t support Japanese kanji? Is that true?
But Graphic in canvas support Japanese, what’s so different between PDFgraphic and Graphic?
I renewed my license few days before just for the new function of PDF export…so sad…

wait from @Christian_Schmitz from MBS to confirm that, but I read that pdf from xojo cannot deal with special characters (even accentuated french one) so the japanese !

2 Likes

there is also the actually low priced omegabundle with lots of contents and dynapdf first licence.

1 Like

Hi @Jean-Yves_Pochez

but I read that pdf from xojo cannot deal with special characters (even accentuated french one) so the japanese

AFAIK that’s not true.

frenchPDF

As for the Unicode support in PDFDocument, there are several threads in the forum explaining why is not still there… it will arrive for sure!

Merçi beaucoup for your support!

1 Like

Hi @NANQI_WU

Although far from ideal… and as a workaround until Unicode support arrives, you can render kanji text on the PDF graphic context if you convert it to a picture in first place, and then “draw” it to the PDF using DrawPicture.

KanjiPDF

As the main “cons”… the text will not be selectable in the final PDF document (it will be bitmaped text).

ご不便おかけしてすみません

2 Likes

I may have mixed unicode and french characters. sorry.

Hi Menendez,
Thank you for your solution. I’ll do it this way.
At least, I can continue with my work now.

Hi @NANQI_WU

追加のサポートが必要な場合は、遠慮なくお問い合わせください。
あなたのサポートをありがとう

1 Like

See DynaPDF Starter included in OmegaBundle

  • More than 60 code pages, incl. 17 CJK character sets and Unicode

And yes, I know the plugin costs money, but DynaPDF has been in development for over 15 years and getting all the unicode things working was a lot of work.

So get a DynaPDF Starter license for about $199 USD alone from us or $399 USD with OmegaBundle.

2 Likes

You can also do Japanese letters with our PDF Plugin.

2 Likes

Hi Schmitz,
Thanks for the info. I’ll consider that.

Hi Menendez, one more question.
I tried what you said, but the resolution is too poor to use.
image
I want the same sharp edge of which screenshot you posted.
Do you have any further suggestions for me?

If you like high res pictures, you may look into another PDF class.
Whether you pick Björn’s plugin, our plugin or some other PDF classes.

Hi Schmitz,
So to achive this, I need another class? This dones’t seem so high res…


I want nothing but a clear edge of letters…

If you hit the limits of the built-in PDF drawing capabilities in Xojo, you may switch to use another class.

And since MBS Xojo DynaPDF Plugin has a Graphics class integration, that may be the easier path.
Or if you have a license for Einhugur plugins, use Björn’s PDF plugin instead.

Or wait with the project until a new Xojo versions improves the classes.

Hi @NANQI_WU

Would you mind to send a test project (privately) to me, so I can see what’s going on? I did nothing special in the screenshot besides drawing the sample Kanji text at 100% its size.

Thank you so much!

I would still be interested in the result of why his graphics have so poor resolution.
thanks.
@Javier_Menendez

@Jean-Yves_Pochez Yeah, that’s why asked for a “sample project” to test here.

1 Like