Re: [xwiki-users] PDF with UTF characters

2010-02-04 Thread Valdis Vītoliņš
Many thanks Sergiu!
I solved this. My comments are inline.

> Even the FOP developers say that generating font metrics is not needed, 
> and deprecated. FOP should correctly find and use system fonts, and 
> should correctly work with TTF fonts.

I checked this and that's correct. 

> The problem is that FOP doesn't 
> find the fonts provided by XWiki because Tomcat doesn't use an URI 
> scheme that FOP understands. You can extract 
> WEB-INF/lib/xwiki-core-XYZ.java#fop-config.xml into WEB-INF/classes and 
> adjust the  settings so that you manually specify the path to the 
> right font files. The syntax for the config xml should be on the FOP site.

Copied Courier_New.ttf and  Times_New_Roman.ttf
into ../webapps/xwiki/WEB-INF/fonts

Added following lines to
the ../webapps/xwiki/WEB-INF/classes/fop-config.xml
  
...

   


   


...
  

> Extract xhtml2fo.xsl from WEB-INF/lib/xwiki-core-XYZ.jar into 
> WEB-INF/classes and search for the line:
> 
> FreeSerif,serif

Changed FreeSerif,serif to Times New Roman and FreeMono,monospace to Courier New

Ran PDF export, got
exception ... /usr/share/tomcat5.5/.fop/fop-fonts.cache (No such file or
directory)...
mkdir /usr/share/tomcat5.5/.fop/
chown tomcat5:root /usr/share/tomcat5.5/.fop/
chmod 775 /usr/share/tomcat5.5/.fop/

restarted tomcat
and viola!
It is working now!

Valdis

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] PDF with UTF characters

2010-02-04 Thread Sergiu Dumitriu
On 02/04/2010 01:32 PM, Valdis Vītoliņš wrote:
> I learned how to add custom TTF font and metrics for FOP.
> Test project can be downloaded from http://odo.lv/ftp/temp/FOP.zip
> There are FOP jars and "Lucida Sans Unicode" TTF font with generated
> metrics file.
> Metrics can be created using generate_font_metrics.bat script. Test PDF
> can be generated with test1.bat script.

Even the FOP developers say that generating font metrics is not needed, 
and deprecated. FOP should correctly find and use system fonts, and 
should correctly work with TTF fonts. The problem is that FOP doesn't 
find the fonts provided by XWiki because Tomcat doesn't use an URI 
scheme that FOP understands. You can extract 
WEB-INF/lib/xwiki-core-XYZ.java#fop-config.xml into WEB-INF/classes and 
adjust the  settings so that you manually specify the path to the 
right font files. The syntax for the config xml should be on the FOP site.

> Now questions are:
> How can I invoke customized FOP with additional parameter for my config
> file from Xwiki?
> Or how can I change default font From "Times-Roman" to "Lucida Sans
> Unicode"?

Extract xhtml2fo.xsl from WEB-INF/lib/xwiki-core-XYZ.jar into 
WEB-INF/classes and search for the line:

FreeSerif,serif

Replace FreeSerif with what you want.

> Valdis
>
>> On 02/01/2010 09:47 PM, Valdis Vītoliņš wrote:
>>> I'm investigating issue http://jira.xwiki.org/jira/browse/XWIKI-4724
>>> Now I can generate right PDF using separate FOP with additional
>>> configuration files and invocation parameters.
>>> Though I don't know, how to invoke it in such way from Xwiki.
>>>
>>> Do you have any suggestions/ideas?
>>
>> I gave a workaround in a comment on that issue, in case somebody else is
>> interested in this problem and wants an answer.


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] PDF with UTF characters

2010-02-04 Thread Valdis Vītoliņš
I learned how to add custom TTF font and metrics for FOP.
Test project can be downloaded from http://odo.lv/ftp/temp/FOP.zip
There are FOP jars and "Lucida Sans Unicode" TTF font with generated
metrics file.
Metrics can be created using generate_font_metrics.bat script. Test PDF
can be generated with test1.bat script. 

Now questions are:
How can I invoke customized FOP with additional parameter for my config
file from Xwiki?
Or how can I change default font From "Times-Roman" to "Lucida Sans
Unicode"?

Valdis

> On 02/01/2010 09:47 PM, Valdis Vītoliņš wrote:
> > I'm investigating issue http://jira.xwiki.org/jira/browse/XWIKI-4724
> > Now I can generate right PDF using separate FOP with additional
> > configuration files and invocation parameters.
> > Though I don't know, how to invoke it in such way from Xwiki.
> >
> > Do you have any suggestions/ideas?
> 
> I gave a workaround in a comment on that issue, in case somebody else is 
> interested in this problem and wants an answer.
> 


___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] PDF with UTF characters

2010-02-02 Thread Sergiu Dumitriu
On 02/01/2010 09:47 PM, Valdis Vītoliņš wrote:
> I'm investigating issue http://jira.xwiki.org/jira/browse/XWIKI-4724
> Now I can generate right PDF using separate FOP with additional
> configuration files and invocation parameters.
> Though I don't know, how to invoke it in such way from Xwiki.
>
> Do you have any suggestions/ideas?

I gave a workaround in a comment on that issue, in case somebody else is 
interested in this problem and wants an answer.

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] PDF with UTF characters

2010-02-01 Thread Valdis Vītoliņš
I'm investigating issue http://jira.xwiki.org/jira/browse/XWIKI-4724
Now I can generate right PDF using separate FOP with additional
configuration files and invocation parameters.
Though I don't know, how to invoke it in such way from Xwiki.

Do you have any suggestions/ideas?

Valdis
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users