You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Torkild Ulvøy Resheim <tr...@online.no> on 2001/02/01 15:02:09 UTC

Adding fonts

I've added an EAN13 font to FOP using the procedure described on your web-pages and everything seems ok until I try to open the resulting PDF document. Then Acrobat Reader complains that an error occured and the page cannot be opened. I know this has to do with the font's and I noticed that the EAN13 font was not embedded so I've tried to add it to the Acrobat resource catalog but the problem is still there. Any ideas?
--

  Torkild Ulvøy Resheim, Sofware Engineer at Emma EDB AS     ((
  Work: http://www.emmaedb.no/, torkild.resheim@emmaedb.no    ))  
  Private homepage: http://www.tihlde.org/~torkildr         |----|_
  <math>2+2=5 for sufficiently large values of 2</math>     |    | )
                                                            |____|´





---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


RE: EAN13 (was: Re: Adding fonts)

Posted by Jarno Elovirta <ja...@codeonline.com>.

> -----Original Message-----
> From: Torkild Ulvøy Resheim [mailto:tresheim@online.no]
> Sent: 2. helmikuuta 2001 14:25
> To: fop-dev@xml.apache.org
> Subject: Re: EAN13 (was: Re: Adding fonts)
>
>
> In the "draw-bars" template of "barcode-EAN-SVG.xsl" there is a
> test that determines if there are more bars to draw, like this:
>
> <xsl:if test="substring($bar-and-space-widths, 3)">
>
> I suspect that this test would normally return false if the
> string is shorter than 3 characters, but this is not the case
> when using Xalan. So I've replaced the test with the following code:

A bug in Xalan. I reported this last (or was it this) week and the fixed
now.

Jarno


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: EAN13 (was: Re: Adding fonts)

Posted by Torkild Ulvøy Resheim <tr...@online.no>.
In the "draw-bars" template of "barcode-EAN-SVG.xsl" there is a test that determines if there are more bars to draw, like this:

<xsl:if test="substring($bar-and-space-widths, 3)">

I suspect that this test would normally return false if the string is shorter than 3 characters, but this is not the case when using Xalan. So I've replaced the test with the following code:

<xsl:if test="string-length($bar-and-space-widths)>=3">

This works OK, but now FOP reports a NoSuchMethodError in SVGRenderer.applyStyle().
--
  Torkild Ulvøy Resheim, Sofware Engineer at Emma EDB AS     ((
  Work: http://www.emmaedb.no/, torkild.resheim@emmaedb.no    ))  
  Private homepage: http://www.tihlde.org/~torkildr         |----|_
  <math>2+2=5 for sufficiently large values of 2</math>     |    | )
                                                            |____|´



----- Original Message ----- 
From: "Torkild Ulvøy Resheim" <tr...@online.no>
To: <fo...@xml.apache.org>
Sent: Friday, February 02, 2001 12:57 PM
Subject: Re: EAN13 (was: Re: Adding fonts)


Yes, I've tried the SVG type... It does not work. I keep getting StringIndexOutOfBoundsException's when performing the transformation. I've so far narrowed it down to the SVG stylesheet.
[snip]


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: EAN13 (was: Re: Adding fonts)

Posted by Torkild Ulvøy Resheim <tr...@online.no>.
Yes, I've tried the SVG type... It does not work. I keep getting StringIndexOutOfBoundsException's when performing the transformation. I've so far narrowed it down to the SVG stylesheet.
--
  Torkild Ulvøy Resheim, Sofware Engineer at Emma EDB AS     ((
  Work: http://www.emmaedb.no/, torkild.resheim@emmaedb.no    ))  
  Private homepage: http://www.tihlde.org/~torkildr         |----|_
  <math>2+2=5 for sufficiently large values of 2</math>     |    | )
                                                            |____|´



----- Original Message ----- 
From: "Nikolai Grigoriev" <gr...@renderx.com>
To: <fo...@xml.apache.org>
Sent: Friday, February 02, 2001 12:01 PM
Subject: Re: EAN13 (was: Re: Adding fonts)
[snip]
> 
> Actually, there are _TWO_ different stylesheets there (sharing the pattern
> calculation subroutines). One generates XSL FO - representing barcodes as an
> <fo:table>. The other one produces the same pattern as plain SVG - something
> like this:
> 
> <svg:svg height="..." width="...">
>   <svg:rect height="..." width="..." x="..." y="..." style="fill: black;"/>
>   ....
> </svg>
> 
> Have you tried to insert this into your document through
> <fo:instream-foreign-object>? I suspect this is an easier (and, IMHO, more
> natural) way of handling barcodes, as you don't need any table support at all.
> 
> Regards,
> Nikolai
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: EAN13 (was: Re: Adding fonts)

Posted by Nikolai Grigoriev <gr...@renderx.com>.
> Thanks :-) Nikolai's style sheets does use the fo:table-row
> height parameter. I'll look into TableRow.java.

Actually, there are _TWO_ different stylesheets there (sharing the pattern
calculation subroutines). One generates XSL FO - representing barcodes as an
<fo:table>. The other one produces the same pattern as plain SVG - something
like this:

<svg:svg height="..." width="...">
  <svg:rect height="..." width="..." x="..." y="..." style="fill: black;"/>
  ....
</svg>

Have you tried to insert this into your document through
<fo:instream-foreign-object>? I suspect this is an easier (and, IMHO, more
natural) way of handling barcodes, as you don't need any table support at all.

Regards,
Nikolai




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: EAN13 (was: Re: Adding fonts)

Posted by Torkild Ulvøy Resheim <tr...@online.no>.
Thanks :-) Nikolai's style sheets does use the fo:table-row height parameter. I'll look into TableRow.java.
--
  Torkild Ulvøy Resheim, Sofware Engineer at Emma EDB AS     ((
  Work: http://www.emmaedb.no/, torkild.resheim@emmaedb.no    ))  
  Private homepage: http://www.tihlde.org/~torkildr         |----|_
  <math>2+2=5 for sufficiently large values of 2</math>     |    | )
                                                            |____|´



----- Original Message ----- 
From: "Jarno Elovirta" <ja...@codeonline.com>
To: <fo...@xml.apache.org>
Sent: Friday, February 02, 2001 11:23 AM
Subject: RE: EAN13 (was: Re: Adding fonts)
[snip]
> I didn't check Nikolai's style sheets, but I would guess the problem is that
> they use height property on fo:table-row and FOP doesn't implement it yet. I
> just added the height property to TableRow.java (as a quick hack) when I
> wanted to test my style sheets that generate Code 128 C bar code and it
> worked ok in my case. Anybody working on height property in fo:table-row?
> 
> Jarno
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


RE: EAN13 (was: Re: Adding fonts)

Posted by Jarno Elovirta <ja...@codeonline.com>.
> Thanks for the excellent tip :-), it works nicely except for one
> (major) flaw. The bar heights are all wrong, they end up being
> around 1mm tall. I suspect this is because of FOP but I don't
> have any idea why. I've been looking at the code trying to
> hardcode the bar heights but it does not help.

I didn't check Nikolai's style sheets, but I would guess the problem is that
they use height property on fo:table-row and FOP doesn't implement it yet. I
just added the height property to TableRow.java (as a quick hack) when I
wanted to test my style sheets that generate Code 128 C bar code and it
worked ok in my case. Anybody working on height property in fo:table-row?

Jarno


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: EAN13 (was: Re: Adding fonts)

Posted by Torkild Ulvøy Resheim <tr...@online.no>.
Thanks for the excellent tip :-), it works nicely except for one (major) flaw. The bar heights are all wrong, they end up being around 1mm tall. I suspect this is because of FOP but I don't have any idea why. I've been looking at the code trying to hardcode the bar heights but it does not help.
--
  Torkild Ulvøy Resheim, Sofware Engineer at Emma EDB AS     ((
  Work: http://www.emmaedb.no/, torkild.resheim@emmaedb.no    ))  
  Private homepage: http://www.tihlde.org/~torkildr         |----|_
  <math>2+2=5 for sufficiently large values of 2</math>     |    | )
                                                            |____|´



----- Original Message ----- 
From: "Nikolai Grigoriev" <gr...@renderx.com>
To: <fo...@xml.apache.org>
Sent: Thursday, February 01, 2001 11:51 PM
Subject: EAN13 (was: Re: Adding fonts)
[snip]
> 
> I'd like to draw your attention to this page:
> 
> http://www.renderx.com/barcodes.html
> 
> It is a barcode generator for EAN8/EAN13/UPC-A/UPC-E written in XSLT. Thanks to
> Andriy Palamarchuk, it can now produce SVG output; you could insert an SVG
> graphic instead of a custom font into your FOP document. The thing is completely
> free.
> 
> Sorry for a shameless self-promotion :-(.
> 
> Regards,
> Nikolai Grigoriev
> RenderX
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


EAN13 (was: Re: Adding fonts)

Posted by Nikolai Grigoriev <gr...@renderx.com>.
Torkild Ulvøy Resheim <tr...@online.no> wrote:


> I've added an EAN13 font to FOP using the procedure described
> on your web-pages and everything seems ok until I try to open
> the resulting PDF document. Then Acrobat Reader complains
> that an error occured and the page cannot be opened. I know
> this has to do with the font's and I noticed that the EAN13
> font was not embedded so I've tried to add it to the Acrobat
> resource catalog but the problem is still there. Any ideas?

I'd like to draw your attention to this page:

http://www.renderx.com/barcodes.html

It is a barcode generator for EAN8/EAN13/UPC-A/UPC-E written in XSLT. Thanks to
Andriy Palamarchuk, it can now produce SVG output; you could insert an SVG
graphic instead of a custom font into your FOP document. The thing is completely
free.

Sorry for a shameless self-promotion :-(.

Regards,
Nikolai Grigoriev
RenderX



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Adding fonts

Posted by Jeremias Maerki <je...@outline.ch>.
> I've added an EAN13 font to FOP using the procedure described on your
> web-pages and everything seems ok until I try to open the resulting PDF
> document. Then Acrobat Reader complains that an error occured and the
> page cannot be opened. I know this has to do with the font's and I
> noticed that the EAN13 font was not embedded so I've tried to add it to
> the Acrobat resource catalog but the problem is still there. Any ideas?

The problem might be in the XML file generated by the PFMReader tool.
There are certain flags that may not have been correctly set by just
interpreting the PFM file. Maybe there's a bug.
If you have Adobe Acrobat (not just Reader), you can generate a file
containing a barcode using Word for example. When you open the resulting
PDF in a text editor you should be able to read the flags for the font set
by Acrobat. Then you can adjust the XML file for your EAN13 font
accordingly. This approach worked for me once. If that doesn't work
maybe you should post the XML font file to the list.

References: PDF Specs 1.3 and PFM Specs (Adobe Technical Note #5178)

Regards
Jeremias Märki

mailto:jeremias.maerki@outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Adding fonts

Posted by Fotis Jannidis <fo...@lrz.uni-muenchen.de>.
From:           	Torkild Ulvøy Resheim <tr...@online.no>

Embedding fonts is not supported yet, but the code is there and 
should be in cvs next week.

Fotis

> I've added an EAN13 font to FOP using the procedure described on your web-pages and everything seems ok until I try to open the resulting PDF document. Then Acrobat Reader complains that an error occured and the page cannot be opened. I know this has to do with the font's and I noticed that the 
EAN13 font was not embedded so I've tried to add it to the Acrobat resource catalog but the problem is still there. Any ideas?
> --
> 
>   Torkild Ulvøy Resheim, Sofware Engineer at Emma EDB AS     ((
>   Work: http://www.emmaedb.no/, torkild.resheim@emmaedb.no    ))  
>   Private homepage: http://www.tihlde.org/~torkildr         |----|_
>   <math>2+2=5 for sufficiently large values of 2</math>     |    | )
>                                                             |____|´
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org