You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by nafise hassani <na...@yahoo.com> on 2004/12/22 13:33:30 UTC

producing arabic pdf

hi
I use cocoon as a framework and I want to output a pdf
using "fo2pdf" serializer also I want to create arabic
content in my pdfs I set the charencoding in my xml
file(src for generator) to "UTF-8" and prepare arabic
content in them
but outputted pdf can't display the arabic char
correctly

any suggestion???????
is there any fault in cocoon "fo2pdf" serializer for
showing charachters in languages like arabic????


	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

Re: producing arabic pdf

Posted by Marcin Stefaniuk <ma...@eo.pl>.
Dnia 22-12-2004, śro o godzinie 04:33 -0800, nafise hassani napisał(a):
> hi
> I use cocoon as a framework and I want to output a pdf
> using "fo2pdf" serializer also I want to create arabic
> content in my pdfs I set the charencoding in my xml
> file(src for generator) to "UTF-8" and prepare arabic
> content in them
> but outputted pdf can't display the arabic char
> correctly
> 
> any suggestion???????
> is there any fault in cocoon "fo2pdf" serializer for
> showing charachters in languages like arabic????
PDF (AFIK working with Polish content) handle latin1 chars. If you want
to make document with different charset You must embed fonts to display
it correctly. More in Cocoon docs.
http://cocoon.apache.org/2.1/userdocs/serializers/pdf-serializer.html

Best Regards
-- 
Marcin Stefaniuk <ma...@eo.pl>


Re: producing arabic pdf

Posted by go...@osmosis.gr.
one note (correction)

you dont need to put your fop-config.xml in web-inf
put it were you want and point to it when you configure the serializer in 
sitemap





On Wed, 22 Dec 2004 gounis@osmosis.gr wrote:

> 
> 
> 
> hi nafise
> 
> you have to use compiled fonts 
> 
> http://xml.apache.org/fop/fonts.html
> 
> and then force cocoon to use those fonts
> for this you have to create a fop-config.xml
> in web-inf
> 
> for example the content of my fop-config:
> <configuration>
> 	<fonts>
> 		<font metrics-file="c:/fop-fonts/arial.ttf.xml" 
> kerning="yes" embed-file="c:/fop-fonts/win/arial.ttf">
> 			<font-triplet name="Arial" style="normal" 
> weight="normal"/>
> 			<font-triplet name="ArialMT" style="normal" 
> weight="normal"/>
> 		</font>
> 		<font metrics-file="c:/fop-fonts/arialb.ttf.xml" 
> kerning="yes" embed-file="c:/fop-fonts/win/arialb.ttf">
> 			<font-triplet name="Arial" style="normal" 
> weight="bold"/>
> 			<font-triplet name="ArialMT" style="normal" 
> weight="bold"/>
> 		</font>
> 		<font metrics-file="c:/fop-fonts/arialbi.ttf.xml" 
> kerning="yes" embed-file="c:/fop-fonts/win/arialbi.ttf">
> 			<font-triplet name="Arial" style="italic" 
> weight="bold"/>
> 			<font-triplet name="ArialMT" style="italic" 
> weight="bold"/>
> 		</font>
> 		<font metrics-file="c:/fop-fonts/ariali.ttf.xml" 
> kerning="yes" embed-file="c:/fop-fonts/win/ariali.ttf">
> 			<font-triplet name="Arial" style="italic" 
> weight="normal"/>
> 			<font-triplet name="ArialMT" style="italic" 
> weight="normal"/>
> 		</font>
> 	</fonts>
> </configuration>
> 
> 
> 
> and finaly you have to register this fop-confing in your sitemap:
> ...
> 			<map:serializer logger="sitemap.serializer.fo2pdf" mime-type="application/pdf" name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer">
> 				<user-config>c:\fop-fonts\config.xml</user-config>
> 			</map:serializer>
> ...
> 
> 
> --stavros
> 
> 
> [cocoon doc] http://cocoon.apache.org/2.1/userdocs/serializers/pdf-serializer.html
> 
> On Wed, 22 Dec 2004, nafise hassani wrote:
> 
> > hi
> > I use cocoon as a framework and I want to output a pdf
> > using "fo2pdf" serializer also I want to create arabic
> > content in my pdfs I set the charencoding in my xml
> > file(src for generator) to "UTF-8" and prepare arabic
> > content in them
> > but outputted pdf can't display the arabic char
> > correctly
> > 
> > any suggestion???????
> > is there any fault in cocoon "fo2pdf" serializer for
> > showing charachters in languages like arabic????
> > 
> > 
> > 	
> > 		
> > __________________________________ 
> > Do you Yahoo!? 
> > Yahoo! Mail - You care about security. So do we. 
> > http://promotions.yahoo.com/new_mail
> > 
> 
> 


Re: producing arabic pdf

Posted by go...@osmosis.gr.


hi nafise

you have to use compiled fonts 

http://xml.apache.org/fop/fonts.html

and then force cocoon to use those fonts
for this you have to create a fop-config.xml
in web-inf

for example the content of my fop-config:
<configuration>
	<fonts>
		<font metrics-file="c:/fop-fonts/arial.ttf.xml" 
kerning="yes" embed-file="c:/fop-fonts/win/arial.ttf">
			<font-triplet name="Arial" style="normal" 
weight="normal"/>
			<font-triplet name="ArialMT" style="normal" 
weight="normal"/>
		</font>
		<font metrics-file="c:/fop-fonts/arialb.ttf.xml" 
kerning="yes" embed-file="c:/fop-fonts/win/arialb.ttf">
			<font-triplet name="Arial" style="normal" 
weight="bold"/>
			<font-triplet name="ArialMT" style="normal" 
weight="bold"/>
		</font>
		<font metrics-file="c:/fop-fonts/arialbi.ttf.xml" 
kerning="yes" embed-file="c:/fop-fonts/win/arialbi.ttf">
			<font-triplet name="Arial" style="italic" 
weight="bold"/>
			<font-triplet name="ArialMT" style="italic" 
weight="bold"/>
		</font>
		<font metrics-file="c:/fop-fonts/ariali.ttf.xml" 
kerning="yes" embed-file="c:/fop-fonts/win/ariali.ttf">
			<font-triplet name="Arial" style="italic" 
weight="normal"/>
			<font-triplet name="ArialMT" style="italic" 
weight="normal"/>
		</font>
	</fonts>
</configuration>



and finaly you have to register this fop-confing in your sitemap:
...
			<map:serializer logger="sitemap.serializer.fo2pdf" mime-type="application/pdf" name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer">
				<user-config>c:\fop-fonts\config.xml</user-config>
			</map:serializer>
...


--stavros


[cocoon doc] http://cocoon.apache.org/2.1/userdocs/serializers/pdf-serializer.html

On Wed, 22 Dec 2004, nafise hassani wrote:

> hi
> I use cocoon as a framework and I want to output a pdf
> using "fo2pdf" serializer also I want to create arabic
> content in my pdfs I set the charencoding in my xml
> file(src for generator) to "UTF-8" and prepare arabic
> content in them
> but outputted pdf can't display the arabic char
> correctly
> 
> any suggestion???????
> is there any fault in cocoon "fo2pdf" serializer for
> showing charachters in languages like arabic????
> 
> 
> 	
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - You care about security. So do we. 
> http://promotions.yahoo.com/new_mail
>