Page 1 of 1
'#' instead of non-ascii character in PDF
Posted: Mon Mar 15, 2010 5:57 pm
by urukay
Hi,
can please point me to the right direction? Have been trying to find solution to this problem (better say problem of my language-Slovak). I've set encodinf of *.fo file to UTF-8, but after transforming *.fo file to PDF file, i see '#' instead of character like 'č', but not in character 'š'. And i just cant find proper solution anywhere.
Thanks
Radovan
Re: '#' instead of non-ascii character in PDF
Posted: Mon Mar 15, 2010 6:44 pm
by adrian
Hello,
The problem is that the characters you use aren't supported by the default font used for the PDF. You have to embed in the PDF a font that supports these characters.
There is a procedure in the Oxygen User Manual for setting a font for the PDF output generated with Apache FOP transformation:
http://www.oxygenxml.com/doc/ug-oxygen/ ... uiltin-FOP
Let us know if you need further help or information.
Regards,
Adrian
PS:
If you have multiple projects you may want to omit the
base tag from the fopConfiguration.xml and instead use absolute URLs. e.g.
Code: Select all
<font metrics-url="file:/Project/fonts/Arialuni.xml"
embed-url="file:/Library/Fonts/Arialuni.ttf">
Re: '#' instead of non-ascii character in PDF
Posted: Mon Mar 15, 2010 8:49 pm
by urukay
Well thanks for pointing me somewhere, but after few hours of trying all i get is bunch of incomprehensible errors.
I got till "Add new font to FO output" but from then only errors.
Also in that atricle, there few errors, that need to be corrected.
So far no success with this problem
Re: '#' instead of non-ascii character in PDF
Posted: Tue Mar 16, 2010 2:03 pm
by adrian
Hello,
I'm sorry, there are indeed a few mistakes in the scripts(an extra quote and a line broken in two).
To make things simple:
For Linux/Mac create
ttfConvert.sh:
Code: Select all
#!/bin/sh
java -cp lib/fop.jar:lib/avalon-framework-4.2.0.jar:lib/xercesImpl.jar org.apache.fop.fonts.apps.TTFReader "$@"
For Windows create
ttfConvert.bat:
Code: Select all
@echo off
java -cp lib/fop.jar;lib/avalon-framework-4.2.0.jar;lib/xercesImpl.jar org.apache.fop.fonts.apps.TTFReader %1 %2 %3 %4 %5 %6 %7 %8
and then just launch them from the command line and specify as arguments the ttf file and the xml file.
Linux:
sh ttfConvert.sh /path/to/font/fontfile.ttf /path/to/xml/xmlfile.xml
Windows:
ttfConvert.bat "C:\Path\To\Font\fontfile.ttf" "C:\Path\To\XML\xmlfile.xml"
And then you can continue from the section
Register font to FOP configuration.
Let me know if you need further help.
Regards,
Adrian
Re: '#' instead of non-ascii character in PDF
Posted: Fri Mar 19, 2010 12:18 pm
by urukay
Hello Adrian,
as I said the problems start when trying "Add new font to FO output". It's really frustrating, have tryied for 2 days and almost anything to get it working, but no success. All the errors I get, when trying to transform *.fo to PDF with new font, are incomprehensible for me. Maybe if I had more information what's wrong...but I don't have :-S
Maybe the problem is not in the font, i'm starting to believe that problem is elsewhere.
The error I'm facing is in <saxon6:script implements-prefix="s6hl" language="java" src="java:net.sf.xslthl.ConnectorSaxon6" />
SystemID: C:\Program Files (x86)\Oxygen XML Editor 11\frameworks\docbook\xsl\highlighting\common.xsl
Engine name: Saxon6.5.5
Severity: warning
Description: Failed to load net.sf.xslthl.ConnectorSaxon6 - net.sf.xslthl.ConnectorSaxon6
Start location: 33:0
Thanks
Radovan
Re: '#' instead of non-ascii character in PDF
Posted: Fri Mar 19, 2010 12:38 pm
by urukay
Well, my desperate attempt to solve this problem was I guess successfull...just copied fonts to JRE fonts directory and it worked..everything is working fine.
Thanks for your time and effort. I really appreciate it!
Radovan