Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author dinamiko

    (@dinamiko)

    Hi Craig S. Kiessling,

    can you paste an URL here where I can see it? thanks.

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    No worries, I finally figured it out πŸ™‚ I had not closed the tags πŸ˜›

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    Ah – it’s a font thing I guess. My site’s behind a logged-in users only.

    Plugin Author dinamiko

    (@dinamiko)

    Hi Craig,

    if it’s a font thing, maybe that will work (worked for arabic),
    add this to DK PDF CSS tab:

    body {font-family:Arial, sans-serif;}

    try it and tell me, thanks.

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    Unfortunately no.

    I’ve found the same issue being mentioned in other pdf-related plugins:

    http://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-custom-fonts/

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    I am guessing you’re using fpdf? If so, then this might help but I am not sure how to implement it: http://www.ntaso.com/fpdf-and-chinese-characters/

    Plugin Author dinamiko

    (@dinamiko)

    Hi Craig,

    DK PDF uses mPDF library:
    http://www.mpdf1.com/mpdf/index.php

    do you have the font in .ttf format? I mean, if your page prints chinese characters correctly to the browser, then we need to know which font are you using, then I can guide you how to do install this font in mPDF.

    Cheers.

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    UTF-8 encoding shows the regular characters, just like this ζ­¦ζœ―ζŠ±ζ‹³η€Ό.
    From some of those links above, I ended up downloading a couple of fonts, and they’re pretty huge. I haven’t done anything yet with them, as although I don’t mind slightly slower load times on this project, I’d rather not get crazy.

    I saw this on Stack Exchange (here), but not sure if it works, nor where I’d put that:

    You need to enable the support of PDF Asian font like this:

    $pdf = $this->pdf->load();
    $pdf->useAdobeCJK = true;
    $pdf->SetAutoFont(AUTOFONT_ALL);

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    Btw, I’m also trying to make some links not links in pdfs (just showing unlinked anchor text). To experiment, I tried putting this in the “pdf css” tab, but it didn’t work:

    a { pointer-events: none !important; }

    it might end up having to be some major javascript or something that’d take more fiddling, no worries. I can do without this πŸ™‚

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    Any ideas on the characters bit yet?

    Plugin Author dinamiko

    (@dinamiko)

    Hi Craig, sorry for the delay,

    I finally figured it out, please add this code in dk-pdf / includes / mpdf60 / dkpdf-functions.php

    $mpdf->useAdobeCJK = true;
    $mpdf->autoScriptToLang = true;
    $mpdf->autoLangToFont = true;

    See attachment image for reference:
    http://wp.dinamiko.com/demos/dkpdf/wp-content/uploads/2016/04/chinese.png

    about make some links not links in pdfs maybe a solution is hiding those links using http://wp.dinamiko.com/demos/dkpdf/doc/dkpdf-remove-shortcode/

    Thanks.

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    No worries and many thanks.

    I’m not seeing dk-pdf / includes / mpdf60 / dkpdf-functions.php. But I do see dk-pdf / includes / dkpdf-functions.php.

    Should I move it or?

    Plugin Author dinamiko

    (@dinamiko)

    ups! sorry, you’re right:
    dk-pdf / includes / dkpdf-functions.php

    Thanks.

    Thread Starter Craig S. Kiessling

    (@iamnorthwind)

    AH okay cool. Sweet – now the Chinese show up!

    Unfortunately the dkpdf-remove won’t work – that removes the text altogether. I am imagining it just applies a display:none style to the element, which I’ve done in the stylesheet for various things.

    But I want the anchor (linked text) text to display, but just not as a link.

    Plugin Author dinamiko

    (@dinamiko)

    yes, this is how the shortcode works, removes the entire piece of content inside the shortcode in the PDF.

    what is printed in the PDF is exactly the same as you’ve in the HTML, so if you’ve a link, a link will apear in the PDF. I’m not an CSS expert but I think that is not posible to remove a link (the <a href=””… part ) using CSS. If you find how to do it with CSS, you can try to add it to the CSS tab.

    Thanks.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Double-Byte?’ is closed to new replies.