PDF printing with Unicode characters
I'm trying to add the greater than or equal character on a ZEN PDF report and was wondering how and what code I can use Unicode to print it.
Is is as simple as using $c
Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1 (Build 209)
In what part/context and how (constant? function/expression? report data?) of a ZEN Report do you want to insert it?
Maybe a little snipped of the report may help us in helping you...
Enrico
Thank you.
I'm trying to embed in a table cell a string of text that needs the >= character as a single character.
The ZEN table :
<table orient="col" class="borderless" width='#($g(^||Page("TotalRowWidth")))#in' group="PostInfoData3">
<item field="PostInfo" width='#($g(^||Page("TotalRowWidth")))#in' style='#(..Style("TestProfilePostInfoCell",3))#' stylecall="HighLight" styleparams="Zebra1" styleparamNames="Value"></item>
</table>
</container>
</table>
</table>
The code that populates this is :
for {
set r=$o(^||TestProfile("Table",p,"PostInfo",r))
if r="" quit
write !,"<PostInfoData"_p_">"
set zebra=..Zebra(1) if zebra=0,PostSolidBackGround=1 set zebra=1
set text=^||TestProfile("Table",p,"PostInfo",r)
if (text=BlankChar)||($zstrip(text,"<>w")="") {set enh=100,text=BlankChar}
elseif $l(text)<210 {set enh=..GetEnhancement(CDRCode,"TestProfile",p,0,text)+zebra}
else {set enh=zebra}
write !,"<PostInfo>"_$zcvt(text,"O","XML")_"</PostInfo>"
write !,"<Zebra1>"_enh_"</Zebra1>"
write !,"</PostInfoData"_p_">"
}
where ^||TestProfile("Table",p,"PostInfo",r) = "* As defined by incident diabetic kidney disease (eGFR <60mL/min/1.73m"_$c(178)_" in the next four years. Note: If eGFR level at the time of the test is already <60mL/min/1.73m"_$c(178)_" , then the risk of a further decline in kidney function is defined as an eGFR decline >= 30% in the next four years."
It's the >= that I need to transform to the single character
Single character greater than or equal symbol is $c(8805), so:
.......
set text=^||TestProfile("Table",p,"PostInfo",r)
set text=$replace(text,">=",$c(8805))
.......
Try and let us know.
Enrico
Enrico,
Unfortunately the character on the PDF was not visible. The font is set to Arial
Hi Con,
I was afraid of that, the $zcvt function does not handle that translation.
You need to modify your code to something like:
set text=$zcvt(text,"O","XML")
set text =$replace(text,">=","≥")
write !,"<PostInfo>"_text_"</PostInfo>"
Enrico
Enrico,
I tried that but the PDF report prints %ge; and not the symbol.
≥ or %ge; ??
it's ≥
Would it be that ZEN PDF reports can't print 16bit codes like $c(8805)
I've seen Zen reports used extensively for Chinese content, so they can definitely handle the far reaches of the Unicode realm.
What happens if you do this?
write !,"<PostInfo>My GE: "_$c(8805)_"</PostInfo>"
or this?
write !,"<PostInfo>My GE: "_$zcvt($c(8805),"O","UTF8")_"</PostInfo>"
Some other things to check:
Enrico,
Using write !,"<PostInfo>My GE: "_$c(8805)_"</PostInfo>" had corrected the issue.
Thank you for your time on this.
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue