]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
added some external svg examples
authorKeiron Liddle <keiron@apache.org>
Fri, 8 Jun 2001 08:56:02 +0000 (08:56 +0000)
committerKeiron Liddle <keiron@apache.org>
Fri, 8 Jun 2001 08:56:02 +0000 (08:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194283 13f79535-47bb-0310-9956-ffa450edef68

docs/examples/svg/boxes.svg [new file with mode: 0644]
docs/examples/svg/embedding.fo
docs/examples/svg/external.fo [new file with mode: 0644]
docs/examples/svg/multi.svg [new file with mode: 0644]
docs/examples/svg/ref.svg [new file with mode: 0644]

diff --git a/docs/examples/svg/boxes.svg b/docs/examples/svg/boxes.svg
new file mode 100644 (file)
index 0000000..b86c9b8
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
+"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
+
+<svg width="20" height="20" xml:space="preserve">
+  <g style="fill:red; stroke:#000000">
+     <rect x="0" y="0" width="15" height="15"/>
+     <rect x="5" y="5" width="15" height="15"/>
+  </g>
+</svg>
+
index 9c24fa7e22654f1c7fc2fd07f5e6d4ba535ce9ce..0a38ae40a3802c4b200641e4ada6d4c5058e4957 100644 (file)
       </fo:block>
 
       <fo:block text-align="center">
-Some examples of how to embed an SVG image inside you FO documents
+Some examples of how to embed an SVG image inside your FO documents
       </fo:block>
 
       <fo:block break-before="page" space-after.optimum="10pt" font-weight="bold" font-size="12pt">
@@ -936,7 +936,7 @@ Sizing
     <fo:table-row>
       <fo:table-cell number-columns-spanned="2">
         <fo:block space-before.optimum="5pt">
-Specify the size on the instream-foreign-object element.
+Specify the size on the instream-foreign-object element. <fo:inline color="red">Note: currently not functional, bug.</fo:inline>
         </fo:block>
       </fo:table-cell>
     </fo:table-row>
@@ -972,6 +972,84 @@ Specify the size on the instream-foreign-object element.
         </fo:block>
       </fo:table-cell>
     </fo:table-row>
+
+    <fo:table-row keep-with-next="always">
+      <fo:table-cell number-columns-spanned="2">
+        <fo:block space-before.optimum="5pt">
+Specify the size on the svg document element.
+        </fo:block>
+      </fo:table-cell>
+    </fo:table-row>
+
+    <fo:table-row>
+      <fo:table-cell>
+        <fo:block font-size="8pt" white-space-collapse="false" space-before.optimum="5pt">
+<![CDATA[
+<fo:instream-foreign-object>
+<svg:svg width="20pt" height="20pt">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+</svg:svg>
+</fo:instream-foreign-object>
+]]>
+
+        </fo:block>
+      </fo:table-cell>
+      <fo:table-cell>
+        <fo:block space-before.optimum="15pt">
+<fo:instream-foreign-object>
+<svg:svg width="20pt" height="20pt">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+</svg:svg>
+</fo:instream-foreign-object>
+        </fo:block>
+      </fo:table-cell>
+    </fo:table-row>
+
+    <fo:table-row keep-with-next="always">
+      <fo:table-cell number-columns-spanned="2">
+        <fo:block space-before.optimum="5pt">
+Specify the size on the svg document element and for the content size on the instream-foreign-object.
+        </fo:block>
+      </fo:table-cell>
+    </fo:table-row>
+
+    <fo:table-row>
+      <fo:table-cell>
+        <fo:block font-size="8pt" white-space-collapse="false" space-before.optimum="5pt">
+<![CDATA[
+<fo:instream-foreign-object content-width="40pt" content-height="40pt">
+<svg:svg width="20pt" height="20pt">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+</svg:svg>
+</fo:instream-foreign-object>
+]]>
+
+        </fo:block>
+      </fo:table-cell>
+      <fo:table-cell>
+        <fo:block space-before.optimum="15pt">
+<fo:instream-foreign-object content-width="40pt" content-height="40pt">
+<svg:svg width="20pt" height="20pt">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+</svg:svg>
+</fo:instream-foreign-object>
+        </fo:block>
+      </fo:table-cell>
+    </fo:table-row>
+
+
   </fo:table-body>
 
           </fo:table>
diff --git a/docs/examples/svg/external.fo b/docs/examples/svg/external.fo
new file mode 100644 (file)
index 0000000..775eb50
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+  <fo:layout-master-set>
+    <fo:simple-page-master
+  margin-right="1.5cm"
+  margin-left="1.5cm"
+  margin-bottom="2cm"
+  margin-top="1cm"
+  page-width="21cm"
+  page-height="29.7cm"
+  master-name="first">
+      <fo:region-before extent="1cm"/>
+      <fo:region-body margin-top="1cm"/>
+      <fo:region-after extent="1.5cm"/>
+    </fo:simple-page-master>
+  </fo:layout-master-set>
+
+  <fo:page-sequence master-name="first">
+    <fo:static-content flow-name="xsl-region-before">
+      <fo:block line-height="14pt" font-size="10pt"
+    text-align="end">External SVG examples</fo:block>
+    </fo:static-content>
+    <fo:static-content flow-name="xsl-region-after">
+      <fo:block line-height="14pt" font-size="10pt"
+    text-align="end">Page <fo:page-number/></fo:block>
+    </fo:static-content>
+
+    <fo:flow flow-name="xsl-region-body">
+
+      <fo:block text-align="center" font-weight="bold" font-size="14pt" space-before.optimum="3pt" space-after.optimum="15pt">
+      External SVG
+      </fo:block>
+
+      <fo:block space-before.optimum="3pt" space-after.optimum="20pt">
+
+
+      </fo:block>
+
+      <fo:block text-align="center">
+Some examples of how to reference external SVG images in your FO documents
+      </fo:block>
+
+      <fo:block break-before="page" space-after.optimum="10pt" font-weight="bold" font-size="12pt">
+Introduction
+      </fo:block>
+
+      <fo:block>
+This document shows some examples of how an SVG document can be in an external svg file
+which is referenced using the fo:external-graphic.
+      </fo:block>
+
+      <fo:block>
+      </fo:block>
+
+      <fo:block space-after.optimum="10pt" font-weight="bold" font-size="12pt">
+Examples
+      </fo:block>
+
+      <fo:block>
+The following svg document is obtained from an external file using the fo:external-graphic.
+      </fo:block>
+
+      <fo:block>
+<fo:external-graphic src="file:boxes.svg"/>
+      </fo:block>
+
+      <fo:block>
+This svg document (<fo:external-graphic src="file:multi.svg"/>) is also obtained from
+an external file using the fo:external-graphic. It has another svg image inside and references
+part of another svg image.
+      </fo:block>
+
+      <fo:block>
+This inline svg document (
+<fo:instream-foreign-object>
+<svg xmlns="http://www.w3.org/2000/svg" width="60" height="40" xml:space="preserve">
+  <g style="fill:none;stroke:yellow">
+     <rect x="0" y="0" width="25" height="25"/>
+     <image xlink:href="file:boxes.svg" x="10" y="10" width="20" height="20"/>
+  </g>
+  <g>
+    <use xlink:href="file:ref.svg#FOP" transform="scale(1.5)" x="18" y="40"/>
+  </g>
+</svg>
+</fo:instream-foreign-object>
+) has an external svg image inside and references part of another svg image.
+      </fo:block>
+
+      <fo:block>
+Apart from this external svg images should behave in the same way that other types of
+external graphics do.
+      </fo:block>
+
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>
+
diff --git a/docs/examples/svg/multi.svg b/docs/examples/svg/multi.svg
new file mode 100644 (file)
index 0000000..9e68d9a
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
+"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
+
+<svg width="60" height="40" xml:space="preserve">
+  <g style="fill:none;stroke:yellow">
+     <rect x="0" y="0" width="25" height="25"/>
+     <image xlink:href="file:boxes.svg" x="10" y="10" width="20" height="20"/>
+  </g>
+  <g>
+    <use xlink:href="file:ref.svg#FOP" transform="scale(1.5)" x="18" y="40"/>
+  </g>
+</svg>
+
diff --git a/docs/examples/svg/ref.svg b/docs/examples/svg/ref.svg
new file mode 100644 (file)
index 0000000..e3f75c6
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
+"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
+
+<svg width="20" height="20" xml:space="preserve">
+  <g id="FOP">
+    <text x="0" y="0" style="fill:black;font-weight:bold;font-size:14"><tspan style="fill:red">F</tspan><tspan style="fill:purple">O</tspan><tspan style="fill:blue">P</tspan></text>
+  </g>
+</svg>
+