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 Eva Chang <Ev...@prudential.com> on 2015/09/24 15:48:36 UTC

alternate text extension not working in FOP version 2.0

Hi,

Trying to use xsl-fo to generate a  pdf for accessibility compliance. Need 
to add alternate text to images as the first thing. Getting the latest 
version of FOP 2.0 and follow the example on the website. I've test it 
with simply one image on the pdf and pdf was generated without any error. 
However, after opening the document and ran a full check for accessibility 
still see the warning for missing alternate text on the image and the only 
way to fix it would be manually apply the alternate text through acrobat. 
The namespace I was using is "http://xmlgraphics.apache.org/fop/extensions
", not sure if it is still a valid one to use. I've tried searching for 
solutions online and couldn't find anyone has similar problem as I do. 
Please let me know if you guys know what's the possible problem that 
alternate-text is not showing without any error message.


Thanks,
Eva


Re: alternate text extension not working in FOP version 2.0

Posted by Eva <di...@hotmail.com>.
Hi Chris,

Yes, the first thing I did was to enable accessibility in the config. Thanks
for your help, really appreciated.

Eva



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42978.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: font question (was Re: alternate text extension not working in FOP version 2.0)

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,
You don't need metric files anymore since v0.95 (or earlier, don't
remember exactly).

To have both normal, extended, or condensed fonts, you have to name
them differently, style attribute is only used to distinguish regular
Vs italic.

The main improvement in font variations, between v0.2.x and after, is
the weight attribute that support numeric values, allowing to map
'light', 'normal', 'medium', 'bold', etc. to 300, 400, 500, 700, etc.

2015-10-26 16:20 GMT+01:00 Eva <di...@hotmail.com>:
> Hi Chris,
>
> I'm in the process of converting fop from version 0.25 to version 2. There
> are several custom fonts and I had no problem registering custom fonts when
> I specify style with "normal" or "italic" in font-triplet. However, I've a
> font with different styles which registered as below where style is being
> used to distinguish the difference from the same font. I assume I can put
> any style name in font-triplet and I should be able to use it in fo where I
> need to specify the matching font-family and style. My current work around
> would be register each style with a unique name in font-triplet and change
> all the corresponding references in fo. I just want to verify if the newer
> version of FOP won't be able to specific any other styles other than
> "normal" and "italic" in <font-triplet> in the config. Or I'm missing
> something in the config in order to add a new style. Do I need a metric-url
> in this case??
>
> fop.xconf:
>
>  <font-triplet name="Eurostile" style="condensed" weight="bold"/>
>
> <font-triplet name="Eurostile" style="extended" weight="normal"/>
>
>
> fo:
> (Error: Invalid property value encountered in font-style="condensed" )
> <fo:block text-align="center" space-after.optimum="3pt"
> font-family="Eurostile" font-style="condensed" font-weight="normal"
> font-size="8pt" color="white">April 30, 2015</fo:block>
>
> (No error produce when having the same config, but changing the font-style
> from condense to normal in fo then it works)
> <fo:block text-align="center" space-after.optimum="3pt"
> font-family="Eurostile" font-style="normal" font-weight="normal"
> font-size="8pt" color="white">April 30, 2015</fo:block>
>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42992.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



-- 
pascal

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


Re: font question (was Re: alternate text extension not working in FOP version 2.0)

Posted by Eva <di...@hotmail.com>.
Hi Chris,

I'm in the process of converting fop from version 0.25 to version 2. There
are several custom fonts and I had no problem registering custom fonts when
I specify style with "normal" or "italic" in font-triplet. However, I've a
font with different styles which registered as below where style is being
used to distinguish the difference from the same font. I assume I can put
any style name in font-triplet and I should be able to use it in fo where I
need to specify the matching font-family and style. My current work around
would be register each style with a unique name in font-triplet and change
all the corresponding references in fo. I just want to verify if the newer
version of FOP won't be able to specific any other styles other than
"normal" and "italic" in <font-triplet> in the config. Or I'm missing
something in the config in order to add a new style. Do I need a metric-url
in this case??

fop.xconf:

 <font-triplet name="Eurostile" style="condensed" weight="bold"/>

<font-triplet name="Eurostile" style="extended" weight="normal"/>


fo:
(Error: Invalid property value encountered in font-style="condensed" )
<fo:block text-align="center" space-after.optimum="3pt"
font-family="Eurostile" font-style="condensed" font-weight="normal"
font-size="8pt" color="white">April 30, 2015</fo:block>

(No error produce when having the same config, but changing the font-style
from condense to normal in fo then it works)
<fo:block text-align="center" space-after.optimum="3pt"
font-family="Eurostile" font-style="normal" font-weight="normal"
font-size="8pt" color="white">April 30, 2015</fo:block>
					



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42992.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


font question (was Re: alternate text extension not working in FOP version 2.0)

