Hi Pascal,

Effectively, I forgot to change Verdana-Bold to Verdana in Image1_Verdana.SVG.
Now it's work.
Thank you for your help.

However, my question is how to configure Fop PDF/A config.xml for SVG image whose svg font is not present in Fop config.xml (?

1/ Simple fo without SVG image

For simple fo:inline which use for example font-family="BlueHighway" and no font "BlueHighway" in config.xml,

With PDF renderer mode, FOP warn only but not fail
ATTENTION: Font "BlueHighway,normal,400" not found. Substituting with "any,normal,400".

With PDF/A renderer mode, FOP fail
ATTENTION: Font "BlueHighway,normal,400" not found. Substituting with "any,normal,400". org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman

A workarround of PDF/A fail consist to add the font "any" in config.xml

<!-- "any" font -->
<font metrics-url="file:D:/Fonts_110/PDF/TIMES.xml" kerning="no" embed-url="C:/Windows/Fonts/TIMES.ttf">
               <font-triplet name="any" style="normal" weight="normal"/>
       </font>
<font metrics-url="file:D:/Fonts_110/PDF/TIMESBD.xml" kerning="no" embed-url="C:/Windows/Fonts/TIMESBD.ttf">
               <font-triplet name="any" style="normal" weight="bold"/>
       </font>
<font metrics-url="file:D:/Fonts_110/PDF/TIMESI.xml" kerning="no" embed-url="C:/Windows/Fonts/TIMESI.ttf">
               <font-triplet name="any" style="italic" weight="normal"/>
       </font>
<font metrics-url="file:D:/Fonts_110/PDF/TIMESBI.xml" kerning="no" embed-url="C:/Windows/Fonts/TIMESBI.ttf">
               <font-triplet name="any" style="italic" weight="bold"/>
       </font>

2/ fo with SVG image
With PDF/A renderer mode, FOP fail, when the svg font is not present in config.xml ( "BlueHighway" for example ) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Helvetica

and the "any" font seems not to be used in this context.

Is there a solution ?
Thank.


Christian Pestel

christian.pes...@orange.fr


-----Message d'origine----- From: Pascal Sancho
Sent: Thursday, May 31, 2012 9:39 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Offending font: /Helvetica with PDF/A and SVG image

Hi Christian,

in your svg [Image1_Verdana.SVG], I read:
 font-family="'Verdana-Bold'"
witch is not a regular font-name.

You should use the font-weight property:
 font-family="'Verdana'" font-weight="bold"

that gives for me expected result.

Note that since Verdena-bold is not found, FOP uses the default font (ie
Helvetica), that explains why you get a PDF with Helvetica (not embedded).

Le 31/05/2012 00:42, Christian Pestel a écrit :
Hi Pascal,

Thank for your explanation, but I don't understand.
For explain my problem, I send you some couple of fo/pdfA examples with pdf
content not zipped.
I use Fop trunk May 07 2012

1/ The following example work fine :
MODELE_TEXTE_Verdana.fo110a.xml
     <fo:flow flow-name="xsl-region-body">
       <fo:block line-height="1.2">
         <fo:inline font-family="Verdana"
font-size="12pt">HELLO</fo:inline></fo:block>
     </fo:flow>

Pdf is ok : the font Verdana is  embeded in pdf/A

2/ The following example work also fine :
MODELE_IMAGES_SVG_Times.fo110a.xml
<fo:flow flow-name="xsl-region-body">
   <fo:block line-height="1.2">
     <fo:inline>
       <fo:external-graphic
src="file:///C:/ExternalImagesV5/Image1_Times.SVG" height="0.52cm"
width="10.78cm" content-height="scale-to-fit" content-width="scale-to-fit"
scaling="non-uniform"></fo:external-graphic>
     </fo:inline>
   </fo:block>
</fo:flow>

Pdf is ok : the font TimesNewRoman is referenced in pdf/A

Here partial extract content of Image1_Times.SVG
<text transform="matrix(1 0 0 1 31.8848 18.5073)" fill="#FFFFFF"
font-family="'Times'" font-size="14">VOTRE BILAN ASSURANCES</text>

3/ The following example don't work  :
MODELE_IMAGES_SVG_Verdana.fo110a.xml
<fo:flow flow-name="xsl-region-body">
   <fo:block line-height="1.2">
     <fo:inline>
       <fo:external-graphic
src="file:///C:/ExternalImagesV5/Image1_Verdana.SVG" height="0.52cm"
width="10.78cm" content-height="scale-to-fit" content-width="scale-to-fit"
scaling="non-uniform"></fo:external-graphic>
     </fo:inline>
   </fo:block>
</fo:flow>

Here partial extract content of Image1_Verdana.SVG
<text transform="matrix(1 0 0 1 31.8848 18.5073)" fill="#FFFFFF"
font-family="'Verdana'" font-size="14">VOTRE BILAN ASSURANCES</text>

Pdf is ko : the font Helvetiva is referenced in pdf/A instead of Verdana.
Why ?
May be some pb with  Batik ?


Christian Pestel

christian.pes...@orange.fr


-----Message d'origine-----
From: Pascal Sancho
Sent: Wednesday, May 30, 2012 5:13 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Offending font: /Helvetica with PDF/A and SVG image

Hi,

2 other topics rise here:

1/ Only metrics for base 14 fonts are provided by FOP.
fonts files are not embedded.
used font files depends on what is installed on the system of PDF reader:
When Helvetica is set, usually, Arial is used on Win systems, Helvetica
on Mac.
For those both fonts, metrics are equivalent, not glyphes shapes.
This explains why you don't need to embed font files for regular PDF
when you use base 14 fonts.

2/ For SVG, fonts must be available for both FOP (via config file), and
Batik (witch picks system font data via the java AWT package.

Le 30/05/2012 15:12, Christian Pestel a écrit :
Hi Pascal,

I don't understand why a simple fo file with texte fo:block
font-family="Helvetica" work fine in PDF-A (no license problem)
and an fo file with SVG image don't work.


Christian Pestel

christian.pes...@orange.fr


-----Message d'origine-----
From: Pascal Sancho
Sent: Wednesday, May 30, 2012 9:12 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Offending font: /Helvetica with PDF/A and SVG image

Hi,

embedding fonts is required by the PDF/A-1b spec, even when you use some
of base 14 fonts.

Since there is license restriction with Helvetica (and other base 14)
font, it is not embedded by default. You have to get it by yourself (you
can purchase it on vendor's web site).

Or you can use another font that is free of charge, like dejaVu (see [1]).

[1] http://dejavu-fonts.org/wiki/Main_Page

Le 29/05/2012 18:48, Christian Pestel a écrit :
Hi Developpers,
I have this fop error with PDF/A and SVG image :
org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts,
even the base 14 fonts, have to be embedded! Offending font: /Helvetica
no problem with an .JPG image
Here is my fo file :
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions";>
<fo:layout-master-set>
<fo:simple-page-master master-name="Section_1-Iteration_1"
page-width="21cm" page-height="29.7cm" margin-top="0.5cm"
margin-bottom="1cm" margin-right="2.5cm" margin-left="2.5cm">
<fo:region-body margin-top="2cm" margin-bottom="1.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence initial-page-number="1"
master-reference="Section_1-Iteration_1">
<fo:flow flow-name="xsl-region-body">
<fo:block line-height="1.2">
<fo:inline font-family="Times" font-size="12pt">
<fo:external-graphic src="file:///C:Temp/Image1.SVG" height="0.52cm"
width="10.78cm" content-height="scale-to-fit"
content-width="scale-to-fit" scaling="non-uniform"></fo:external-graphic>
</fo:inline>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>

I send you my files : .fo, userconfig.xml, image1.svg

Note that I add the font “any” in my userconfig.xml for a PDF/A
workarround for fonts used in the fo but that are not present in the
UserConfig


--
Pascal

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

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

Reply via email to