Difference between revisions of "Convert Special Characters to PDF"

From SmartWiki
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
When a [[Web Page View]] is converted from HTML to PDF certain special characters may not be converted correctly.
 
When a [[Web Page View]] is converted from HTML to PDF certain special characters may not be converted correctly.
  
To ensure compatibility use characters from the ISO-8859-1 character set (see http://en.wikipedia.org/wiki/ISO/IEC_8859-1)
+
Most western Latin Unicode characters will be displayed normally. If your PDF will contain non-Latin characters such as Japanese, Korean or Greek, then the PDF writer must be told to use TTF (True Type Font) and the font should be specified. The font must be one that can render the characters correctly. You must also tell the PDF writer to use True Type Font by including the following anywhere with the [[Web Page View]]:
 
+
* <font size="3">&lt;!--Use TTF--></font>
 
+
Supported special characters include:
+
For example, to display Japanese characters properly, do the following:
* ¥
+
# Put  this '''&lt;!--Use TTF-->''' somewhere within the web page view
* §
+
# Put this '''&lt;font face="VAL Gothic Regular">''' or '''&lt;font face="Bitstream Cyberbit">''' in front of the text that will contain the special/non-Latin characters.
*
+
::* Alternately you can define the font within a &lt;style> tag for each element. For example:
* ¤
+
<pre>
* ß
+
<style>
* þ
+
<!--@sslogic("@me.langid@" in (7,15))-->
* °
+
body,div,span,p,table,tr,th,td,a{
* ¿
+
  font-family: "Bitstream Cyberbit",'Arial',Verdana, Arial, 'MS Sans Serif', sans-serif;
* Þ
+
  font-weight:normal;
* Ø
+
}
* Ð
+
<!--@end-->
* ª
+
</style>
* ¹
+
</pre>
* ²
 
* ³
 
 
 
  
 +
'''Note:''' Many fonts such as Japanese and Korean do not fully support bold text. Accordingly, using  "&lt;b>" or "&lt;strong>" tags, or style="font-weight:bold or 200 etc. (or CSS entries) may result in garbled output. Thus, in the &lt;style> example above, the font-weight is defined as normal. Note that any in-line styles in the Web Page View (i.e. &lt;span style="font-face:Arial">) will override the styles defined in the style tag.
  
  
 
==See Also==
 
==See Also==
* http://en.wikipedia.org/wiki/ISO/IEC_8859-1
+
* [[PDF Writer Custom Tags]]
 
* http://pd4ml.com/css.htm
 
* http://pd4ml.com/css.htm
 
* http://pd4ml.com/html.htm
 
* http://pd4ml.com/html.htm

Latest revision as of 08:45, 2 July 2013

When a Web Page View is converted from HTML to PDF certain special characters may not be converted correctly.

Most western Latin Unicode characters will be displayed normally. If your PDF will contain non-Latin characters such as Japanese, Korean or Greek, then the PDF writer must be told to use TTF (True Type Font) and the font should be specified. The font must be one that can render the characters correctly. You must also tell the PDF writer to use True Type Font by including the following anywhere with the Web Page View:

  • <!--Use TTF-->

For example, to display Japanese characters properly, do the following:

  1. Put this <!--Use TTF--> somewhere within the web page view
  2. Put this <font face="VAL Gothic Regular"> or <font face="Bitstream Cyberbit"> in front of the text that will contain the special/non-Latin characters.
  • Alternately you can define the font within a <style> tag for each element. For example:
<style>
<!--@sslogic("@me.langid@" in (7,15))-->
body,div,span,p,table,tr,th,td,a{
   font-family: "Bitstream Cyberbit",'Arial',Verdana, Arial, 'MS Sans Serif', sans-serif;
   font-weight:normal;
}
<!--@end-->
</style>

Note: Many fonts such as Japanese and Korean do not fully support bold text. Accordingly, using "<b>" or "<strong>" tags, or style="font-weight:bold or 200 etc. (or CSS entries) may result in garbled output. Thus, in the <style> example above, the font-weight is defined as normal. Note that any in-line styles in the Web Page View (i.e. <span style="font-face:Arial">) will override the styles defined in the style tag.


See Also