Posted by Chris Bowditch <bo...@hotmail.com>.
Hi Eva,

style supports only normal or italic currently. Condensed is not a valid 
value for the style attribute. I suggest changing it to normal and 
putting condensed into the font Triplet name within the fop.xconf along 
with changing the font-family in the FO

Thanks,

Chris

On 22/10/2015 20:59, Eva Chang wrote:
> Thanks a lot! my config works now. I don't know if you are familiar with
> adding custom fonts in the config. I'm having trouble with a custom font
> that I add in the config.  I reference apache fop 2.0 website for custom
> fonts and still no luck, not sure which step is causing the issue that the
> font is not register properly.
>
> Config:
>   
> <font-triplet name="Trade Gothic" style="condensed" weight="normal"/>
>   
>
> xsl:
> <fo:block padding-top="0.11in" font-family="Eurostile"
> font-style="condensed" font-weight="normal" font-size="8pt">
>
>
> Error:
> Invalid property value encountered in font-style="condensed": org.apache
> .fop.fo.expr.PropertyException
>
>
>
>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42987.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>


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


Re: alternate text extension not working in FOP version 2.0

Posted by Eva Chang <Ev...@prudential.com>.
Thanks a lot! my config works now. I don't know if you are familiar with
adding custom fonts in the config. I'm having trouble with a custom font
that I add in the config.  I reference apache fop 2.0 website for custom
fonts and still no luck, not sure which step is causing the issue that the
font is not register properly. 

Config: 
 
<font-triplet name="Trade Gothic" style="condensed" weight="normal"/>
 

xsl:
<fo:block padding-top="0.11in" font-family="Eurostile"
font-style="condensed" font-weight="normal" font-size="8pt">


Error: 
Invalid property value encountered in font-style="condensed": org.apache
.fop.fo.expr.PropertyException







--
View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42987.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: alternate text extension not working in FOP version 2.0

Posted by Chris Bowditch <bo...@hotmail.com>.
Hi Eva,

If it works with -a option then this suggests the config file isn't 
being recognized. You need to specify -c option at command line to use a 
config file.

Thanks,

Chris

On 19/10/2015 20:43, Eva wrote:
> Hi Chris,
>
> >From FOP's website, it mentions there are 3 ways to turn on accessibility.
> I've been using the config way by adding accessibility entry in the config.
> I just tried another way using -a in the command and found the pdf generated
> was passing the full check for the very first time. I don't know where did I
> do wrong in the config file. I just got all the files downloaded from the
> website and adding a new entry in fop.xconf.
> <fop version="1.0">
>    <accessibility>true</accessibility>
>
> Do I need to change anything else for the program to read from
> conf/fop.xconf or by default it should read the config file from conf
> folder? I'm new to FOP, really apprecipated your help here.
>
> Thanks,
> Eva
>
>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42979.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>


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


Re: alternate text extension not working in FOP version 2.0

Posted by Eva <di...@hotmail.com>.
Hi Chris,

>From FOP's website, it mentions there are 3 ways to turn on accessibility.
I've been using the config way by adding accessibility entry in the config.
I just tried another way using -a in the command and found the pdf generated
was passing the full check for the very first time. I don't know where did I
do wrong in the config file. I just got all the files downloaded from the
website and adding a new entry in fop.xconf.
<fop version="1.0">
  <accessibility>true</accessibility> 

Do I need to change anything else for the program to read from
conf/fop.xconf or by default it should read the config file from conf
folder? I'm new to FOP, really apprecipated your help here.

Thanks,
Eva





--
View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42979.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: alternate text extension not working in FOP version 2.0

Posted by Chris Bowditch <bo...@hotmail.com>.
Hi Eva,

Did you enable accessibility in the fop.xconf, via the tags:

<accessibility>true</accessibility>

Thanks

Chris

