aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorBertrand Delacretaz <bdelacretaz@apache.org>2006-09-21 13:06:25 +0000
committerBertrand Delacretaz <bdelacretaz@apache.org>2006-09-21 13:06:25 +0000
commit303963527f0c5a9d58ec6077d135ced29421eaf1 (patch)
tree4fb163ce0966cdab6c470f7ecce122bd31fa88cf /examples
parent91036df4eea2d6aeb8cc13c52eeb25162240899f (diff)
downloadxmlgraphics-fop-303963527f0c5a9d58ec6077d135ced29421eaf1.tar.gz
xmlgraphics-fop-303963527f0c5a9d58ec6077d135ced29421eaf1.zip
Working on bug #5335, barcode.fo example fixed to work with current code
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@448544 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'examples')
-rw-r--r--examples/fo/advanced/K3.xml6
-rw-r--r--examples/fo/advanced/bar.conf.xml91
-rw-r--r--examples/fo/advanced/barcode.fo87
3 files changed, 142 insertions, 42 deletions
diff --git a/examples/fo/advanced/K3.xml b/examples/fo/advanced/K3.xml
index 7d9f109f9..2b46b76d9 100644
--- a/examples/fo/advanced/K3.xml
+++ b/examples/fo/advanced/K3.xml
@@ -1,5 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Note: this file created using TTFReader
--->
-<font-metrics type="TYPE0"><font-name>New</font-name><embed/><cap-height>0</cap-height><x-height>0</x-height><ascender>390</ascender><descender>0</descender><bbox><left>0</left><bottom>0</bottom><right>219</right><top>390</top></bbox><flags>33</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="47" ue="32" us="32"/><bf gi="45" ue="36" us="36"/><bf gi="43" ue="37" us="37"/><bf gi="40" ue="42" us="42"/><bf gi="42" ue="43" us="43"/><bf gi="0" ue="44" us="44"/><bf gi="41" ue="45" us="45"/><bf gi="46" ue="46" us="46"/><bf gi="44" ue="47" us="47"/><bf gi="5" ue="50" us="48"/><bf gi="9" ue="56" us="51"/><bf gi="8" ue="57" us="57"/><bf gi="15" ue="83" us="65"/><bf gi="4" ue="84" us="84"/><bf gi="34" ue="90" us="85"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/></cid-widths></multibyte-extras></font-metrics>
+<?xml version="1.0" encoding="UTF-8"?><font-metrics type="TYPE0"><font-name>New</font-name><embed/><cap-height>390</cap-height><x-height>0</x-height><ascender>390</ascender><descender>0</descender><bbox><left>0</left><bottom>0</bottom><right>219</right><top>390</top></bbox><flags>33</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="47" ue="32" us="32"/><bf gi="45" ue="36" us="36"/><bf gi="43" ue="37" us="37"/><bf gi="40" ue="42" us="42"/><bf gi="42" ue="43" us="43"/><bf gi="0" ue="44" us="44"/><bf gi="41" ue="45" us="45"/><bf gi="46" ue="46" us="46"/><bf gi="44" ue="47" us="47"/><bf gi="5" ue="50" us="48"/><bf gi="9" ue="56" us="51"/><bf gi="8" ue="57" us="57"/><bf gi="15" ue="83" us="65"/><bf gi="4" ue="84" us="84"/><bf gi="34" ue="90" us="85"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/><wx w="156"/></cid-widths></multibyte-extras></font-metrics> \ No newline at end of file
diff --git a/examples/fo/advanced/bar.conf.xml b/examples/fo/advanced/bar.conf.xml
index 828eff849..0e4f37868 100644
--- a/examples/fo/advanced/bar.conf.xml
+++ b/examples/fo/advanced/bar.conf.xml
@@ -1,14 +1,87 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
-<!-- TODO: use proper config -->
+ http://www.apache.org/licenses/LICENSE-2.0
-<configuration>
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
-<fonts>
- <font metrics-file="K3.xml" kerning="yes" embed-file="K3.TTF">
- <font-triplet name="Barcode" style="normal" weight="normal"/>
- </font>
-</fonts>
+<!--
+ FOP configuration for the barcode.fo example.
+-->
-</configuration>
+<fop version="1.0">
+
+ <!-- Base URL for resolving relative URLs -->
+ <base>.</base>
+
+ <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
+ <source-resolution>72</source-resolution>
+ <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
+ <target-resolution>72</target-resolution>
+
+ <!-- Default page-height and page-width, in case
+ value is specified as auto -->
+ <default-page-settings height="11in" width="8.26in"/>
+
+ <!-- Information for specific renderers -->
+ <!-- Uses renderer mime type for renderers -->
+ <renderers>
+ <renderer mime="application/pdf">
+ <filterList>
+ <!-- provides compression using zlib flate (default is on) -->
+ <value>flate</value>
+
+ <!-- encodes binary data into printable ascii characters (default off)
+ This provides about a 4:5 expansion of data size -->
+ <!-- <value>ascii-85</value> -->
+
+ <!-- encodes binary data with hex representation (default off)
+ This filter is not recommended as it doubles the data size -->
+ <!-- <value>ascii-hex</value> -->
+ </filterList>
+
+ <fonts>
+ <font metrics-url="examples/fo/advanced/K3.xml" kerning="no" embed-url="examples/fo/advanced/K3.ttf">
+ <font-triplet name="Barcode" style="normal" weight="normal"/>
+ </font>
+ </fonts>
+ </renderer>
+
+ <renderer mime="application/postscript"/>
+ <renderer mime="application/vnd.hp-PCL"/>
+
+ <renderer mime="image/svg+xml">
+ <format type="paginated"/>
+ <link value="true"/>
+ <strokeText value="false"/>
+ </renderer>
+
+ <renderer mime="application/awt"/>
+
+ <renderer mime="image/png"/>
+
+ <renderer mime="image/tiff/">
+ </renderer>
+
+ <renderer mime="text/xml"/>
+
+ <renderer mime="text/plain">
+ <pageSize columns="80"/>
+ </renderer>
+
+ </renderers>
+
+</fop>
diff --git a/examples/fo/advanced/barcode.fo b/examples/fo/advanced/barcode.fo
index 54f628c5e..155fc2421 100644
--- a/examples/fo/advanced/barcode.fo
+++ b/examples/fo/advanced/barcode.fo
@@ -34,35 +34,66 @@
</fo:page-sequence-master>
</fo:layout-master-set>
-<fo:page-sequence master-reference="A4">
- <fo:flow flow-name="xsl-region-body">
+ <fo:page-sequence master-reference="A4">
+ <fo:flow flow-name="xsl-region-body" font-size="12pt">
-<fo:block font-size="14pt" font-weight="bold">
- Example embedding Font
-</fo:block>
+ <fo:block font-size="14pt" font-weight="bold">
+ Example embedding Font
+ </fo:block>
+
+ <fo:block>
+ This example shows how to use an embedded font and
+ uses a free barcode font as an example. The barcode font is from
+ <fo:basic-link external-destination="http://www.geocities.com/keith_dimmock/">http://www.geocities.com/keith_dimmock/</fo:basic-link>
+ and is free.
+ </fo:block>
+
+ <fo:block>
+ To generate the PDF from this example, set the following build parameters
+ (for example in build-local.properties) and run "build examples" from the
+ top-level FOP source code directory.
+
+ <fo:block font-family="Courier" font-size="10pt" margin-left="2em">
+ <fo:block>fo.examples.dir = ./examples/fo/advanced</fo:block>
+ <fo:block>fo.examples.include = **/barcode.fo</fo:block>
+ <fo:block>fo.examples.userconfig = examples/fo/advanced/bar.conf.xml</fo:block>
+ <fo:block>fo.examples.force = true</fo:block>
+ </fo:block>
+ </fo:block>
+
+ <fo:block>
+ If the character encoding is correct in the generated PDF (bugzilla 5335), searching for "123456" should
+ find the first barcode, and "234567" the second.
+ </fo:block>
+
+ <fo:block font-weight="bold" space-before.optimum="2em">
+ First barcode: *ID123456*
+ </fo:block>
+
+ <fo:block
+ font-family="Barcode"
+ font-size="74pt">
+ *ID123456*
+ </fo:block>
+
+ <fo:block>
+ normal text, follows first barcode.
+ </fo:block>
+
+ <fo:block font-weight="bold" space-before.optimum="2em">
+ Second barcode: *ID234567* and some text
+ </fo:block>
+
+ <fo:block
+ font-family="Barcode, Helvetica"
+ font-size="74pt">
+ *ID234567* and some text
+ </fo:block>
-<fo:block font-size="14pt" font-weight="bold">
- This example shows how to use an embedded font and
- uses a free barcode font as an example. The barcode font is from
- <fo:basic-link external-destination="http://www.geocities.com/keith_dimmock/">http://www.geocities.com/keith_dimmock/</fo:basic-link>
- and is free.
-</fo:block>
-
-<fo:block font-family="Barcode" font-size="74pt" line-height="76pt"
-space-before.optimum="6mm">
- *ID123456*
-</fo:block>
-
-<fo:block font-family="Barcode" font-size="74pt" line-height="76pt"
-space-before.optimum="6mm">
- normal text
-</fo:block>
-
-<fo:block font-family="Barcode, Helvetica" font-size="74pt" line-height="76pt"
-space-before.optimum="6mm">
- *ID123456* normal text
-</fo:block>
-
- </fo:flow>
+ <fo:block>
+ normal text, follows second barcode.
+ </fo:block>
+
+ </fo:flow>
</fo:page-sequence>
</fo:root>