You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Mathieu Leplatre <ma...@mfi.fr> on 2006/04/06 15:27:58 UTC

Arabic characters position ( SVG to PDF )

Hi all,

I use fop to convert SVG files to PDF.

My SVG contains UTF8 strings in arabic (direction right to left).
Encoding and such characters are supported but the words are misplaced 
(it looks like the origin (x,y) is placed at ( x + lenght, y ).

Here is an example to figure it out :
http://leplatre.free.fr/pub/examplearabic.png

Is it a known bug ? I didn't see anything about this in 0.92 change log...

Does someone know a trick for this ?

Thank you very much

Mathieu.

-- 
Mathieu Leplatre
Météo France International



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Arabic characters position ( SVG to PDF )

Posted by Mathieu Leplatre <ma...@mfi.fr>.
Thank you Jeremias,
I sorted out all my problems with your help !

Greetings from France

Mathieu

Jeremias Maerki wrote:
> On the other side, your arabic.svg example doesn't display in either
> Adobe SVG Reader or Firefox. Looking closely at the SVG itself, I see
> that there's "writing-mode:lr-tb" which is certainly wrong for Arabic
> text. I think the problem's in Inkscape, not in Batik or FOP. If you
> manually remove the writing-mode from the tspan and instead specify
> "writing-mode:rl-tb" on the "text" element and use Arial instead of
> Bitstream Vera Sans (which is not on my machine), then the SVG displays
> correctly in Adobe SVG Reader and Batik Squiggle.
>
> On 07.04.2006 10:46:59 Mathieu Leplatre wrote:
>   
>> I tried the PDFTranscoder (0.20.5 and 0.91b) and had the same problems...
>> The words are still misplaced.
>> (I guess Squiggle suffer the same problems then...)
>>
>> Here is how it comes out :
>> http://leplatre.free.fr/pub/arabicmisplaced.png
>>
>> I couldn't find any method of the FOUserAgent (or any XMLHandler class 
>> to add neither) to disable PDFTextPainter with XSL-FO programmatically.
>>
>> Thanks you so much for your help so far
>>
>> Mathieu.
>>
>> Jeremias Maerki wrote:
>>     
>>> You can also convert SVG to PDF directly by using Apache Batik's
>>> Transcoder API. For PDF you can use the class
>>> org.apache.fop.svg.PDFTranscoder.
>>>
>>> See:
>>> http://xmlgraphics.apache.org/batik/rasterizerTutorial.html
>>>
>>> The example here is not the same as the one you reported the problem for.
>>> The SVG looks fine in Batik's Squiggle (the SVG browser) and in Acrobat
>>> Reader when generated with FOP's PDFTranscoder.
>>>
>>> The configuration file I'm talking about is described here:
>>> http://xmlgraphics.apache.org/fop/latest/configuration.html
>>>
>>>
>>> On 06.04.2006 15:59:48 Mathieu Leplatre wrote:
>>>   
>>>       
>>>> I use XSL-FO because I didn't know there was another way to do it.
>>>>
>>>> Here is a svg file :
>>>> leplatre.free.fr/pub/arabic.svg
>>>>
>>>> Here is the XSL I made :
>>>> http://leplatre.free.fr/pub/embed.xsl
>>>>
>>>> ...sorry my question will sound stupid but in which configuration file 
>>>> can I put this xml-handler tag ?
>>>>
>>>> Thank you Jeremias for your extremely fast reaction time !
>>>>
>>>> Jeremias Maerki wrote:
>>>>     
>>>>         
>>>>> It could be a flaw in the PDFTextPainter. If you provide a sample SVG
>>>>> file I can verify that. You don't say if you're converting through the
>>>>> PDFTranscoder or via XSL-FO. If you go via XSL-FO you can set:
>>>>>
>>>>>       <xml-handler namespace="http://www.w3.org/2000/svg">
>>>>>         <stroke-text>true</stroke-text>
>>>>>       </xml-handler>
>>>>>
>>>>> ...as a direct child of the "renderer" element for the PDF renderer in
>>>>> the configuration file.
>>>>>
>>>>> The PDFTranscoder currently doesn't support disabling the PDFTextPainter.
>>>>>
>>>>> Note: The above is only tested on the latest FOP Trunk. I can't
>>>>> guarantee without verifying if 0.91beta behaves the same way.
>>>>>
>>>>> On 06.04.2006 15:27:58 Mathieu Leplatre wrote:
>>>>>   
>>>>>       
>>>>>           
>>>>>> Hi all,
>>>>>>
>>>>>> I use fop to convert SVG files to PDF.
>>>>>>
>>>>>> My SVG contains UTF8 strings in arabic (direction right to left).
>>>>>> Encoding and such characters are supported but the words are misplaced 
>>>>>> (it looks like the origin (x,y) is placed at ( x + lenght, y ).
>>>>>>
>>>>>> Here is an example to figure it out :
>>>>>> http://leplatre.free.fr/pub/examplearabic.png
>>>>>>
>>>>>> Is it a known bug ? I didn't see anything about this in 0.92 change log...
>>>>>>
>>>>>> Does someone know a trick for this ?
>>>>>>         
>>>>>>             
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>   

-- 
Mathieu Leplatre
Météo France International
GSM: +974 579 3608
Fax: +974 436 5086


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Arabic characters position ( SVG to PDF )

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On the other side, your arabic.svg example doesn't display in either
Adobe SVG Reader or Firefox. Looking closely at the SVG itself, I see
that there's "writing-mode:lr-tb" which is certainly wrong for Arabic
text. I think the problem's in Inkscape, not in Batik or FOP. If you
manually remove the writing-mode from the tspan and instead specify
"writing-mode:rl-tb" on the "text" element and use Arial instead of
Bitstream Vera Sans (which is not on my machine), then the SVG displays
correctly in Adobe SVG Reader and Batik Squiggle.

On 07.04.2006 10:46:59 Mathieu Leplatre wrote:
> I tried the PDFTranscoder (0.20.5 and 0.91b) and had the same problems...
> The words are still misplaced.
> (I guess Squiggle suffer the same problems then...)
> 
> Here is how it comes out :
> http://leplatre.free.fr/pub/arabicmisplaced.png
> 
> I couldn't find any method of the FOUserAgent (or any XMLHandler class 
> to add neither) to disable PDFTextPainter with XSL-FO programmatically.
> 
> Thanks you so much for your help so far
> 
> Mathieu.
> 
> Jeremias Maerki wrote:
> > You can also convert SVG to PDF directly by using Apache Batik's
> > Transcoder API. For PDF you can use the class
> > org.apache.fop.svg.PDFTranscoder.
> >
> > See:
> > http://xmlgraphics.apache.org/batik/rasterizerTutorial.html
> >
> > The example here is not the same as the one you reported the problem for.
> > The SVG looks fine in Batik's Squiggle (the SVG browser) and in Acrobat
> > Reader when generated with FOP's PDFTranscoder.
> >
> > The configuration file I'm talking about is described here:
> > http://xmlgraphics.apache.org/fop/latest/configuration.html
> >
> >
> > On 06.04.2006 15:59:48 Mathieu Leplatre wrote:
> >   
> >> I use XSL-FO because I didn't know there was another way to do it.
> >>
> >> Here is a svg file :
> >> leplatre.free.fr/pub/arabic.svg
> >>
> >> Here is the XSL I made :
> >> http://leplatre.free.fr/pub/embed.xsl
> >>
> >> ...sorry my question will sound stupid but in which configuration file 
> >> can I put this xml-handler tag ?
> >>
> >> Thank you Jeremias for your extremely fast reaction time !
> >>
> >> Jeremias Maerki wrote:
> >>     
> >>> It could be a flaw in the PDFTextPainter. If you provide a sample SVG
> >>> file I can verify that. You don't say if you're converting through the
> >>> PDFTranscoder or via XSL-FO. If you go via XSL-FO you can set:
> >>>
> >>>       <xml-handler namespace="http://www.w3.org/2000/svg">
> >>>         <stroke-text>true</stroke-text>
> >>>       </xml-handler>
> >>>
> >>> ...as a direct child of the "renderer" element for the PDF renderer in
> >>> the configuration file.
> >>>
> >>> The PDFTranscoder currently doesn't support disabling the PDFTextPainter.
> >>>
> >>> Note: The above is only tested on the latest FOP Trunk. I can't
> >>> guarantee without verifying if 0.91beta behaves the same way.
> >>>
> >>> On 06.04.2006 15:27:58 Mathieu Leplatre wrote:
> >>>   
> >>>       
> >>>> Hi all,
> >>>>
> >>>> I use fop to convert SVG files to PDF.
> >>>>
> >>>> My SVG contains UTF8 strings in arabic (direction right to left).
> >>>> Encoding and such characters are supported but the words are misplaced 
> >>>> (it looks like the origin (x,y) is placed at ( x + lenght, y ).
> >>>>
> >>>> Here is an example to figure it out :
> >>>> http://leplatre.free.fr/pub/examplearabic.png
> >>>>
> >>>> Is it a known bug ? I didn't see anything about this in 0.92 change log...
> >>>>
> >>>> Does someone know a trick for this ?
> >>>>         


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Arabic characters position ( SVG to PDF )

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 06.04.2006 16:46:04 Mathieu Leplatre wrote:
> ...actually I want vectorial content, not to rasterize my SVG files.
> I have the same problem with this example and XSL-FO.

The "rasterizer" part in the URL can be misleading. The output is vector
graphics where possible in the case of PDF.

<snip/>


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Arabic characters position ( SVG to PDF )

Posted by Mathieu Leplatre <ma...@mfi.fr>.
...actually I want vectorial content, not to rasterize my SVG files.
I have the same problem with this example and XSL-FO.

Ok I'll look where to put this configuration when using fop from a java 
code...

Thank you

Mathieu

Jeremias Maerki wrote:
> You can also convert SVG to PDF directly by using Apache Batik's
> Transcoder API. For PDF you can use the class
> org.apache.fop.svg.PDFTranscoder.
>
> See:
> http://xmlgraphics.apache.org/batik/rasterizerTutorial.html
>
> The example here is not the same as the one you reported the problem for.
> The SVG looks fine in Batik's Squiggle (the SVG browser) and in Acrobat
> Reader when generated with FOP's PDFTranscoder.
>
> The configuration file I'm talking about is described here:
> http://xmlgraphics.apache.org/fop/latest/configuration.html
>
>
> On 06.04.2006 15:59:48 Mathieu Leplatre wrote:
>   
>> I use XSL-FO because I didn't know there was another way to do it.
>>
>> Here is a svg file :
>> leplatre.free.fr/pub/arabic.svg
>>
>> Here is the XSL I made :
>> http://leplatre.free.fr/pub/embed.xsl
>>
>> ...sorry my question will sound stupid but in which configuration file 
>> can I put this xml-handler tag ?
>>
>> Thank you Jeremias for your extremely fast reaction time !
>>
>> Jeremias Maerki wrote:
>>     
>>> It could be a flaw in the PDFTextPainter. If you provide a sample SVG
>>> file I can verify that. You don't say if you're converting through the
>>> PDFTranscoder or via XSL-FO. If you go via XSL-FO you can set:
>>>
>>>       <xml-handler namespace="http://www.w3.org/2000/svg">
>>>         <stroke-text>true</stroke-text>
>>>       </xml-handler>
>>>
>>> ...as a direct child of the "renderer" element for the PDF renderer in
>>> the configuration file.
>>>
>>> The PDFTranscoder currently doesn't support disabling the PDFTextPainter.
>>>
>>> Note: The above is only tested on the latest FOP Trunk. I can't
>>> guarantee without verifying if 0.91beta behaves the same way.
>>>
>>> On 06.04.2006 15:27:58 Mathieu Leplatre wrote:
>>>   
>>>       
>>>> Hi all,
>>>>
>>>> I use fop to convert SVG files to PDF.
>>>>
>>>> My SVG contains UTF8 strings in arabic (direction right to left).
>>>> Encoding and such characters are supported but the words are misplaced 
>>>> (it looks like the origin (x,y) is placed at ( x + lenght, y ).
>>>>
>>>> Here is an example to figure it out :
>>>> http://leplatre.free.fr/pub/examplearabic.png
>>>>
>>>> Is it a known bug ? I didn't see anything about this in 0.92 change log...
>>>>
>>>> Does someone know a trick for this ?
>>>>         
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>   

-- 
Mathieu Leplatre
Météo France International
GSM: +974 579 3608
Fax: +974 436 5086


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Arabic characters position ( SVG to PDF )

Posted by Mathieu Leplatre <ma...@mfi.fr>.
I tried the PDFTranscoder (0.20.5 and 0.91b) and had the same problems...
The words are still misplaced.
(I guess Squiggle suffer the same problems then...)

Here is how it comes out :
http://leplatre.free.fr/pub/arabicmisplaced.png

I couldn't find any method of the FOUserAgent (or any XMLHandler class 
to add neither) to disable PDFTextPainter with XSL-FO programmatically.

Thanks you so much for your help so far

Mathieu.

Jeremias Maerki wrote:
> You can also convert SVG to PDF directly by using Apache Batik's
> Transcoder API. For PDF you can use the class
> org.apache.fop.svg.PDFTranscoder.
>
> See:
> http://xmlgraphics.apache.org/batik/rasterizerTutorial.html
>
> The example here is not the same as the one you reported the problem for.
> The SVG looks fine in Batik's Squiggle (the SVG browser) and in Acrobat
> Reader when generated with FOP's PDFTranscoder.
>
> The configuration file I'm talking about is described here:
> http://xmlgraphics.apache.org/fop/latest/configuration.html
>
>
> On 06.04.2006 15:59:48 Mathieu Leplatre wrote:
>   
>> I use XSL-FO because I didn't know there was another way to do it.
>>
>> Here is a svg file :
>> leplatre.free.fr/pub/arabic.svg
>>
>> Here is the XSL I made :
>> http://leplatre.free.fr/pub/embed.xsl
>>
>> ...sorry my question will sound stupid but in which configuration file 
>> can I put this xml-handler tag ?
>>
>> Thank you Jeremias for your extremely fast reaction time !
>>
>> Jeremias Maerki wrote:
>>     
>>> It could be a flaw in the PDFTextPainter. If you provide a sample SVG
>>> file I can verify that. You don't say if you're converting through the
>>> PDFTranscoder or via XSL-FO. If you go via XSL-FO you can set:
>>>
>>>       <xml-handler namespace="http://www.w3.org/2000/svg">
>>>         <stroke-text>true</stroke-text>
>>>       </xml-handler>
>>>
>>> ...as a direct child of the "renderer" element for the PDF renderer in
>>> the configuration file.
>>>
>>> The PDFTranscoder currently doesn't support disabling the PDFTextPainter.
>>>
>>> Note: The above is only tested on the latest FOP Trunk. I can't
>>> guarantee without verifying if 0.91beta behaves the same way.
>>>
>>> On 06.04.2006 15:27:58 Mathieu Leplatre wrote:
>>>   
>>>       
>>>> Hi all,
>>>>
>>>> I use fop to convert SVG files to PDF.
>>>>
>>>> My SVG contains UTF8 strings in arabic (direction right to left).
>>>> Encoding and such characters are supported but the words are misplaced 
>>>> (it looks like the origin (x,y) is placed at ( x + lenght, y ).
>>>>
>>>> Here is an example to figure it out :
>>>> http://leplatre.free.fr/pub/examplearabic.png
>>>>
>>>> Is it a known bug ? I didn't see anything about this in 0.92 change log...
>>>>
>>>> Does someone know a trick for this ?
>>>>         
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>   

-- 
Mathieu Leplatre
Météo France International
GSM: +974 579 3608
Fax: +974 436 5086


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Arabic characters position ( SVG to PDF )

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
You can also convert SVG to PDF directly by using Apache Batik's
Transcoder API. For PDF you can use the class
org.apache.fop.svg.PDFTranscoder.

See:
http://xmlgraphics.apache.org/batik/rasterizerTutorial.html

The example here is not the same as the one you reported the problem for.
The SVG looks fine in Batik's Squiggle (the SVG browser) and in Acrobat
Reader when generated with FOP's PDFTranscoder.

The configuration file I'm talking about is described here:
http://xmlgraphics.apache.org/fop/latest/configuration.html


On 06.04.2006 15:59:48 Mathieu Leplatre wrote:
> I use XSL-FO because I didn't know there was another way to do it.
> 
> Here is a svg file :
> leplatre.free.fr/pub/arabic.svg
> 
> Here is the XSL I made :
> http://leplatre.free.fr/pub/embed.xsl
> 
> ...sorry my question will sound stupid but in which configuration file 
> can I put this xml-handler tag ?
> 
> Thank you Jeremias for your extremely fast reaction time !
> 
> Jeremias Maerki wrote:
> > It could be a flaw in the PDFTextPainter. If you provide a sample SVG
> > file I can verify that. You don't say if you're converting through the
> > PDFTranscoder or via XSL-FO. If you go via XSL-FO you can set:
> >
> >       <xml-handler namespace="http://www.w3.org/2000/svg">
> >         <stroke-text>true</stroke-text>
> >       </xml-handler>
> >
> > ...as a direct child of the "renderer" element for the PDF renderer in
> > the configuration file.
> >
> > The PDFTranscoder currently doesn't support disabling the PDFTextPainter.
> >
> > Note: The above is only tested on the latest FOP Trunk. I can't
> > guarantee without verifying if 0.91beta behaves the same way.
> >
> > On 06.04.2006 15:27:58 Mathieu Leplatre wrote:
> >   
> >> Hi all,
> >>
> >> I use fop to convert SVG files to PDF.
> >>
> >> My SVG contains UTF8 strings in arabic (direction right to left).
> >> Encoding and such characters are supported but the words are misplaced 
> >> (it looks like the origin (x,y) is placed at ( x + lenght, y ).
> >>
> >> Here is an example to figure it out :
> >> http://leplatre.free.fr/pub/examplearabic.png
> >>
> >> Is it a known bug ? I didn't see anything about this in 0.92 change log...
> >>
> >> Does someone know a trick for this ?



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Arabic characters position ( SVG to PDF )

Posted by Mathieu Leplatre <ma...@mfi.fr>.
I use XSL-FO because I didn't know there was another way to do it.

Here is a svg file :
leplatre.free.fr/pub/arabic.svg

Here is the XSL I made :
http://leplatre.free.fr/pub/embed.xsl

...sorry my question will sound stupid but in which configuration file 
can I put this xml-handler tag ?

Thank you Jeremias for your extremely fast reaction time !

Jeremias Maerki wrote:
> It could be a flaw in the PDFTextPainter. If you provide a sample SVG
> file I can verify that. You don't say if you're converting through the
> PDFTranscoder or via XSL-FO. If you go via XSL-FO you can set:
>
>       <xml-handler namespace="http://www.w3.org/2000/svg">
>         <stroke-text>true</stroke-text>
>       </xml-handler>
>
> ...as a direct child of the "renderer" element for the PDF renderer in
> the configuration file.
>
> The PDFTranscoder currently doesn't support disabling the PDFTextPainter.
>
> Note: The above is only tested on the latest FOP Trunk. I can't
> guarantee without verifying if 0.91beta behaves the same way.
>
> On 06.04.2006 15:27:58 Mathieu Leplatre wrote:
>   
>> Hi all,
>>
>> I use fop to convert SVG files to PDF.
>>
>> My SVG contains UTF8 strings in arabic (direction right to left).
>> Encoding and such characters are supported but the words are misplaced 
>> (it looks like the origin (x,y) is placed at ( x + lenght, y ).
>>
>> Here is an example to figure it out :
>> http://leplatre.free.fr/pub/examplearabic.png
>>
>> Is it a known bug ? I didn't see anything about this in 0.92 change log...
>>
>> Does someone know a trick for this ?
>>
>> Thank you very much
>>     
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>   

-- 
Mathieu Leplatre
Météo France International
GSM: +974 579 3608
Fax: +974 436 5086


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Arabic characters position ( SVG to PDF )

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
It could be a flaw in the PDFTextPainter. If you provide a sample SVG
file I can verify that. You don't say if you're converting through the
PDFTranscoder or via XSL-FO. If you go via XSL-FO you can set:

      <xml-handler namespace="http://www.w3.org/2000/svg">
        <stroke-text>true</stroke-text>
      </xml-handler>

...as a direct child of the "renderer" element for the PDF renderer in
the configuration file.

The PDFTranscoder currently doesn't support disabling the PDFTextPainter.

Note: The above is only tested on the latest FOP Trunk. I can't
guarantee without verifying if 0.91beta behaves the same way.

On 06.04.2006 15:27:58 Mathieu Leplatre wrote:
> Hi all,
> 
> I use fop to convert SVG files to PDF.
> 
> My SVG contains UTF8 strings in arabic (direction right to left).
> Encoding and such characters are supported but the words are misplaced 
> (it looks like the origin (x,y) is placed at ( x + lenght, y ).
> 
> Here is an example to figure it out :
> http://leplatre.free.fr/pub/examplearabic.png
> 
> Is it a known bug ? I didn't see anything about this in 0.92 change log...
> 
> Does someone know a trick for this ?
> 
> Thank you very much



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org