On 14/10/2015 15:24, Eva wrote:
> Hi Chris,
>
> I've simplify the original XSL with only one image for testing purpose and
> still found alt-text not showing when running a full check on accessibility.
>
> <?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"
> xmlns:h="http://tempuri.org/ReportTypeDataSet.xsd"
> xmlns:m="http://tempuri.org/MPRDataSet.xsd" xmlns:myObj="urn:myObj">
> 	<fo:layout-master-set>
> 		<fo:simple-page-master master-name="mpr-life-pg1" page-width="8.5in"
> page-height="11in">
> 			<fo:region-body region-name="mpr-life-pg1-body" margin-right="0.6in"
> margin-left="0.6in" margin-bottom="0.5in" margin-top="2in"
> display-align="center" />
> 			<fo:region-before region-name="mpr-life-pg1-before" extent="2in"
> display-align="after" />
> 			<fo:region-after region-name="mpr-life-pg1-after" extent="0.8in"
> display-align="before" />
> 		</fo:simple-page-master>
> 		<fo:simple-page-master master-name="mpr-life-other" page-width="8.5in"
> page-height="11in">
> 			<fo:region-body region-name="mpr-life-other-body" margin-right="0.6in"
> margin-left="0.6in" margin-bottom="0.5in" margin-top="0.75in"
> display-align="center" />
> 			<fo:region-before region-name="mpr-life-other-before" extent="1.25in"
> display-align="after" />
> 			<fo:region-after region-name="mpr-life-other-after" extent="0.8in"
> display-align="before" />
> 		</fo:simple-page-master>
> 	</fo:layout-master-set>
> 	<fo:page-sequence initial-page-number="1" master-reference="mpr-life-pg1"
> force-page-count="no-force" language="en">
> 		<fo:static-content flow-name="mpr-life-pg1-before">
> 			<fo:block top="0.5in" left="0.5in" width="7.5in" height="1.5in"
> position="absolute" language="en">
> 				<fo:external-graphic fox:alt-text="logo"
> src="http://localhost/PCom3-phase3-t3/images/3441_2.png" />
> 			</fo:block>
> 		</fo:static-content>
> 		<fo:flow flow-name="mpr-life-pg1-body">
> 			<fo:block id="terminator" language="en" />
> 		</fo:flow>
> 	</fo:page-sequence>
> </fo:root>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42967.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>


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


Re: alternate text extension not working in FOP version 2.0

Posted by Eva <di...@hotmail.com>.
Hi Chris,

I've simplify the original XSL with only one image for testing purpose and
still found alt-text not showing when running a full check on accessibility. 

<?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"
xmlns:h="http://tempuri.org/ReportTypeDataSet.xsd"
xmlns:m="http://tempuri.org/MPRDataSet.xsd" xmlns:myObj="urn:myObj">
	<fo:layout-master-set>
		<fo:simple-page-master master-name="mpr-life-pg1" page-width="8.5in"
page-height="11in">
			<fo:region-body region-name="mpr-life-pg1-body" margin-right="0.6in"
margin-left="0.6in" margin-bottom="0.5in" margin-top="2in"
display-align="center" />
			<fo:region-before region-name="mpr-life-pg1-before" extent="2in"
display-align="after" />
			<fo:region-after region-name="mpr-life-pg1-after" extent="0.8in"
display-align="before" />
		</fo:simple-page-master>
		<fo:simple-page-master master-name="mpr-life-other" page-width="8.5in"
page-height="11in">
			<fo:region-body region-name="mpr-life-other-body" margin-right="0.6in"
margin-left="0.6in" margin-bottom="0.5in" margin-top="0.75in"
display-align="center" />
			<fo:region-before region-name="mpr-life-other-before" extent="1.25in"
display-align="after" />
			<fo:region-after region-name="mpr-life-other-after" extent="0.8in"
display-align="before" />
		</fo:simple-page-master>
	</fo:layout-master-set>
	<fo:page-sequence initial-page-number="1" master-reference="mpr-life-pg1"
force-page-count="no-force" language="en">
		<fo:static-content flow-name="mpr-life-pg1-before">
			<fo:block top="0.5in" left="0.5in" width="7.5in" height="1.5in"
position="absolute" language="en">
				<fo:external-graphic fox:alt-text="logo"
src="http://localhost/PCom3-phase3-t3/images/3441_2.png" />
			</fo:block>
		</fo:static-content>
		<fo:flow flow-name="mpr-life-pg1-body">
			<fo:block id="terminator" language="en" />
		</fo:flow>
	</fo:page-sequence>
</fo:root>



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/alternate-text-extension-not-working-in-FOP-version-2-0-tp42921p42967.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: alternate text extension not working in FOP version 2.0

Posted by Chris Bowditch <bo...@hotmail.com>.
Hi Eva,

I've not seen this problem before. fox:alt-text works fine for me and 
passes acrobat preflight. Can you share your complete XSL-FO File?

Thanks,

Chris

On 24/09/2015 14:48, Eva Chang wrote:
> Hi,
>
> Trying to use xsl-fo to generate a  pdf for accessibility compliance. 
> Need to add alternate text to images as the first thing. Getting the 
> latest version of FOP 2.0 and follow the example on the website. I've 
> test it with simply one image on the pdf and pdf was generated without 
> any error. However, after opening the document and ran a full check 
> for accessibility still see the warning for missing alternate text on 
> the image and the only way to fix it would be manually apply the 
> alternate text through acrobat. The namespace I was using is 
> "http://xmlgraphics.apache.org/fop/extensions", not sure if it is 
> still a valid one to use. I've tried searching for solutions online 
> and couldn't find anyone has similar problem as I do. Please let me 
> know if you guys know what's the possible problem that alternate-text 
> is not showing without any error message.
>
>
> Thanks,
> Eva
>


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