function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DeepuDeepu 

Localized PDF using VF

I have a requirement to support both English and Thai in my application
I have translated the VF page output text to Thai and it is getting displayed correctly.
But when I render a VF page as PDF, all texts in Thai are not getting displayed.

A snippet of my page is pasted below

 

<apex:page sidebar="false" renderAs="pdf" standardController="Qoute__c" extensions="myControllerExtension" language="th">
<style> body { font-family: Arial Unicode MS; } </style>
<apex:form >
<apex:pageBlock title="Qoute Details">
 
  <apex:panelGrid columns="2"  width="900">
       <apex:image url="{!$Resource.novlogo}" height="100" width="100"/>
      
       <apex:dataList var="r" value="{!qoute}" >
                         
           <apex:panelGrid columns="2" border="1" width="300">  
          <apex:outputLabel value="{!$Label.Customer}"></apex:outputLabel>
               <apex:outputLabel value="{!r.Customer_Name__c}"/>
            <apex:outputLabel value="{!$Label.Product}" lang="th"></apex:outputLabel>

.........etc etc...

In this I have given Thai translation only  for "{!$Label.Product}"  which is not getting displayed


Please help me out ..Its urgent

thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
mtbclimbermtbclimber

Right, forgot about the character set issue :)

 

You need to put the style declaration in the head tag. Try this:

 

 

<apex:page language="th" renderAs="pdf">
    <html>
        <head> 
            <style> body { font-family: Arial Unicode MS; } </style> 
        </head>
        <apex:outputLabel value="{!$Label.Product}"/>
    </html>
</apex:page>

 

 

All Answers

mtbclimbermtbclimber

Nothing jumps out at first glance. Can you try a very simple page like this?

 

 

<apex:page language="th" renderAs="pdf">
    <apex:outputLabel value="{!$Label.Product}"/>
</apex:page>

 

Does that work?

 

 

Also, in a PDF I'm not sure that outputLabel is the right component to use. It's mainly for labels in forms though in my simple test it didn't seem to matter.

DeepuDeepu

It dint work.

But if I remove the renderas="pdf", the VF page correctly displays Thai text.

 

Will it have anything to do with the PDf format/structure?

I am using Adobe Reader 9.1.

Can you please try a custom label with Thai translation and check if it is getting rendered in PDF correctly?

mtbclimbermtbclimber

Right, forgot about the character set issue :)

 

You need to put the style declaration in the head tag. Try this:

 

 

<apex:page language="th" renderAs="pdf">
    <html>
        <head> 
            <style> body { font-family: Arial Unicode MS; } </style> 
        </head>
        <apex:outputLabel value="{!$Label.Product}"/>
    </html>
</apex:page>

 

 

This was selected as the best answer
DeepuDeepu

Thanks mtbclimber

 

It did work :smileyhappy: