🎉 initial commit
340
apache_fop/KEYS
Normal file
|
|
@ -0,0 +1,340 @@
|
|||
This file contains the PGP keys of various developers.
|
||||
Please don't use them for email unless you have to. Their main
|
||||
purpose is code signing.
|
||||
|
||||
Users:
|
||||
pgp < KEYS
|
||||
(gpg --import < KEYS)
|
||||
Developers:
|
||||
pgp -kxa <your name> and append it to this file.
|
||||
(pgpk -ll <your name> && pgpk -xa <your name>) >> this file.
|
||||
(gpg --list-sigs <your name>
|
||||
&& gpg --armor --export <your name>) >> this file.
|
||||
|
||||
pub 1024D/8408F755 2003-01-20 Christian Geisert <chrisg@apache.org>
|
||||
sub 1024g/41D98B12 2003-01-20
|
||||
pub 1024D/7C611584 2005-07-19 Jeremias M舐ki <jeremias@apache.org>
|
||||
sub 2048g/C0F1AD34 2005-07-19
|
||||
pub 1024D/5F298824 2006-09-30 Simon Pepping <spepping@leverkruid.eu>
|
||||
sub 2048g/40F32100 2006-09-30
|
||||
pub 1024D/4358C584 2006-12-08 Vincent Hennebert <vhennebert@apache.org>
|
||||
sub 2048g/0BD6AC9B 2006-12-08
|
||||
pub 1024D/CC31AE97 2008-03-27 [expires: 2011-01-01]
|
||||
uid Maximilian Berger <maxberger@apache.org>
|
||||
pub 1024R/C93C5700 2008-07-12
|
||||
uid Maximilian Berger <maxberger@apache.org>
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.0.6 (GNU/Linux)
|
||||
Comment: Weitere Infos: siehe http://www.gnupg.org
|
||||
|
||||
mQGiBD4rT6kRBADPozVPJAOKLqcgtnGFHj0Qav5OBPqjTprJji0BgxPrcZLZQFUO
|
||||
0AmeJpzwgE0vDISx+DgGOKPcqeCLnSqtoR3rYc5Tf57FPlZ/E2/fzMwC0soYzJ6e
|
||||
E9uSsXBIPeeRHcrxyCYJx69g2D/zS2vGnAIr0LYLXhadvChK1zngU0pFswCg5z0a
|
||||
TjCH+9VWzerOLaEQYqVyGgMD/i456FFD2lWes8amcN+wpBLSpxysyrbu1FOZ3sVi
|
||||
MjYsODDeLKRB1Cxn6UMx7WE+Av+UhtoJkoTsvcGBtkj+rFfEav2WmCsYDvLwbqpE
|
||||
P5Pun7qgXbznbzCqdNUavXM0goBQtyFhtGkJSoOVXM6H5raO3THEPXU971gkOC9+
|
||||
agZDA/0WdV3VumDwi9DvII58Fv8K5HKxkZrLeUWAYJzgzeroYgfvuNKr/SrAFuyR
|
||||
W8XxDMPMAMvO1qKUU1Zjffx6RUjeiptmF4ozLvU3I/Pr6atWJL8SPH6rrk6xDpZ5
|
||||
Ev/we0MmRU5kk9Y8KGavAsOjbMbTv77DL2AZ8qapUQYqfuuiR7QlQ2hyaXN0aWFu
|
||||
IEdlaXNlcnQgPGNocmlzZ0BhcGFjaGUub3JnPohXBBMRAgAXBQI+K0+pBQsHCgME
|
||||
AxUDAgMWAgECF4AACgkQc84u+4QI91W/OwCffMPR+FpADYlte9AabXRuzomhdh4A
|
||||
oNvl89kJdg43/nMw5CErpMvMFNjVuQENBD4rT6sQBACr7d7g+yOPuYaFeS9+wXlO
|
||||
vz3gVWZNUOPalrJwWPQ2yXxCzEd4chpBDUsq7TusEe/RCSUuSQYe0FAET2der4Uj
|
||||
6TJPB7SuJos3hrqsUQOluoEHS8bCPD7mpXIjd1+tQu57jxgcW4/VnEn3/c57blgY
|
||||
V2/rpAUE8nDRPB1Z8oveJwAECwQAp0zOTs1ehN4MFzy/3T1xO8HVN7LiaZSc4mEs
|
||||
oyIcEcD3iwxJqsVPmJLOfP8fhuqyv4QfG+7gdNBZqji5WTUK2o1vYgnEbvsnGDst
|
||||
Lx9kwaWCalGMXdbuEzXoheX2JJCeP8YkPQw/r9rCeP0jLXExU3B6RJkDXBrZB7L3
|
||||
Jdj2mxKIRgQYEQIABgUCPitPqwAKCRBzzi77hAj3VeUxAKCJXCs0vrCcfMSO/2M/
|
||||
Eq/rMruVPwCg34SJtFP5wtlgHa7kdhBLKoenD7g=
|
||||
=+cef
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.2 (MingW32)
|
||||
|
||||
mQGiBELdQqsRBACPvRuWTsO4Sv95wSFzaMJcSJs81b9lpAT4BKsi3K/1y7pcxTJW
|
||||
IKP5Khc6cOom3nnRDofEh1KcLnvx+X+A+WF5YF7c1qd4EG3tWgjzqnkT9NUsw6t/
|
||||
3yAHL9iHr5nB7aZuiDdXgsLL5F2wNjuiSrTEDVM1wSm+QLuqqJ2lSJOcCwCg97BA
|
||||
yyX59XauxdQNfF00pfYIW3UD/R2TzMD5YxHbCO2Ib3j5O2cJU+G56q1krLwFKSzq
|
||||
XsiKOh2+8Bvwj2bBlQ6uYMwZc08WOgtiG3uRMDsdPE3JIoDogIguuADzO1LFFoi5
|
||||
mAEizqCN+8OSZ6luVeznUKCObF+yJvqJyG9RoDgv+v8KdqVz5NZ2BdtcY7LxHGKI
|
||||
6k/LA/9WH1p8N10GETyagzNtU1tDMZGk8zB5C1qE9hgMDr5iRKrFuGnwBzMseKOj
|
||||
nQ4tPW47hWYeXLaou6JPTRhGP0wITnOoYmcP5ymgOPZJZwARfC3qXznrdOAmL8D2
|
||||
x+W7DP7ZtKPCYDa0norSEq3VPSUWjAjAPvskgiN6u6Y5/0J487QlSmVyZW1pYXMg
|
||||
TcOkcmtpIDxqZXJlbWlhc0BtYWVya2kub3JnPoheBBMRAgAeBQJC3VVHAhsjBgsJ
|
||||
CAcDAgMVAgMDFgIBAh4BAheAAAoJEPcwlXB8YRWECjoAnA90rdo+Ob3k1BOMz5cK
|
||||
PaQZtuuiAKCHOPtp1foBDjGPBA0FR9MtSCmMLYhGBBIRAgAGBQJC31YgAAoJEKIR
|
||||
WuFfa4tyKSsAnj6YCONElnEDA5vaa1lJES4UcVAeAJ9JG4bXlEPUqyBPhOtvetVS
|
||||
OWtNGIhGBBMRAgAGBQJC7u6uAAoJEME58VMjy3oqElwAnijYebpmsWIw86ilU2Zf
|
||||
epTWKSt1AJ0cMQZmjm/WrGI68rCRcEL7X2wTOYhGBBMRAgAGBQJDK/iDAAoJEDf2
|
||||
j/UBWvyKp3YAniyZxx/ee9g7asY2AR87yAVWPRjQAJ0U4l3dC/8ugLmyE7RbkFqL
|
||||
iALoRLQpSmVyZW1pYXMgTcOkcmtpIDxpbmZvQGplcmVtaWFzLW1hZXJraS5jaD6I
|
||||
XgQTEQIAHgUCQt1VXQIbIwYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRD3MJVwfGEV
|
||||
hNNHAKDkYf0faxpqpmnwtFNeFETmTqd7HACeK0jaTfp7b/VhTlFmF+cSkrO4lK2I
|
||||
RgQSEQIABgUCQt9WIAAKCRCiEVrhX2uLcpUWAKClQPvTzFXFlDk/nDBa0wxesi4n
|
||||
qwCfWiXArQAoIm/hG9zpK+h2zHwlYg6IRgQTEQIABgUCQu7urgAKCRDBOfFTI8t6
|
||||
KpDiAKCCPK5ixmDxrKvvIKnx7hofZ0LiAQCfV6vfRmuVmfWo2LMMaa9xw5WBtUKI
|
||||
RgQTEQIABgUCQyv4gwAKCRA39o/1AVr8iqV2AJ9sBMWQ6YjZHIfBp+aoo84EI/Kg
|
||||
6wCfRDkrpQhjpeSM4DPaRiKgL1LQrVm0JUplcmVtaWFzIE3DpHJraSA8amVyZW1p
|
||||
YXNAYXBhY2hlLm9yZz6IXgQTEQIAHgUCQt1VgwIbIwYLCQgHAwIDFQIDAxYCAQIe
|
||||
AQIXgAAKCRD3MJVwfGEVhAjAAKDme5j7fzFk365pOZm1lJyEHMJuPACgspAO3iPV
|
||||
7G659xb8l8IQQIZn18CIRgQSEQIABgUCQt9WGAAKCRCiEVrhX2uLcirOAKCwgb9x
|
||||
2zr8Q3j7KnD9XSgqrwv33ACgzcUOgabzbXlJWEOiW4d2LIK4zjyIRgQTEQIABgUC
|
||||
Qu7uqQAKCRDBOfFTI8t6KuNXAJ40TlT/Goa/tV/5zL+ZH6OdWjTImACghZxdWnD+
|
||||
CLZORMpBFYUlUKffSlWIRgQTEQIABgUCQyv4bAAKCRA39o/1AVr8iv1/AKCX8NY8
|
||||
nffFDHsck7SMPWdb8toSvwCfd0Yf8OOYq3/O8JidWNpnNTAZabqIYQQTEQIAIQIb
|
||||
IwYLCQgHAwIDFQIDAxYCAQIeAQIXgAUCQt1VmwIZAQAKCRD3MJVwfGEVhOZyAJ9G
|
||||
J6pU0t9yrsVkuHcAkhF1YG6RDgCdFOb6NohfGeBbOraUGdQvKwJ3J0W5Ag0EQt1C
|
||||
vhAIAIhBOvTiliy95oxWLplZzCiXq6Dm3lYUOhDxmioKavI6KH2FzdnrHHvz91ES
|
||||
f7tGUNizHQyv4+zSAv8B8JmKiQ7Tk6DL5yJjZ6otwyOuR0ZIviXZwYirT8lOO4wP
|
||||
m3oV1V6Uf1oIwZQ2Y1fTFO4+8UPlTT0IUNMxuIIbvkRSMup6FIFGDoJQ/IYtBB4G
|
||||
4mo6DMilyNzDiaqJ5k+iSY/GcCIzdWUd7ryr7344DffnJHg0CDynR/gpISWWj0sf
|
||||
YCnjZJANrVGV7O5WnKsVKqzTIRfJKSGBoB1ekvQ8AtGq1X8DfGgKubjlzGjCNbeW
|
||||
YiKNEa/M4DOAwhFzvftGueuzujMAAwUH/1+A8nfA3YgoG8wGPifhXBrB5aUx5I12
|
||||
1akJvK4KQaIFE3dDRRYtwQHp0EyKB85z3lTlmdOupE5oKHd3ZYeeaQSUnt5i+dtz
|
||||
Xxz3RLBB6NYlcYJJyqSb31rTAMoq1iultLYbH+ugK/kUPTIOslvUJ/q4J22NJ/wS
|
||||
aIEqBlz/RczCAniNooQ/2ie733MpJ6NfROGIiOrNsRlQw+7P9TOmB3FxKLtzIunD
|
||||
F/Oo/4vznSoaVSUtVFMCKM2tLLbVV2LWBm9ztakfOXwmV0aoveAZ6a0J5+9RbC82
|
||||
HJW5Sez4fLZxK7tENCQoscjkjM/xfsDz5mz/8JF4T0tLehUjKrLBlsaIRgQYEQIA
|
||||
BgUCQt1CvgAKCRD3MJVwfGEVhD0+AJwLiZ/2jUDCKVngO+lqNscX8TQ0LQCeM4DI
|
||||
UKHCLjnj2UtX8OfockTGIic=
|
||||
=1nMU
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.5 (GNU/Linux)
|
||||
|
||||
mQGiBEUeNZ4RBADSETFxXTVUP98ydSQKh6gEkS59JPaCAkeNbMeM5VBK6RcVvjtK
|
||||
zxadtIfcaFx++OCkABCdWnlIIVhjYMMYVV9h3DRFVwYEp1LZb9ktU+PxIw9kI75+
|
||||
eNMsxCpvYBvw9nFyHFPAdtnQPNpMSG7SeCNOHtSuErACuxOuo9JpwIWNwwCg469m
|
||||
S/sca2kkmYuKqrWXD2cfZdED/3awMvn3cThlTsT0zqtQjuGBJjH9bJwiRdvNpU0M
|
||||
cxw7xC1HGtfBYVQd9XastVj1xToDq7gCY5+qoHXLgv5BqLwecadtjuKEF4FXAmtN
|
||||
1qmz9sAVlYsnA4azCADyLv0A440Azbzg9ruEBAf1U6JL6BtpKuLQ3RSCrYicO3Vu
|
||||
fHJWA/0crJgn3GTDtFegMTDtlLvBcRXbsKBVAddbew9WOVfcTo1x7r71iziJZtgj
|
||||
o88pNLHy6IXWvZr+VvB4c0V5U0K7eB9B956G3/t+1G8lDfuzVBqkSqAQXv7XmIWB
|
||||
r4FIBMW20uNl8LO3461u+lDpIIXHZrucPmpHxrcFrzVTxknWqLQmU2ltb24gUGVw
|
||||
cGluZyA8c3BlcHBpbmdAbGV2ZXJrcnVpZC5ldT6IaQQTEQIAKQIbAwUJCWYBgAYL
|
||||
CQgHAwIEFQIIAwQWAgMBAh4BAheABQJFHkuQAhkBAAoJED4qb8JfKYgkvcAAnjXG
|
||||
Sg3CFkDVdHQNA8pURERLc0dkAKCx583xMH1Mj6Bicvu2Y6YBKBl03ohMBBMRAgAM
|
||||
BQJFIm1bBYMJYcnDAAoJEPcwlXB8YRWE5ykAoJHj4TgPp7PrHQBmvcU+6iUN9Iba
|
||||
AJ9yP6eQoewU5K6z3fgH533MeNJZn4hmBBMRAgAmBQJFHjWeAhsDBQkJZgGABgsJ
|
||||
CAcDAgQVAggDBBYCAwECHgECF4AACgkQPipvwl8piCSi+wCfbyubA0KeYeq81I21
|
||||
8k8EZBeh8hAAn0jfjHGnPRjLkTMntXKn5ecBMHl+uQINBEUeNakQCACIXvG/0SxJ
|
||||
yuE/XGy+EKGwAVdjbJ0zz9gyRTrOWChsc/uzI6bVUrxlQGwaEqsbCI70qL5Wk7Cn
|
||||
F1xlCutfMa28YXSJtlPzjvcAAPDJO0kmXWJ0MYYD3rod7fqjbipW2T5XQ4UZ+/n3
|
||||
KDnV2PohsBnmnGOXa30nC8+gC4mobzboIh8mBXqmZOcGW22L/5iSWW+QUxHjnClO
|
||||
Cc1NFWwqLouyhphAUjPh+M+LssdMwoJk8+LXD8IuridHzlMbU4Wkf+u2KWJk7BL3
|
||||
/XXl9y1ISfDAZJ9vzfs6ilGmKmaUvmMySoxquujZrdta+x42GZ14zdwrIGULRLZ0
|
||||
Cv/sVcsG83aTAAMFB/4moH/XSyPQO+aWzIHcPrfeZzQzo0QL30MKSKZJqoJAJara
|
||||
1dZ7LlLIvCCd1vWR+UCJPy6FmeICAyeGbTph84n7q79Bbb76ezHqDOfzKJrutMGX
|
||||
yHmZaMsvUX8phwsq/wPFRP2shGUJ6aO+h4soY7JnCECL5IivIMxpy6UD3IXMDUzN
|
||||
womdlnPXtsJSbadf6+tLsy5r95uYjJrNuNRTn5sZ9AZ7FXxcxDhtLkeX0FF7mpxQ
|
||||
Gu2hj8RrYnBottpiZGIVjkS6yqA2J53HKafHDd7ITSmVS2KxgIiz7TNqfNyPN9AV
|
||||
ea0xE+aAjPePGbTcZF51j2QIiGEmhVPmGqc3r0qQiE8EGBECAA8FAkUeNakCGwwF
|
||||
CQlmAYAACgkQPipvwl8piCQmlgCgmxawADNcQDnWuFpJ/jaHRdhDKLAAnjhAoZ/D
|
||||
nruGzxj+A7iyYEB9I6Uk
|
||||
=NbVl
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.2.2 (GNU/Linux)
|
||||
|
||||
mQGiBEV5mbgRBACBd9xGOGzs8ah/N11zlDi8woJUh02EgztXdMfij4F3u12DkneC
|
||||
OIwGH14fWHdkhKjwYMi5LQfvBsnd3P5v5PTBxYati7ZQDDjvYsAJiMXbyUdszdyQ
|
||||
ig/UuNMwdB5YBrdtklzZcOuiNt/yeoocURQRwkwklsVBIYWwovcdXLTRWwCglPVQ
|
||||
0NrC7VPRPTgK0Y1wxOgwzj0D/RpwFEAcl1SJHoOwhwKykNzA05YABaxXhksKi2qQ
|
||||
C8M4mUofqweU3ocU0tBqQAR351n7hQWAaIs6ScOQtcKPJj9SV8SQgqxwj7WfHscj
|
||||
9X3lkP6cxstW+W8SblTgrKwl7JLLkja1u1cNUeD0QzWImuRBpOjh4s97ZFwSHRoH
|
||||
hCLgA/4/GDXbOhC4Wi9i8HHQNhEA6l86ZBteGq5u4SW57cK69mnOGj8iBxenIWeU
|
||||
+NuB/LqVcG/75JnDvVGImvoykCBEl9xASNOj1C4HvBwNrU7iIpvRig1wwHK8/wqU
|
||||
Dhq5433rh40YbOfN0PLZDhQNhf3MysP3ipTZkVdwIKhsvl/vibQ2VmluY2VudCBI
|
||||
ZW5uZWJlcnQgPHZpbmNlbnQuaGVubmViZXJ0QGFueXdhcmUtdGVjaC5jb20+iGAE
|
||||
ExECACAFAkV5mgcCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRCgctTQQ1jF
|
||||
hH7uAJ9BFRNMuSpvSq//lEWLc6WOTMW70ACghjA0jtaMQUVjDU3RUOdGMRkqRZu0
|
||||
KVZpbmNlbnQgSGVubmViZXJ0IDx2aGVubmViZXJ0QGFwYWNoZS5vcmc+iGMEExEC
|
||||
ACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAUCRXmahgIZAQAKCRCgctTQQ1jF
|
||||
hLRSAJ9KgHLa9V4Q2k0NFiMpPuhfnsK9bQCeJbGjFdIgrzyIvYIUZUPQGww597+5
|
||||
Ag0ERXmZwhAIAJhskbWZaLuwdZ3aLqVimVu65bR2ve1U28dfsSVCKx0uYCl3YJkj
|
||||
lF9P3BfMMPVdNRqDz4Agz/Vrn13j+p4ZQQhVhv6IGhE4p4T4RebMaZ/d30/6REls
|
||||
DP3Luc9IrnJbA72jSeXt+vI3WysB/wuJJ/kb+3KtFa1NowwVVypHCiSmme0VCUaR
|
||||
K6jlN0245IpR0IA4Q1VziRO7v1VufZAef64/2U2T/IthwPqDoThNj++9Zg5Tctrt
|
||||
TL02Z++n2Nj9bQf9R+FhA3YhvHuf6OLAPE2emcM/0As+JwBHqcMrmybnrxEJg0Aq
|
||||
4Q1k1Ka7beb35QJ7158rzL1PU1V2totLeW8AAwUH/1NJVnMD/p4op2kbJYMgKSqz
|
||||
zZfypt60aWeImeJ2qZD7FAtsz6KQu2a5ZkcVmyCeuAo9Sj0IqxXyn8Z6bHuHXNe+
|
||||
aidjS+n5kc2Y+5RQ1oMGV+BzXQMPGOgh0ertbLaairT7mCljTEd4kUGxOIcfAh/q
|
||||
Ie+p7Guvw6+T4K7hgfY8bAiVgzhZLWIFTQXpjU+91q6kTt4eIWjdCGdNQ/OBezGY
|
||||
f5SCy0phzTmRqcu68nKaLznwUpI7SuSFSIeVemGz602KdFsLEHHbZE0KJgd6aHYu
|
||||
ynK3sugKIpz/NXpT2vBsVkK6EP5xzWYOpqMGb8uQD8CT7loY81SK+rHBm7dicgiI
|
||||
SQQYEQIACQUCRXmZwgIbDAAKCRCgctTQQ1jFhBc3AKCQ1X7oIVR8g7GvSGEUw6DE
|
||||
HgEaUgCgkl30lcl9gGa9hqk4cuGYn1OTyks=
|
||||
=XphF
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.7 (OpenBSD)
|
||||
|
||||
mQGiBEfrX/ARBADulGs9V7StbfK8CFfClihdh4lRpw2tktMuYiQJ/rIsNq4zghkT
|
||||
UGxFU0eUC2ZVPYvwG6sXgZ5SSm6i8Ii79YdIIxUG7oNwXaY/e9rK+xX193xqmDgl
|
||||
Vh5vm4LUtncHi9TZDSF+g1YU1DVHbSjTd2oQEHxbBppL0CLfaLv3U1qr2wCgxeGw
|
||||
ZIwb6KD6yesRLx6vGDkDzAMEAL99p0m4sNnjZdKC25Rrt6NZ7CROXWs89/+dkewg
|
||||
JCZiVEoAcdSa0z5d8+XaSzmqR8BJWM1PBPjG48eEdqOevwypd0F/U1mwZ42MvQEw
|
||||
oBayUY+7/pptW7C5L3Fjk18drE0a8lIzt9VBGX5fe3GoXtZKuOzDv0hEuHyzR9q9
|
||||
JLXsA/sELFfrHf0tBfXAdE7pj/Mahalu17/GAyb0RHSvuOfoUvXSXZA91cFg8ycB
|
||||
4x265NtYZk52M32wi5ePrYeSJIZ6vWRvPuWVAXDg5S6HCMjcXc6ElkgLcUt1NoPI
|
||||
DmRXe4FIDZkGSYSXdLTUByu7+8fCuWQHCFG2sALdOyVlucij2LQoTWF4aW1pbGlh
|
||||
biBCZXJnZXIgPG1heGJlcmdlckBhcGFjaGUub3JnPohmBBMRAgAmBQJH61/wAhsD
|
||||
BQkFM4sABgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ4+RAT8wxrpcs1wCeIAoI
|
||||
B0MwZfWLV+wD3pt1wDkPXbsAnjuOsyZ7EeNOcpoqSteB17aPRGeLiEYEEBECAAYF
|
||||
Akfrb00ACgkQByq3OugVkrx76ACgqJ8W64IhBYgBvp3dTDLS825gCQQAnjB6X5+4
|
||||
eW/0pQUpJcvolxbT9xvF
|
||||
=bbQO
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.2.6 (GNU/Linux)
|
||||
|
||||
mI4ESHiTQAEEANXyMbT/YZLUQoG2e5bVl1OcZ4Ttpt+Uk7KfZd1vehgwkr7VOUT5
|
||||
Y5JZ74mS/XxdG3JoSI5AF96pAxEl/xplqnTXtR/ZG6IcK7BZPblpYf4l8zB+M9g0
|
||||
QbTphAAiYeWBLoDWNZW6jiicsQ27EZmGgotcJ855t1x3CbEey0KpmEeHACCrR/j3
|
||||
tChNYXhpbWlsaWFuIEJlcmdlciA8bWF4YmVyZ2VyQGFwYWNoZS5vcmc+iEYEEBEC
|
||||
AAYFAkh5tUsACgkQ4+RAT8wxrpeT/gCgvLNl0Ygmq8vBSdu6QXRzrWzQqGoAmQEq
|
||||
gEXNzkIENamBEmderAxauC8HiLYEEwECACAFAkh4lMECGwMGCwkIBwMCBBUCCAME
|
||||
FgIDAQIeAQIXgAAKCRD5iaLlyTxXAJlABACYHTf8nSIv0wR57ApHmF2AKub6OKPs
|
||||
KBzHP0/xQKpJ+75suk/0CNL7ve5RknHZ9f202DBQ1UOE2ibW6CbXokuhLPQHiWcD
|
||||
h/LNjn/gIB8y8yIr64SNX2u6563ZKhs2p72BTAJRquWdIwjcg6sXeWbvY/B7AFeJ
|
||||
14v8GKWL3YWxQbiOBEh4k0gBBADGhb6pch9zGC9pGDPEyOujwXK1Iq9V7k6ECBSs
|
||||
uzANb8GCAA+xj+jna20Nphnckd7ZMkiNyd+GD2fyFGL6BvIMGQZrLcuOK0yCkZqN
|
||||
SVZ/Tk98u0PaaFMBMh1XwdCgn5NKtzxBOZ2b2klBJlI3Rr4vBUqwe6/mytH96DfM
|
||||
cP5KWwAg9S7R24ifBBgBAgAJBQJIeJNIAhsgAAoJEPmJouXJPFcAFl8D/i5vkJOc
|
||||
O/x3ANfQE/tod4DVo1f5+oEULBZOrq03M3bBAQOqe41hvlmrLjr0gTcKAwBp70w4
|
||||
iu/YXdirZTx9eTRMhnMS7HRJE2Aeui2eE3adDQV0hl7MouOgdWidIAQC3H+sNwT2
|
||||
rvqbxAg5UkH8u6UUGuMmtbOteaHArPDrujg5uI4ESHiTVgEEANRz9ivIoA1WSH+4
|
||||
Sr8QhhFMn/SUit/o403tAhCkIRJszvzIfelTLQzv17jBgNiVsnxtOtY+dIJLFfWS
|
||||
cJohYlTEnLjeZeeA8abQUMjXpuKc0jUxspaHes3ywB/dcTAUZcsKxLboVT/X9S6j
|
||||
99ErdM4Map9KOVgAzPGZLNgxLcq9ACCUGpzdiJ8EGAECAAkFAkh4k1YCGwwACgkQ
|
||||
+Ymi5ck8VwBjxAQAhdcrZG0Q4LIk0d1RewO5dGua4XjqwyyhYuzHjs2X3Bel62bW
|
||||
oK46DpretsNxnP80m79leHQOJalTAW2jMU6KGdLvlGaaaaZ0aAcxzeRltBsBWwe8
|
||||
9TdzBiO/eMiU4XB3PW+cjsc/gN/T4+hcbculNFB9skt7ODV4JHu6EZdSLmO5AaIE
|
||||
SHm3yBEEALKRSNJ7OcgSRHAEDGLj0KZuy2PxMoCtUl4dPkdnWlcGe57j6l6PE5aW
|
||||
jK6lxKQ10i7J4KM5kOt4nudWCmxD4SzSiZx7O7md4PgLypzDG3nDvPImS0Yu3G+S
|
||||
g1oZ5bksqjd77X6f/OuGUl3/gOpo6IejlaMy21ixeRPR/8ZMl/OjAKDLontnXlp0
|
||||
y39oOJx+tQ8iWIzzuQP+NOqKnaO3aHnRE+Balyw/TpBpX5NnufgCFr0Psejf2fQz
|
||||
xTbPpny7CsmMbMJlPHXE+OZ8mSy8mdryUIFy8C9bwPe/6iSsv5rnZ6JWJ2oRc8qC
|
||||
fI38oSepEHTtHz9PhgaN8RNCqVyomuzXZmfkrcIVitsq3KVFTw8HhBA1Y/mHFjME
|
||||
AIW1VSa0Pxm2eHCCcuieqa8zVtg/dt3qO5bgyyR2qCvA5xuYLrnTRYiOkddw9MQx
|
||||
Zz5ZB2IGlF2jAyja+zHZqZAO3NiepvZwjo9zhQKzacKP/w94C1R/gL1V54/7p80H
|
||||
ySRD1JolwBjoYxdKFtDj5HoJ5rC3jTbWY3l1AQQMShJxiO0EGAECAA8FAkh5t8gC
|
||||
GwIFCQHhM4AAUgkQ+Ymi5ck8VwBHIAQZEQIABgUCSHm3yAAKCRCmAuWryUxvA7AE
|
||||
AJ9jajPUCTGt3apXlLI18VFpxB8yCACdHKZcZ1JoDN94BVI2Qyt5SJ7RKknmMQQA
|
||||
k6cWvEftN5Q94VOMjPuFOcrOvnjDGJkh4GgpbfSCLBTkX/nqus9iOMNYjHLL5pUi
|
||||
jWEfdXJUenPfo58avgTzvDtF1EGoTw8ykzbPUZ1+CmekCt1/NaVSSY8+8HxS2FiE
|
||||
kZoXlf56ekQOjeoa01Uo+MLc3aLBnFjW1fWAQmocRfC5AaIESHm4zBEEANrn/MA4
|
||||
BglSMlASTsCEnVJZ7vQwZYuQfxxCiGsjFckBWY/D4Xm+RB0L4y5bOuqNeAc01sb0
|
||||
+2MHpBqE1Zeq0nLFfTBACKH5GUnWB6f4T5P613Yjo3kR17/WSb28FnSQww2sP9gW
|
||||
oSDoTn1x6iNeXh2waXW9WJQoCZHUDfkT68OrAKC9nE6MeuSPd+PNhAfBcR3S6SOd
|
||||
hQQAuTmpLKGqx2auUnwDAajM/RuDCS1lNCAku2tHpvqSdDb0xfyLnTNwbjHG/cDX
|
||||
oZLx9CYEoNkxQmlyUfg91/64xXjskbs7aTRV4tERV24duQnNXrWvQ2bfJeYxWNrV
|
||||
VqlSeGokL5EYe7AViMwi+uLmDVlHjtxASiWaqqxIVC3dLXEEAK0F7bdFvw3RnPGT
|
||||
x+JJV/5+L8mbTFdfwvWVXuN8oDkgAu9PkCLcAuPD/ZYsaZDic8MkcMbo5dmbH9+j
|
||||
Qr8pft0pWJjueAj77zmETGKohqsf6LGRc10FAFF1E9zPFS8hvqdI9TfVBlxdPjwi
|
||||
pNisGmlYsIUBqnHvrQva5L0sEofziO0EGAECAA8FAkh5uMwCGwIFCQHhM4AAUgkQ
|
||||
+Ymi5ck8VwBHIAQZEQIABgUCSHm4zAAKCRCOHjXGZ1Q1G9DZAKC9K0qtWQE6CVic
|
||||
IV659tdM0rZzqgCfaOC25bYAp4ISZBo+HUH6zJy51BDMzAP/TyqD7Fme1lwF2dWT
|
||||
tWcUInqOwhLX896WaH9Y5NJYe98MNpQxr3wizYOwdJa3t9+MVvH0+s6ih4aaJ49n
|
||||
71yaef7YVkZ+0gbdKrOOrILwPg4hHizMKKDGbMaJ1OTJbE3PjFhEsdZRy1M1wjzX
|
||||
Jysr6rop4tOTfXLTX7m5hXkfJ/k=
|
||||
=soRW
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
pub 2048R/0ED3D317 2012-04-09 [expires: 2017-04-08]
|
||||
uid Glenn Adams <gadams@apache.org>
|
||||
sig 3 0ED3D317 2012-04-09 Glenn Adams <gadams@apache.org>
|
||||
sub 2048R/F23E86C1 2012-04-09 [expires: 2017-04-08]
|
||||
sig 0ED3D317 2012-04-09 Glenn Adams <gadams@apache.org>
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.11 (Darwin)
|
||||
|
||||
mQENBE+DFvEBCACwHesM5hkZrlgPiq588FbZPe7QGtDRVdh0YbgI2A4Ky2odbFmA
|
||||
/n7lF9v+yf+FUn/0H2igwDYqLFx4JsB7z+Nvj+hwExdGQxuDaGSwMjjpJeEiuEmf
|
||||
b1Er5KYgpeFNm1MVP+r5kW5962O+HGIEx1xQ85AskNbr/jQkAg/wbbwWLFBQRMER
|
||||
PqFs1rXL2aWip8XtNPKnKBLPlFPn9a7glgB5Whgbls44KpR0dplAVoCWMnZEYnTA
|
||||
JYITcaDTCGFQI7aYgbj986RpS80o/Wcsnb8rjHKRZG8TaDr9MbgmmK39KwiJCflJ
|
||||
9LvXR9g1j3addxgqEUuQBEtoLkWs/eDT/KQ7ABEBAAG0H0dsZW5uIEFkYW1zIDxn
|
||||
YWRhbXNAYXBhY2hlLm9yZz6JAT4EEwECACgFAk+DFvECGwMFCQlmAYAGCwkIBwMC
|
||||
BhUIAgkKCwQWAgMBAh4BAheAAAoJEGZUur4O09MXl7MH/jfeyE012/ABTTjvwvRw
|
||||
2evD3cfghrZOQVT3PVEcVnXIcnVlmznO2DDs8aWXlhJ94ZnNdw8iKE8weK1FGXdd
|
||||
qWA7vHrOI1UAo7h+CDaBt0TM6OEM3Mp3+5baOJMRXyrjhbv74sj88HYRtoPhA2+z
|
||||
5ilVNmmX4PEAc6wqt87ZfNQ2ZqX2YzR+OaT5OggSB12qU/uE7d4d0NcDozEKQFUP
|
||||
CMAuPJRNd4/J5yFy0DStfgsDKuUTir0oldlUElAjbhF8WtAgRwufIYuG/r4Cbuid
|
||||
Qc32yVAoy069ZcggwBpkzVPOpL2by1fzeSohjIkntDIL474KuSSoBKCuw2nYxpyw
|
||||
b0O5AQ0ET4MW8QEIAMFUAScm2Dw1fmBhmKMVc0mzqpR8TvSQvwJLiXRSP86NI1zc
|
||||
DtuiXCFfNZykOifFk50otMH1hd91hqeQ6HfsxxYtXLg2UDHG2gTKzlWefwA+1eFc
|
||||
M8fz/oV0CanGjqaOd6VZoYeg+LSD6YgrJZVjuoxNN/S0A9fNd8B3CXsG+92udkkW
|
||||
YMyiUpD5qjMEwcjmj6ITX3M9VLxDCKKhYwN+u5wokuAk3yKtvBpWhJDQbaJcuDaC
|
||||
rLH788gFybZDzyJ8Ug/95peV9Z57OCjMJLtn67ES7fB544EQRYVmDGnX5tTo9sYj
|
||||
0bDjlbKX9lqS1sCGSezPxYxGgeXlnQrt+Sm+gd0AEQEAAYkBJQQYAQIADwUCT4MW
|
||||
8QIbDAUJCWYBgAAKCRBmVLq+DtPTF2YbB/0Vo8Xr9N1adqlY1UAofvo5AoXZFxFJ
|
||||
jkB0Eb3z1V3iSBh8P921LD0gUQz6JXptXZPVGnwgm/44RdqXC+kX+4MxiVBtNAHp
|
||||
0ODjIXiabBrixAHnT7EcAJkWue0RP2J5wiYKklwWFbEetjl0QSmitz8Jh33eA76j
|
||||
kFYW+vgKUMA8UrJ6j2Hk+vMFi0Odtntbc7AXvLifSPSmSztNe/Mws69EbuBph6bQ
|
||||
+zSmTQ6nt8PX+v3e0PnkXdGD8si9H6hj0K32pEMz86ttSnAtrhvsAdKPYOkY7/JD
|
||||
0Bl+bnb7FLxJjJGlGuO/Rn5SIR3fFNQGrE/zl2wsKtftUXse6kkZSue+
|
||||
=XDBB
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
pub 4096R/7CDB6DEA 2015-05-20
|
||||
uid Simon Steiner (CODE SIGNING KEY) <ssteiner@apache.org>
|
||||
sub 4096R/73382B77 2015-05-20
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1
|
||||
|
||||
mQINBFVcZesBEAC5Poew53ijRTE5kV2o2Tj+plJmoQMRtfiurMUpPQ4s/vTz8Bte
|
||||
WoHdNfJrzordHBZdy1S7V8p2kTtKWyaNFMyVoavBqo/BurmJ/3qUKH5otXkXuaAi
|
||||
zFaJPeEnR6y7pxTYkwFKyrn7TE4I84JKZEMLEbJIw1YF3t76nj055/OnzRtwc2Df
|
||||
cPyGqDALyoFXk6R04qIotVmlX3NwwF6A0M79+W+kWvPg4sD4R6SqwJb1UhcqHrqb
|
||||
kQOllg74cBjyAikRbqrCfoydHM10gc8f5w9+8v/fbDkSBtoh8Y31WSK6ocoWIg85
|
||||
I3odqHFxThwFTAYQC2tdw1M5kYcOiYVqw91JvBivpKH02vryH2BJu9zQDNFeyXud
|
||||
wyengMLlzUUmf9jBk3M8IUE4JTerw1AzWj0b3jdvG7FrgHrlszb6eCzE3BdY7zGS
|
||||
Qh6e+ROsF2LEKkbjxeAg58nl/h5iLythheY0S6sspeOTuDtgLgm8TZiGHA+j/qKH
|
||||
DY+aRReI0X2bzqNZROhTIXHSKsoX9+9g5a+1NYQeZmiICNo4vj+r4+i037QvIoy6
|
||||
3K4NSVQgKnR9bbgyQCUprifrkywKF5a8eP3wtUGtH2FNqFQg1rUKBgLjLbRJ8PF2
|
||||
Ag8O0jmJBPxdOIdVP4vz37m+jyKE6L4JWjnaFldtD3NDJI1QQYX4MmXEaQARAQAB
|
||||
tDZTaW1vbiBTdGVpbmVyIChDT0RFIFNJR05JTkcgS0VZKSA8c3N0ZWluZXJAYXBh
|
||||
Y2hlLm9yZz6JAjgEEwECACIFAlVcZesCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4B
|
||||
AheAAAoJEFuT8d98223qTtoP/j5AH1w90HOiYioGGgxrxOciQdGNht0yOVPXHDyj
|
||||
8oKNBKYhNYQ9tAxNxEZFVS2KxB3R5dy/Q/9XvOP/NYTP8p0VyXmxNMkicUhJQOJ/
|
||||
6mnxkTY/jk7y2XkYtdCby28SfMdExbM501arnG+vmXRtr3TpRRAxXCfS3FBI2n1H
|
||||
Y7aX8pVX3NNRQqGxjnSv4q/2NKrR1ZFt7aDuAO9VfLXd5NkJkaGJ7E7T4AQMJE6K
|
||||
KYUFkYKGeOc5dm1mHZMTVanyYRS0qWSpcnsamdU76HQgtC7koJmaeeI0MtntMkpB
|
||||
jObTY80iam97P81hfhEi9UsAPy0WPBmossNqQFYQ5kQzxq030C1ERJl1nXJCkIpl
|
||||
CpVv/aIV+kM+WQeA41IHgfLZsxHTkYRxtCZXh8HbFhpyKGwNRZhyvPn0oSbjQcke
|
||||
oAbfnxCj1YH6TQGJQH1R1rGPv3ph3omq9pRuJ/th4uFmq06xpO6VLjUICV9F1N1J
|
||||
kmiVpivC5iRDKw30YeRFe/J0BpflPizQh2gnTFCg0Q0ICUdehGovWKPDkJsG2+hb
|
||||
AJaxfYQg5cJQI1P0UOc3w6rLh2ye3qkSRxF1O9oyRHuAZtKtsabEg3v7bx6RnX1F
|
||||
BYGCB8ckud+qYlBjiGKLP7fJotuZv3hFWlFBoXb9F0WDpx+gUoEUH8H+9ygodEUq
|
||||
gjCRuQINBFVcZesBEADFcTVSAZoaax9xpw1zxwjVgfQrNfobqnJM33r2EBSB4b80
|
||||
NbPOtoHJ2OUvHq4w84PB+H4+JNAIA2KbPOvzB+u1Bn5IgJr9asH5lhrnrUSR+YCw
|
||||
UlnCw+2YJumdv/l6RKcFKbSRZHWSwTD3ZLBMuPUqX9uZkOuG1ftTkcVtfFHN3WAu
|
||||
ckHjVxTSkaHhZ7ALz8LIUH+8AL3/3eThM1KEgx+bcod8YttctzjTy9cAaT93DwKO
|
||||
qzqHXpk6Fpv9bvdiNye8Ye7f8487N0/3alMPpJqt2tHAqjxJRDb590/09cbt2N6l
|
||||
6B+WlpM5hgkV//7ViL357Hids64sqbYSnmpQjZWUdafDvVvMKYbITmx26BEoWtIq
|
||||
wwpj7+DdQlxd/7bAtyk8XiHe6Ej9FF1PUEvBQw5NXOUiCSBo0hzcMMNy1uRb/Wpd
|
||||
oZX3TFKXTWulv95uzKGAo3zrUuKcfOGfDgqZ/H2dy8Yw9DaWJRnXyYwweUi1Ptnc
|
||||
Nk9ktycypCcVbsOQhGdQJNyGVUVgVV1CWz5GJ3eqtjHY09r7HEm6bGviJRu/sosk
|
||||
XmmjRUFpqwtDCRACYShDpnFjpmWTZegPcwpN+492qLP6cjh1XSN4Cg1YZ/0BMY4N
|
||||
V/yeadQf/hbM5hzPOhN6mr+VHOLulyXuV49EWisIRferqaXG67zIXbVQ4qfqfwAR
|
||||
AQABiQIfBBgBAgAJBQJVXGXrAhsMAAoJEFuT8d98223qGKoP/RtyjtE5zEkrd7oa
|
||||
vRK5FmNtdh8r63v8lwjxayCfmpQw14AQaPY7//ulfJQExpxqcCLFIEBqZ8o22RYA
|
||||
XnsV6RF3JAIjSktAh57GMqUljeNxBtlix2zv5MVi/XiYcmQrID812KNfp3/guJfK
|
||||
3Us5BOxLyDwHylwyb88dLM3rP4W8VvaRAEXfd0/6rhEugdCdcHD1c+E1XliqBw/T
|
||||
UP3JjnnABfKR4NMZ67ENxc5jPDg2Jh3wychGGhvLddqk32KEIDTbV2SZYxtw3ylP
|
||||
cRUtEoVGvkCDj8KpcLvvTbE7QCOycQMj1aHt5tc0w+Ibqbj3X+DdJEAxuZhMDyR6
|
||||
hDkIr7YGkRjFacYeaunoY4tX4+x4tkf33eNsBa3DV6r6R18DWh8o6bWzHpPuEMZT
|
||||
ewbUuSHF9xm0Ti3uehDHNHIFsnEpGDanb2UMO1kd2Xr6kjabce4DIHn+PhOqwC1o
|
||||
bO9KBKaWO4uR7K1eWjOkqn70F7ykGz01AveouwRyOjh59VdpVe/Zpgtp/IvD6bP2
|
||||
FbW6pZZeHWWoj+zaDmyRDn5wRfGkNuLUIMblgCXQXttAm/nYdRwPQyAI+T5CP8f+
|
||||
nmZfX1E6PwDD9rT+fU+0R1eAIkEZE+0UfWoBwbnei19Xqpwx6VH5x8mtfvUH9J5H
|
||||
PYDEgpBqDxD3E1CYq/cVFhKQRxpK
|
||||
=n+z/
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
202
apache_fop/LICENSE
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed 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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
5
apache_fop/NOTICE
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Apache FOP
|
||||
Copyright 1999-2025 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
494
apache_fop/README
Normal file
|
|
@ -0,0 +1,494 @@
|
|||
$Id$
|
||||
|
||||
==============================================================================
|
||||
APACHE FOP - README
|
||||
==============================================================================
|
||||
|
||||
Contents of this file:
|
||||
- What is FOP?
|
||||
- Legal Information
|
||||
- Where to get help?
|
||||
- How do I build FOP?
|
||||
- How do I run FOP?
|
||||
- Release Notes
|
||||
|
||||
==============================================================================
|
||||
|
||||
|
||||
What is FOP?
|
||||
------------
|
||||
|
||||
Apache FOP is a print formatter driven by XSL formatting objects. It is a Java
|
||||
application that reads a formatting object tree conforming to the XSL 1.1
|
||||
Recommendation (05 December 2006) and then turns it into a PDF document,
|
||||
certain other output formats or allows you to preview it directly on screen.
|
||||
Note that not all parts of the XSL 1.1 specification have yet been
|
||||
implemented.
|
||||
|
||||
Apache FOP is part of Apache's XML Graphics project. The homepage of Apache
|
||||
FOP is http://xmlgraphics.apache.org/fop/.
|
||||
|
||||
|
||||
Legal Information
|
||||
-----------------
|
||||
|
||||
Apache FOP is published under the Apache License version 2.0. For the license
|
||||
text, please see the following files:
|
||||
- LICENSE
|
||||
- NOTICE
|
||||
|
||||
Legal information on libraries used by Apache FOP can be found in the
|
||||
"lib/README.txt" file.
|
||||
|
||||
Here is a list of files included in Apache FOP but not published under Apache
|
||||
License version 2.0:
|
||||
- K3 3 of 9 barcode font (TrueType)
|
||||
File: examples/fo/advanced/K3.TTF
|
||||
Info: examples/fo/advanced/K3.README
|
||||
- DejaVu LGC Serif font (TrueType)
|
||||
File: test/resources/fonts/DejaVuLGCSerif.ttf
|
||||
Info: test/resources/fonts/DejaVuLGCSerif.LICENSE
|
||||
|
||||
|
||||
Where to get help?
|
||||
------------------
|
||||
|
||||
http://xmlgraphics.apache.org/fop/gethelp.html
|
||||
|
||||
A mailing list where you can get all your questions about FOP answered is at
|
||||
fop-users@xmlgraphics.apache.org. You can subscribe by sending an empty mail
|
||||
to fop-users-subscribe@xmlgraphics.apache.org.
|
||||
|
||||
Before you post any questions, please have a look at the FAQ at
|
||||
http://xmlgraphics.apache.org/fop/faq.html and FO help page at
|
||||
http://xmlgraphics.apache.org/fop/fo.html.
|
||||
|
||||
Please report bugs at https://issues.apache.org/jira/browse/FOP
|
||||
|
||||
|
||||
How do I build FOP?
|
||||
-------------------
|
||||
|
||||
If you've downloaded a binary distribution, you don't need to build
|
||||
FOP.
|
||||
|
||||
Otherwise, please follow the instructions found here:
|
||||
http://xmlgraphics.apache.org/fop/stable/compiling.html
|
||||
|
||||
[TEMPORARY]
|
||||
|
||||
Until the above referenced instructions are updated, one of the following
|
||||
may be used to build FOP:
|
||||
|
||||
Building with Maven (preferred)
|
||||
|
||||
% mvn clean install
|
||||
|
||||
Building with Ant (deprecated)
|
||||
|
||||
% ant -f fop/build.xml clean all
|
||||
|
||||
How do I run FOP?
|
||||
-----------------
|
||||
|
||||
Simply by typing "fop" on the command-line. Without any parameters you
|
||||
will receive a screen with instruction on how to call FOP from the
|
||||
command-line.
|
||||
|
||||
For more details, see:
|
||||
http://xmlgraphics.apache.org/fop/stable/running.html
|
||||
|
||||
[TEMPORARY]
|
||||
|
||||
Note that FOP command line scripts and build results from ant will be found
|
||||
under the ./fop sub-directory.
|
||||
|
||||
==============================================================================
|
||||
RELEASE NOTES
|
||||
==============================================================================
|
||||
|
||||
Version 2.11
|
||||
============
|
||||
|
||||
Major Changes in Version 2.11
|
||||
-----------------------------
|
||||
|
||||
* Upgrade to PDFBox 3
|
||||
* Add support for PDF object streams
|
||||
* Add option to lazy load fonts for PNG/TIFF/PCL output
|
||||
* Add option to combine AFP page groups
|
||||
* Add option to convert image to CMYK
|
||||
* Add option for static content structure element per page
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.10
|
||||
============
|
||||
|
||||
Major Changes in Version 2.10
|
||||
-----------------------------
|
||||
|
||||
* Add option to sign PDF
|
||||
* Add image mask option for AFP
|
||||
* Allow change of resource level for SVG in AFP
|
||||
* Switch to Jakarta servlet API
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.9
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.9
|
||||
----------------------------
|
||||
|
||||
* Add support for font-selection-strategy=character-by-character
|
||||
* Allow XMP at PDF page level
|
||||
* Allow use of page position only on redo of layout
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.8
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.8
|
||||
----------------------------
|
||||
|
||||
* Require Java 8 or later
|
||||
* Transparency color support
|
||||
* Light weight line breaking option
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.7
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.7
|
||||
----------------------------
|
||||
|
||||
* Allow to embed native PDF in AFP
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.6
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.6
|
||||
----------------------------
|
||||
|
||||
* Support OTF/TTF SVG fonts
|
||||
* Allow overpaint of PDF border
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.5
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.5
|
||||
----------------------------
|
||||
|
||||
* Allow to hide empty blocks from structure tree
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.4
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.4
|
||||
----------------------------
|
||||
|
||||
* Require Java 7 or later
|
||||
* Drop dependency on Avalon-Framework
|
||||
* Add change bar generation
|
||||
* Add support for Khmer complex script
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.3
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.3
|
||||
----------------------------
|
||||
|
||||
* Support for unicode Surrogate pairs
|
||||
* OTF fonts not working on Mac Preview
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.2
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.2
|
||||
----------------------------
|
||||
|
||||
* PCL Color support
|
||||
* Allow generation of bold/italic versions of fonts for PDF
|
||||
* Allow to convert OTF fonts to Type 1 for Postscript
|
||||
* Deduplicate PDF content streams
|
||||
* Update to PDFBox 2
|
||||
* Transition from Ant to Maven Build Process
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.1
|
||||
===========
|
||||
|
||||
Major Changes in Version 2.1
|
||||
----------------------------
|
||||
|
||||
* Add PreloaderRawPNG to handle images ImageIO cant
|
||||
* Support Barcode4J page number
|
||||
* Support CMYK JPEG in AFP
|
||||
* Support IPD change on last page
|
||||
* Support PDF/UA
|
||||
* Support TrueType fonts in PCL
|
||||
* Support Truetype for AFP
|
||||
* Support for PDF/A-3
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 2.0
|
||||
===========
|
||||
|
||||
Java 6 or later is the minimum runtime environment needed.
|
||||
|
||||
Because of changes to the API, the version number has been bumped to 2.0.
|
||||
|
||||
Major Changes in Version 2.0
|
||||
----------------------------
|
||||
|
||||
* Side float support
|
||||
* Whitespace Management Extension
|
||||
* fo:inline-container partial support
|
||||
* Improved support for complex scripts
|
||||
* PDF Linearization
|
||||
* Support OpenType CFF fonts
|
||||
* Subset support for Type 1 fonts
|
||||
* Support for AES 256 PDF encryption
|
||||
* SVG graphics can use FOP custom fonts
|
||||
|
||||
This release also contains a number of bug fixes.
|
||||
|
||||
Version 1.1
|
||||
===========
|
||||
|
||||
This release of Apache FOP primarily addresses bug fixes and also adds a number
|
||||
of new features. See below for details.
|
||||
|
||||
Compliance
|
||||
----------
|
||||
|
||||
This release implements the XSL 1.0 and 1.1 recommendations to a relatively
|
||||
high degree of compliance. See the compliance page
|
||||
http://xmlgraphics.apache.org/fop/compliance.html for further details.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
A detailed list of known issues in this release is available at
|
||||
http://xmlgraphics.apache.org/fop/1.1/knownissues_overview.html.
|
||||
|
||||
Major Changes in Version 1.1
|
||||
----------------------------
|
||||
|
||||
* Adds support for complex scripts.
|
||||
* Adds support for TTF fonts in PostScript.
|
||||
* Adds support for PDF Object Streams.
|
||||
* Adds support for PDF 128-bit encryption.
|
||||
|
||||
A more detailed list of changes in this release is available at
|
||||
http://xmlgraphics.apache.org/fop/1.1/changes_1.1.html.
|
||||
|
||||
A more detailed list of changes in this and earlier releases is available at
|
||||
http://xmlgraphics.apache.org/fop/changes.html.
|
||||
|
||||
Version 1.0
|
||||
===========
|
||||
|
||||
This is a production grade release of Apache FOP.
|
||||
It contains many bug fixes and new features. See below for details.
|
||||
|
||||
Compliance
|
||||
----------
|
||||
|
||||
This release implements the XSL 1.0 and 1.1 recommendations to a high
|
||||
degree of compliance. See the compliance page
|
||||
http://xmlgraphics.apache.org/fop/compliance.html for a detailed
|
||||
overview.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
The known issues of this release are listed at
|
||||
http://xmlgraphics.apache.org/fop/1.0/knownissues_overview.html.
|
||||
|
||||
Major Changes in Version 1.0
|
||||
----------------------------
|
||||
|
||||
* Added support for addressing all glyphs available in a Type 1 font
|
||||
* Added support for auto-configuring TrueType Collections. XML font
|
||||
metrics files for *.ttc fonts are not required anymore.
|
||||
* Added support for rendering pages using Java Printing System.
|
||||
* Support character-by-character font-selection strategy on
|
||||
fo:character element.
|
||||
* Implemented word-by-ford font-selection strategy on text.
|
||||
* AFP Output: Various enhancements
|
||||
* FOP now creates ToUnicode CMaps for single-byte fonts that don't use
|
||||
built-in encodings
|
||||
* Introduced a new, additional intermediate format optimized for
|
||||
performance. See the intermediate format documentation for details.
|
||||
* Added an initial set of extensions for prepress support.
|
||||
* Added limited support for different page widths within a page-sequence.
|
||||
* Added support for TrueType fonts with symbol character maps (like
|
||||
"Wingdings" and "Symbol").
|
||||
* Added an event handling framework which allows to get better feedback
|
||||
from within FOP with the ability to customize problem management.
|
||||
|
||||
The long list of changes in this release is available at
|
||||
http://xmlgraphics.apache.org/fop/1.0/changes_1.0.html.
|
||||
|
||||
The long list of changes in this and earlier releases is available at
|
||||
http://xmlgraphics.apache.org/fop/changes.html.
|
||||
|
||||
Version 0.95
|
||||
============
|
||||
|
||||
This is a production grade release of Apache FOP.
|
||||
It contains many bug fixes and new features. See below for details.
|
||||
|
||||
Compliance
|
||||
----------
|
||||
|
||||
This release implements the XSL 1.0 and 1.1 recommendations to a high
|
||||
degree of compliance. See the compliance page
|
||||
http://xmlgraphics.apache.org/fop/compliance.html for a detailed
|
||||
overview.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
The known issues of this release are listed at
|
||||
http://xmlgraphics.apache.org/fop/0.95/knownissues_overview.html.
|
||||
|
||||
Major Changes in Version 0.95
|
||||
-----------------------------
|
||||
|
||||
* Add new fox:external-document extension element that allows to insert whole
|
||||
documents into a page-sequence (JM)
|
||||
* Add support for background on fo:table-column and fo:table-header/footer/body
|
||||
elements (VH)
|
||||
* Add support for conditional borders in tables (VH)
|
||||
* Add support for scale-down-to-fit and scale-up-to-fit (JM)
|
||||
* Fix various bugs and performance problems with external graphics by
|
||||
introducing a new image loading framework (JM)
|
||||
|
||||
The long list of changes in this release is available at
|
||||
http://xmlgraphics.apache.org/fop/0.95/changes_0.95.html.
|
||||
|
||||
The long list of changes in this and earlier releases is available at
|
||||
http://xmlgraphics.apache.org/fop/changes.html.
|
||||
|
||||
Changes since Version 0.95beta
|
||||
------------------------------
|
||||
Please refer to the list of changes on the web:
|
||||
http://xmlgraphics.apache.org/fop/changes.html
|
||||
|
||||
|
||||
Version 0.94
|
||||
============
|
||||
|
||||
This is the second production grade release of the new FOP codebase.
|
||||
It contains many bug fixes and new features. See below for details.
|
||||
|
||||
Compliance
|
||||
----------
|
||||
|
||||
This release implements the XSL 1.0 and 1.1 recommendations to a high
|
||||
degree of compliance. See the compliance page
|
||||
http://xmlgraphics.apache.org/fop/compliance.html for a detailed
|
||||
overview.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
The known issues of this release are listed at
|
||||
http://xmlgraphics.apache.org/fop/0.94/knownissues_overview.html.
|
||||
|
||||
Major Changes in Version 0.94
|
||||
-----------------------------
|
||||
|
||||
* Add support for font auto-detection (JM) Thanks to Adrian Cumiskey
|
||||
* Add support for the border-collapsing model in tables (VH, JM)
|
||||
* Add support for named destinations in PDF (JB)
|
||||
* Add support for UAX#14 type line breaking (MM)
|
||||
|
||||
The long list of changes in this release is available at
|
||||
http://xmlgraphics.apache.org/fop/0.94/changes_0.94.html.
|
||||
|
||||
The long list of changes in this and earlier releases is available at
|
||||
http://xmlgraphics.apache.org/fop/changes.html.
|
||||
|
||||
|
||||
Version 0.93
|
||||
============
|
||||
|
||||
This is the first production grade release of the new FOP codebase.
|
||||
|
||||
* It contains the new API first introduced in release 0.92
|
||||
beta. The preceding API has been removed.
|
||||
* This release again contains many bug fixes and new features. See
|
||||
below for details.
|
||||
|
||||
Compliance
|
||||
----------
|
||||
|
||||
This release implements the XSL 1.0 and 1.1 recommendations to a high
|
||||
degree of compliance. See the compliance page
|
||||
http://xmlgraphics.apache.org/fop/compliance.html for a detailed
|
||||
overview.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
The known issues of this release are listed at
|
||||
http://xmlgraphics.apache.org/fop/knownissues.html.
|
||||
|
||||
Upgrading
|
||||
---------
|
||||
|
||||
You may experience different behaviour compared to version
|
||||
0.20.5. Please consult the "Upgrading" page
|
||||
(http://xmlgraphics.apache.org/fop/stable/upgrading.html) for
|
||||
details.
|
||||
|
||||
Major Changes in Version 0.93
|
||||
-----------------------------
|
||||
|
||||
* Added support for the use of Open Type fonts (BD)
|
||||
* Support for the rgb-icc() function and for a proprietary cmyk()
|
||||
function (for device CMYK colors only through the PDF renderer so
|
||||
far). (JM) Thanks to Peter Coppens. Fixes 40729.
|
||||
* Enabled Copy/Paste from PDF content in Acrobat Reader for
|
||||
text using embedded TrueType fonts. (BD) Thanks to Adam Strzelecki,
|
||||
Victor Mote. Fixes 5535.
|
||||
* Added support for PDF/A-1b and PDF/X-3:2003. (Note: this may still
|
||||
be a bit incomplete. Feedback is welcome!)
|
||||
* The Java2DRenderer (and therefore the print and bitmap renderers) is
|
||||
now offering the same quality as the PDF and PS renderers. Note:
|
||||
There can still be little differences between PDF and Print/PNG/TIFF
|
||||
because the latter uses a different font metrics source.
|
||||
* Automatic support for all fonts available to the Java2D subsystem
|
||||
for all Java2D-descendant renderers (TIFF, PNG, print, AWT).
|
||||
|
||||
The long list of changes in this release is available at
|
||||
http://xmlgraphics.apache.org/fop/0.93/changes_0.93.html.
|
||||
|
||||
The long list of changes in this and earlier releases is available at
|
||||
http://xmlgraphics.apache.org/fop/changes.html.
|
||||
|
||||
The Apache FOP team asks you for your continued feedback on the
|
||||
software. We're also interested in success stories with the new
|
||||
release. So if the latest version works fine for you, please tell us!
|
||||
And if it doesn't, you may tell us as well, of course. ;-)
|
||||
|
||||
Release notes for older FOP versions can be found on:
|
||||
http://xmlgraphics.apache.org/fop/relnotes.html
|
||||
BIN
apache_fop/fop/.DS_Store
vendored
Normal file
BIN
apache_fop/fop/build/fop-2.11.jar
Normal file
BIN
apache_fop/fop/build/fop-core-2.11.jar
Normal file
BIN
apache_fop/fop/build/fop-events-2.11.jar
Normal file
BIN
apache_fop/fop/build/fop-util-2.11.jar
Normal file
466
apache_fop/fop/conf/fop.xconf
Normal file
|
|
@ -0,0 +1,466 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- $Id$ -->
|
||||
|
||||
<!--
|
||||
|
||||
This is an example configuration file for FOP.
|
||||
This file contains the same settings as the default values
|
||||
and will have no effect if used unchanged.
|
||||
|
||||
Relative config url's will be resolved relative to
|
||||
the location of this file.
|
||||
|
||||
-->
|
||||
|
||||
<!-- NOTE: This is the version of the 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="11.00in" width="8.50in"/>
|
||||
|
||||
<!-- 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>
|
||||
<!-- embedded fonts -->
|
||||
<!--
|
||||
This information must exactly match the font specified
|
||||
in the fo file. Otherwise it will use a default font.
|
||||
|
||||
For example,
|
||||
<fo:inline font-family="Arial" font-weight="bold" font-style="normal">
|
||||
Arial-normal-normal font
|
||||
</fo:inline>
|
||||
for the font triplet specified by:
|
||||
<font-triplet name="Arial" style="normal" weight="bold"/>
|
||||
|
||||
If you do not want to embed the font in the pdf document
|
||||
then do not include the "embed-url" attribute.
|
||||
The font will be needed where the document is viewed
|
||||
for it to be displayed properly.
|
||||
|
||||
possible styles: normal | italic | oblique | backslant
|
||||
possible weights: normal | bold | 100 | 200 | 300 | 400
|
||||
| 500 | 600 | 700 | 800 | 900
|
||||
(normal = 400, bold = 700)
|
||||
-->
|
||||
|
||||
<!--
|
||||
<font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
|
||||
<font-triplet name="Arial" style="normal" weight="normal"/>
|
||||
<font-triplet name="ArialMT" style="normal" weight="normal"/>
|
||||
</font>
|
||||
<font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
|
||||
<font-triplet name="Arial" style="normal" weight="bold"/>
|
||||
<font-triplet name="ArialMT" style="normal" weight="bold"/>
|
||||
</font>
|
||||
-->
|
||||
|
||||
<!-- auto-detect fonts -->
|
||||
<auto-detect/>
|
||||
|
||||
</fonts>
|
||||
|
||||
<!-- This option lets you specify additional options on an XML handler -->
|
||||
<!--xml-handler namespace="http://www.w3.org/2000/svg">
|
||||
<stroke-text>false</stroke-text>
|
||||
</xml-handler-->
|
||||
|
||||
</renderer>
|
||||
|
||||
<renderer mime="application/x-afp">
|
||||
<!--
|
||||
The bit depth and type of images produced
|
||||
(this is the default setting)
|
||||
-->
|
||||
<images mode="b+w" bits-per-pixel="8"/>
|
||||
<renderer-resolution>240</renderer-resolution>
|
||||
<line-width-correction>2.5</line-width-correction>
|
||||
<resource-group-file>resources.afp</resource-group-file>
|
||||
|
||||
<fonts>
|
||||
<!--
|
||||
Below is an example using raster font configuration using FOP builtin base-14 font metrics.
|
||||
for Times Roman, Helvetica and Courier.
|
||||
|
||||
Depending on AFP raster and outline font availability on your installation you will
|
||||
most likely need to modify the configuration provided below.
|
||||
|
||||
See http://xmlgraphics.apache.org/fop/trunk/output.html#afp-configuration
|
||||
for details of FOP configuration for AFP
|
||||
-->
|
||||
|
||||
<!-- Times Roman -->
|
||||
<font>
|
||||
<afp-font name="Times Roman" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0N20060" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="7" characterset="C0N20070" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="8" characterset="C0N20080" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="9" characterset="C0N20090" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="10" characterset="C0N20000" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="11" characterset="C0N200A0" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="12" characterset="C0N200B0" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="14" characterset="C0N200D0" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="16" characterset="C0N200F0" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="18" characterset="C0N200H0" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="20" characterset="C0N200J0" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="24" characterset="C0N200N0" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="30" characterset="C0N200T0" base14-font="TimesRoman"/>
|
||||
<afp-raster-font size="36" characterset="C0N200Z0" base14-font="TimesRoman"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Times" style="normal" weight="normal"/>
|
||||
<font-triplet name="TimesRoman" style="normal" weight="normal"/>
|
||||
<font-triplet name="Times Roman" style="normal" weight="normal"/>
|
||||
<font-triplet name="Times-Roman" style="normal" weight="normal"/>
|
||||
<font-triplet name="Times New Roman" style="normal" weight="normal"/>
|
||||
<font-triplet name="TimesNewRoman" style="normal" weight="normal"/>
|
||||
<font-triplet name="serif" style="normal" weight="normal"/>
|
||||
</font>
|
||||
|
||||
<!-- Times Roman Italic -->
|
||||
<font>
|
||||
<afp-font name="Times Roman Italic" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0N30060" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="7" characterset="C0N30070" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="8" characterset="C0N30080" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="9" characterset="C0N30090" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="10" characterset="C0N30000" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="11" characterset="C0N300A0" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="12" characterset="C0N300B0" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="14" characterset="C0N300D0" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="16" characterset="C0N300F0" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="18" characterset="C0N300H0" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="20" characterset="C0N300J0" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="24" characterset="C0N300N0" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="30" characterset="C0N300T0" base14-font="TimesItalic"/>
|
||||
<afp-raster-font size="36" characterset="C0N300Z0" base14-font="TimesItalic"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Times" style="italic" weight="normal"/>
|
||||
<font-triplet name="TimesRoman" style="italic" weight="normal"/>
|
||||
<font-triplet name="Times Roman" style="italic" weight="normal"/>
|
||||
<font-triplet name="Times-Roman" style="italic" weight="normal"/>
|
||||
<font-triplet name="Times New Roman" style="italic" weight="normal"/>
|
||||
<font-triplet name="TimesNewRoman" style="italic" weight="normal"/>
|
||||
<font-triplet name="serif" style="italic" weight="normal"/>
|
||||
</font>
|
||||
|
||||
<!-- Times Roman Bold -->
|
||||
<font>
|
||||
<afp-font name="Times Roman Bold" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0N40060" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="7" characterset="C0N40070" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="8" characterset="C0N40080" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="9" characterset="C0N40090" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="10" characterset="C0N40000" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="11" characterset="C0N400A0" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="12" characterset="C0N400B0" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="14" characterset="C0N400D0" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="16" characterset="C0N400F0" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="18" characterset="C0N400H0" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="20" characterset="C0N400J0" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="24" characterset="C0N400N0" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="30" characterset="C0N400T0" base14-font="TimesBold"/>
|
||||
<afp-raster-font size="36" characterset="C0N400Z0" base14-font="TimesBold"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Times" style="normal" weight="bold"/>
|
||||
<font-triplet name="TimesRoman" style="normal" weight="bold"/>
|
||||
<font-triplet name="Times Roman" style="normal" weight="bold"/>
|
||||
<font-triplet name="Times-Roman" style="normal" weight="bold"/>
|
||||
<font-triplet name="Times New Roman" style="normal" weight="bold"/>
|
||||
<font-triplet name="TimesNewRoman" style="normal" weight="bold"/>
|
||||
<font-triplet name="serif" style="normal" weight="bold"/>
|
||||
</font>
|
||||
|
||||
<!-- Times Roman Italic Bold -->
|
||||
<font>
|
||||
<afp-font name="Times Roman Italic Bold" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0N50060" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="7" characterset="C0N50070" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="8" characterset="C0N50080" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="9" characterset="C0N50090" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="10" characterset="C0N50000" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="11" characterset="C0N500A0" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="12" characterset="C0N500B0" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="14" characterset="C0N500D0" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="16" characterset="C0N500F0" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="18" characterset="C0N500H0" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="20" characterset="C0N500J0" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="24" characterset="C0N500N0" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="30" characterset="C0N500T0" base14-font="TimesBoldItalic"/>
|
||||
<afp-raster-font size="36" characterset="C0N500Z0" base14-font="TimesBoldItalic"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Times" style="italic" weight="bold"/>
|
||||
<font-triplet name="TimesRoman" style="italic" weight="bold"/>
|
||||
<font-triplet name="Times Roman" style="italic" weight="bold"/>
|
||||
<font-triplet name="Times-Roman" style="italic" weight="bold"/>
|
||||
<font-triplet name="Times New Roman" style="italic" weight="bold"/>
|
||||
<font-triplet name="TimesNewRoman" style="italic" weight="bold"/>
|
||||
<font-triplet name="serif" style="italic" weight="bold"/>
|
||||
</font>
|
||||
|
||||
<!-- Helvetica -->
|
||||
<font>
|
||||
<afp-font name="Helvetica" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0H20060" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="7" characterset="C0H20070" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="8" characterset="C0H20080" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="9" characterset="C0H20090" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="10" characterset="C0H20000" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="11" characterset="C0H200A0" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="12" characterset="C0H200B0" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="14" characterset="C0H200D0" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="16" characterset="C0H200F0" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="18" characterset="C0H200H0" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="20" characterset="C0H200J0" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="24" characterset="C0H200N0" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="30" characterset="C0H200T0" base14-font="Helvetica"/>
|
||||
<afp-raster-font size="36" characterset="C0H200Z0" base14-font="Helvetica"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Helvetica" style="normal" weight="normal"/>
|
||||
<font-triplet name="Arial" style="normal" weight="normal"/>
|
||||
<font-triplet name="sans-serif" style="normal" weight="normal"/>
|
||||
<font-triplet name="any" style="normal" weight="normal"/>
|
||||
</font>
|
||||
|
||||
<!-- Helvetica Italic -->
|
||||
<font>
|
||||
<afp-font name="Helvetica Italic" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0H30060" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="7" characterset="C0H30070" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="8" characterset="C0H30080" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="9" characterset="C0H30090" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="10" characterset="C0H30000" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="11" characterset="C0H300A0" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="12" characterset="C0H300B0" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="14" characterset="C0H300D0" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="16" characterset="C0H300F0" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="18" characterset="C0H300H0" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="20" characterset="C0H300J0" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="24" characterset="C0H300N0" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="30" characterset="C0H300T0" base14-font="HelveticaOblique"/>
|
||||
<afp-raster-font size="36" characterset="C0H300Z0" base14-font="HelveticaOblique"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Helvetica" style="italic" weight="normal"/>
|
||||
<font-triplet name="Arial" style="italic" weight="normal"/>
|
||||
<font-triplet name="sans-serif" style="italic" weight="normal"/>
|
||||
</font>
|
||||
|
||||
<!-- Helvetica (Semi) Bold -->
|
||||
<font>
|
||||
<afp-font name="Helvetica (Semi) Bold" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0H40060" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="7" characterset="C0H40070" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="8" characterset="C0H40080" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="9" characterset="C0H40090" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="10" characterset="C0H40000" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="11" characterset="C0H400A0" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="12" characterset="C0H400B0" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="14" characterset="C0H400D0" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="16" characterset="C0H400F0" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="18" characterset="C0H400H0" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="20" characterset="C0H400J0" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="24" characterset="C0H400N0" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="30" characterset="C0H400T0" base14-font="HelveticaBold"/>
|
||||
<afp-raster-font size="36" characterset="C0H400Z0" base14-font="HelveticaBold"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Helvetica" style="normal" weight="bold"/>
|
||||
<font-triplet name="Arial" style="normal" weight="bold"/>
|
||||
<font-triplet name="sans-serif" style="normal" weight="bold"/>
|
||||
</font>
|
||||
|
||||
<!-- Helvetica Italic (Semi) Bold -->
|
||||
<font>
|
||||
<afp-font name="Helvetica Italic (Semi) Bold" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0H50060" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="7" characterset="C0H50070" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="8" characterset="C0H50080" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="9" characterset="C0H50090" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="10" characterset="C0H50000" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="11" characterset="C0H500A0" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="12" characterset="C0H500B0" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="14" characterset="C0H500D0" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="16" characterset="C0H500F0" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="18" characterset="C0H500H0" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="20" characterset="C0H500J0" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="24" characterset="C0H500N0" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="30" characterset="C0H500T0" base14-font="HelveticaBoldOblique"/>
|
||||
<afp-raster-font size="36" characterset="C0H500Z0" base14-font="HelveticaBoldOblique"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Helvetica" style="italic" weight="bold"/>
|
||||
<font-triplet name="Arial" style="italic" weight="bold"/>
|
||||
<font-triplet name="sans-serif" style="italic" weight="bold"/>
|
||||
</font>
|
||||
|
||||
<!-- Courier -->
|
||||
<font>
|
||||
<afp-font name="Courier" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0420060" base14-font="Courier"/>
|
||||
<afp-raster-font size="7" characterset="C0420070" base14-font="Courier"/>
|
||||
<afp-raster-font size="8" characterset="C0420080" base14-font="Courier"/>
|
||||
<afp-raster-font size="9" characterset="C0420090" base14-font="Courier"/>
|
||||
<afp-raster-font size="10" characterset="C0420000" base14-font="Courier"/>
|
||||
<afp-raster-font size="11" characterset="C04200A0" base14-font="Courier"/>
|
||||
<afp-raster-font size="12" characterset="C04200B0" base14-font="Courier"/>
|
||||
<afp-raster-font size="14" characterset="C04200D0" base14-font="Courier"/>
|
||||
<afp-raster-font size="16" characterset="C04200F0" base14-font="Courier"/>
|
||||
<afp-raster-font size="18" characterset="C04200H0" base14-font="Courier"/>
|
||||
<afp-raster-font size="20" characterset="C04200J0" base14-font="Courier"/>
|
||||
<afp-raster-font size="24" characterset="C04200N0" base14-font="Courier"/>
|
||||
<afp-raster-font size="30" characterset="C04200T0" base14-font="Courier"/>
|
||||
<afp-raster-font size="36" characterset="C04200Z0" base14-font="Courier"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Courier" style="normal" weight="normal"/>
|
||||
<font-triplet name="monospace" style="normal" weight="normal"/>
|
||||
</font>
|
||||
|
||||
<!-- Courier Italic -->
|
||||
<font>
|
||||
<afp-font name="Courier Italic" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0430060" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="7" characterset="C0430070" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="8" characterset="C0430080" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="9" characterset="C0430090" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="10" characterset="C0430000" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="11" characterset="C04300A0" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="12" characterset="C04300B0" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="14" characterset="C04300D0" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="16" characterset="C04300F0" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="18" characterset="C04300H0" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="20" characterset="C04300J0" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="24" characterset="C04300N0" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="30" characterset="C04300T0" base14-font="CourierOblique"/>
|
||||
<afp-raster-font size="36" characterset="C04300Z0" base14-font="CourierOblique"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Courier" style="italic" weight="normal"/>
|
||||
<font-triplet name="monospace" style="italic" weight="normal"/>
|
||||
</font>
|
||||
|
||||
<!-- Courier Bold -->
|
||||
<font>
|
||||
<afp-font name="Courier Bold" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0440060" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="7" characterset="C0440070" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="8" characterset="C0440080" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="9" characterset="C0440090" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="10" characterset="C0440000" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="11" characterset="C04400A0" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="12" characterset="C04400B0" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="14" characterset="C04400D0" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="16" characterset="C04400F0" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="18" characterset="C04400H0" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="20" characterset="C04400J0" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="24" characterset="C04400N0" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="30" characterset="C04400T0" base14-font="CourierBold"/>
|
||||
<afp-raster-font size="36" characterset="C04400Z0" base14-font="CourierBold"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Courier" style="normal" weight="bold"/>
|
||||
<font-triplet name="monospace" style="normal" weight="bold"/>
|
||||
</font>
|
||||
|
||||
<!-- Courier Italic Bold -->
|
||||
<font>
|
||||
<afp-font name="Courier Italic Bold" type="raster" codepage="T1V10500" encoding="Cp500">
|
||||
<afp-raster-font size="6" characterset="C0450060" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="7" characterset="C0450070" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="8" characterset="C0450080" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="9" characterset="C0450090" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="10" characterset="C0450000" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="11" characterset="C04500A0" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="12" characterset="C04500B0" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="14" characterset="C04500D0" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="16" characterset="C04500F0" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="18" characterset="C04500H0" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="20" characterset="C04500J0" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="24" characterset="C04500N0" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="30" characterset="C04500T0" base14-font="CourierBoldOblique"/>
|
||||
<afp-raster-font size="36" characterset="C04500Z0" base14-font="CourierBoldOblique"/>
|
||||
</afp-font>
|
||||
<font-triplet name="Courier" style="italic" weight="bold"/>
|
||||
<font-triplet name="monospace" style="italic" weight="bold"/>
|
||||
</font>
|
||||
|
||||
<!--
|
||||
Configure double-byte (CID Keyed font (Type 0)) AFP fonts with type="CIDKeyed".
|
||||
|
||||
example:
|
||||
<font>
|
||||
<afp-font type="CIDKeyed" encoding="UnicodeBigUnmarked"
|
||||
codepage="T1120000" characterset="CZJHMNU"
|
||||
base-uri="fonts" />
|
||||
<font-triplet name="J-Heisei Mincho" style="normal" weight="normal" />
|
||||
</font>
|
||||
-->
|
||||
|
||||
|
||||
</fonts>
|
||||
</renderer>
|
||||
|
||||
<renderer mime="application/postscript">
|
||||
<!-- This option forces the PS renderer to rotate landscape pages -->
|
||||
<!--auto-rotate-landscape>true</auto-rotate-landscape-->
|
||||
|
||||
<!-- This option lets you specify additional options on an XML handler -->
|
||||
<!--xml-handler namespace="http://www.w3.org/2000/svg">
|
||||
<stroke-text>false</stroke-text>
|
||||
</xml-handler-->
|
||||
</renderer>
|
||||
|
||||
<renderer mime="application/vnd.hp-PCL">
|
||||
</renderer>
|
||||
|
||||
<!-- MIF does not have a renderer
|
||||
<renderer mime="application/vnd.mif">
|
||||
</renderer>
|
||||
-->
|
||||
|
||||
<renderer mime="image/svg+xml">
|
||||
<format type="paginated"/>
|
||||
<link value="true"/>
|
||||
<strokeText value="false"/>
|
||||
</renderer>
|
||||
|
||||
<renderer mime="application/awt">
|
||||
</renderer>
|
||||
|
||||
<renderer mime="image/png">
|
||||
<!--transparent-page-background>true</transparent-page-background-->
|
||||
</renderer>
|
||||
|
||||
<renderer mime="image/tiff">
|
||||
<!--transparent-page-background>true</transparent-page-background-->
|
||||
<!--compression>CCITT T.6</compression-->
|
||||
</renderer>
|
||||
|
||||
<renderer mime="text/xml">
|
||||
</renderer>
|
||||
|
||||
<!-- RTF does not have a renderer
|
||||
<renderer mime="text/rtf">
|
||||
</renderer>
|
||||
-->
|
||||
|
||||
</renderers>
|
||||
|
||||
</fop>
|
||||
17
apache_fop/fop/examples/embedding/README
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
FOP Embedding Examples Readme
|
||||
|
||||
This directory contains several examples on using FOP in Java.
|
||||
|
||||
To compile the examples you can call "ant" from the directory where
|
||||
build.xml is found. (Apache Ant must be installed!)
|
||||
You can also directly run the individual examples with these scripts.
|
||||
Just call
|
||||
|
||||
ant -projecthelp
|
||||
|
||||
for a listing of all available examples.
|
||||
|
||||
|
||||
|
||||
Please go to the page indicated below to find more information:
|
||||
http://xmlgraphics.apache.org/fop/embedding.html
|
||||
158
apache_fop/fop/examples/embedding/build.xml
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
<?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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<project default="compile" basedir=".">
|
||||
<property name="Name" value="Apache FOP - Embedding Examples"/>
|
||||
<property name="name" value="embedding"/>
|
||||
<!-- compiler switches -->
|
||||
<property name="debug" value="on"/>
|
||||
<property name="optimize" value="off"/>
|
||||
<property name="deprecation" value="on"/>
|
||||
<!-- directories -->
|
||||
<property name="src.dir" value="./java"/>
|
||||
<property name="fop.lib.dir" value="../../lib"/>
|
||||
<property name="lib.dir" value="./lib"/>
|
||||
<property name="build.dir" value="./build"/>
|
||||
<property name="build.src" value="./build/src"/>
|
||||
<property name="build.dest" value="./build/classes"/>
|
||||
<!-- stuff -->
|
||||
<path id="project.class.path">
|
||||
<fileset dir="${fop.lib.dir}">
|
||||
<include name="batik*.jar"/>
|
||||
<include name="xml-apis*.jar"/>
|
||||
<include name="xerces*.jar"/>
|
||||
<include name="xalan*.jar"/>
|
||||
<include name="serializer*.jar"/>
|
||||
<include name="commons-io*.jar"/>
|
||||
<include name="commons-logging*.jar"/>
|
||||
<include name="xmlgraphics-commons*.jar"/>
|
||||
</fileset>
|
||||
<fileset dir="${fop.lib.dir}/../build">
|
||||
<include name="fop.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Initialization target -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="init">
|
||||
<tstamp/>
|
||||
<property name="year" value="2002-2004,2006"/>
|
||||
<echo message="------------------- ${Name} [${year}] ----------------"/>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Prepares the build directory -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="prepare" depends="init">
|
||||
<!-- create directories -->
|
||||
<echo message="Preparing the build directories"/>
|
||||
<mkdir dir="${build.dir}"/>
|
||||
<mkdir dir="${build.dest}"/>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Compiles the source directory -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="compile" depends="prepare" description="Compiles the examples">
|
||||
<echo message="Compiling the sources"/>
|
||||
<javac srcdir="${src.dir}" destdir="${build.dest}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}" includeAntRuntime="true">
|
||||
<classpath refid="project.class.path"/>
|
||||
</javac>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Runs the various examples -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="example1" depends="compile" description="Runs the FO to PDF example">
|
||||
<echo message="Running the FO to PDF example"/>
|
||||
<java classname="${name}.ExampleFO2PDF" fork="yes">
|
||||
<classpath>
|
||||
<path refid="project.class.path"/>
|
||||
<pathelement location="${build.dest}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
<target name="example2" depends="compile" description="Runs the FO to PDF example using a SAXParser">
|
||||
<echo message="Running the FO to PDF example using a SAXParser"/>
|
||||
<java classname="${name}.ExampleFO2PDFUsingSAXParser" fork="yes">
|
||||
<classpath>
|
||||
<path refid="project.class.path"/>
|
||||
<pathelement location="${build.dest}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
<target name="example3" depends="compile" description="Runs the XML to FO example">
|
||||
<echo message="Running the XML to FO example"/>
|
||||
<java classname="${name}.ExampleXML2FO" fork="yes">
|
||||
<classpath>
|
||||
<path refid="project.class.path"/>
|
||||
<pathelement location="${build.dest}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
<target name="example4" depends="compile" description="Runs the XML to PDF example">
|
||||
<echo message="Running the XML to PDF example"/>
|
||||
<java classname="${name}.ExampleXML2PDF" fork="yes">
|
||||
<classpath>
|
||||
<path refid="project.class.path"/>
|
||||
<pathelement location="${build.dest}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
<target name="example5" depends="compile" description="Runs the Object to XML example">
|
||||
<echo message="Running the Object to XML example"/>
|
||||
<java classname="${name}.ExampleObj2XML" fork="yes">
|
||||
<classpath>
|
||||
<path refid="project.class.path"/>
|
||||
<pathelement location="${build.dest}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
<target name="example6" depends="compile" description="Runs the Object to PDF example">
|
||||
<echo message="Running the Object to PDF example"/>
|
||||
<java classname="${name}.ExampleObj2PDF" fork="yes">
|
||||
<classpath>
|
||||
<path refid="project.class.path"/>
|
||||
<pathelement location="${build.dest}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
<target name="example7" depends="compile" description="Runs the DOM to PDF example">
|
||||
<echo message="Running the DOM to PDF example"/>
|
||||
<java classname="${name}.ExampleDOM2PDF" fork="yes">
|
||||
<classpath>
|
||||
<path refid="project.class.path"/>
|
||||
<pathelement location="${build.dest}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
<target name="example8" depends="compile" description="Runs the SVG to PDF example">
|
||||
<echo message="Running the SVG to PDF example"/>
|
||||
<java classname="${name}.ExampleSVG2PDF" fork="yes">
|
||||
<classpath>
|
||||
<path refid="project.class.path"/>
|
||||
<pathelement location="${build.dest}"/>
|
||||
</classpath>
|
||||
<jvmarg value="-Xmx1024m"/>
|
||||
</java>
|
||||
</target>
|
||||
<target name="run" depends="example1,example2,example3,example4,example5,example5,example7,example8" description="Runs examples"/>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Clean targets -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="clean" depends="init" description="Cleans the build directory">
|
||||
<delete dir="${build.dir}"/>
|
||||
</target>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
//Java
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
|
||||
/**
|
||||
* This class demonstrates the use of the AWT Viewer.
|
||||
*/
|
||||
public class ExampleAWTViewer {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Display an FO file in the AWT Preview.
|
||||
* @param fo the FO file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a problem during layout
|
||||
* @throws TransformerException In case of a problem during XML processing
|
||||
*/
|
||||
public void viewFO(File fo)
|
||||
throws IOException, FOPException, TransformerException {
|
||||
|
||||
//Setup FOP
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_AWT_PREVIEW);
|
||||
|
||||
try {
|
||||
|
||||
//Load XSL-FO file (you can also do an XSL transformation here)
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
Source src = new StreamSource(fo);
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
transformer.transform(src, res);
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e instanceof FOPException) {
|
||||
throw (FOPException)e;
|
||||
}
|
||||
throw new FOPException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args the command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleAWTViewer\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
|
||||
|
||||
System.out.println("Input: XSL-FO (" + fofile + ")");
|
||||
System.out.println("Output: AWT Viewer");
|
||||
System.out.println();
|
||||
System.out.println("Starting AWT Viewer...");
|
||||
|
||||
ExampleAWTViewer app = new ExampleAWTViewer();
|
||||
app.viewFO(fofile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
// System.err.println(ExceptionUtil.printStackTrace(e));
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
// Java
|
||||
import java.io.File;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of a DOM Document to PDF
|
||||
* using JAXP (XSLT) and FOP (XSL-FO).
|
||||
*/
|
||||
public class ExampleDOM2PDF {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/** xsl-fo namespace URI */
|
||||
protected static String foNS = "http://www.w3.org/1999/XSL/Format";
|
||||
|
||||
/**
|
||||
* Converts a DOM Document to a PDF file using FOP.
|
||||
* @param xslfoDoc the DOM Document
|
||||
* @param pdf the target PDF file
|
||||
*/
|
||||
public void convertDOM2PDF(Document xslfoDoc, File pdf) {
|
||||
try {
|
||||
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
|
||||
// configure foUserAgent as desired
|
||||
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(pdf);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
|
||||
try {
|
||||
// Construct fop with desired output format and output stream
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
|
||||
|
||||
// Setup Identity Transformer
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(); // identity transformer
|
||||
|
||||
// Setup input for XSLT transformation
|
||||
Source src = new DOMSource(xslfoDoc);
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleDOM2PDF\n");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup output file
|
||||
File pdffile = new File(outDir, "ResultDOM2PDF.pdf");
|
||||
System.out.println("PDF Output File: " + pdffile);
|
||||
System.out.println();
|
||||
|
||||
Document foDoc = buildDOMDocument();
|
||||
|
||||
ExampleDOM2PDF app = new ExampleDOM2PDF();
|
||||
app.convertDOM2PDF(foDoc, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the example FO document as a DOM in memory.
|
||||
* @return the FO document
|
||||
* @throws ParserConfigurationException In case there is a problem creating a DOM document
|
||||
*/
|
||||
private static Document buildDOMDocument() throws ParserConfigurationException {
|
||||
// Create a sample XSL-FO DOM document
|
||||
Document foDoc = null;
|
||||
Element root = null, ele1 = null, ele2 = null, ele3 = null;
|
||||
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
dbf.setNamespaceAware(true);
|
||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||
foDoc = db.newDocument();
|
||||
|
||||
root = foDoc.createElementNS(foNS, "fo:root");
|
||||
foDoc.appendChild(root);
|
||||
|
||||
ele1 = foDoc.createElementNS(foNS, "fo:layout-master-set");
|
||||
root.appendChild(ele1);
|
||||
ele2 = foDoc.createElementNS(foNS, "fo:simple-page-master");
|
||||
ele1.appendChild(ele2);
|
||||
ele2.setAttributeNS(null, "master-name", "letter");
|
||||
ele2.setAttributeNS(null, "page-height", "11in");
|
||||
ele2.setAttributeNS(null, "page-width", "8.5in");
|
||||
ele2.setAttributeNS(null, "margin-top", "1in");
|
||||
ele2.setAttributeNS(null, "margin-bottom", "1in");
|
||||
ele2.setAttributeNS(null, "margin-left", "1in");
|
||||
ele2.setAttributeNS(null, "margin-right", "1in");
|
||||
ele3 = foDoc.createElementNS(foNS, "fo:region-body");
|
||||
ele2.appendChild(ele3);
|
||||
ele1 = foDoc.createElementNS(foNS, "fo:page-sequence");
|
||||
root.appendChild(ele1);
|
||||
ele1.setAttributeNS(null, "master-reference", "letter");
|
||||
ele2 = foDoc.createElementNS(foNS, "fo:flow");
|
||||
ele1.appendChild(ele2);
|
||||
ele2.setAttributeNS(null, "flow-name", "xsl-region-body");
|
||||
addElement(ele2, "fo:block", "Hello World!");
|
||||
return foDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an element to the DOM.
|
||||
* @param parent parent node to attach the new element to
|
||||
* @param newNodeName name of the new node
|
||||
* @param textVal content of the element
|
||||
*/
|
||||
protected static void addElement(Node parent, String newNodeName,
|
||||
String textVal) {
|
||||
if (textVal == null) {
|
||||
return;
|
||||
} // use only with text nodes
|
||||
Element newElement = parent.getOwnerDocument().createElementNS(
|
||||
foNS, newNodeName);
|
||||
Text elementText = parent.getOwnerDocument().createTextNode(textVal);
|
||||
newElement.appendChild(elementText);
|
||||
parent.appendChild(newElement);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
|
||||
package embedding;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import org.apache.fop.configuration.Configuration;
|
||||
import org.apache.fop.configuration.DefaultConfigurationBuilder;
|
||||
import org.apache.xmlgraphics.java2d.GraphicContext;
|
||||
import org.apache.xmlgraphics.java2d.ps.EPSDocumentGraphics2D;
|
||||
|
||||
import org.apache.fop.fonts.FontInfo;
|
||||
import org.apache.fop.render.ps.NativeTextHandler;
|
||||
import org.apache.fop.svg.PDFDocumentGraphics2DConfigurator;
|
||||
|
||||
public class ExampleEPS {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
String configFile = "examples/fop-eps.xconf";
|
||||
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
|
||||
Configuration c = cfgBuilder.buildFromFile(new File(configFile));
|
||||
|
||||
FontInfo fontInfo = PDFDocumentGraphics2DConfigurator.createFontInfo(c, false);
|
||||
|
||||
OutputStream out = new FileOutputStream("example_eps.eps");
|
||||
EPSDocumentGraphics2D g2d = new EPSDocumentGraphics2D(false);
|
||||
g2d.setGraphicContext(new GraphicContext());
|
||||
g2d.setCustomTextHandler(new NativeTextHandler(g2d, fontInfo));
|
||||
g2d.setupDocument(out, 200, 100);
|
||||
g2d.setFont(new Font("Arial", Font.PLAIN, 12));
|
||||
g2d.drawString("Hi there Arial", 50, 50);
|
||||
g2d.finish();
|
||||
out.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import org.apache.xmlgraphics.java2d.GraphicContext;
|
||||
import org.apache.xmlgraphics.java2d.ps.EPSDocumentGraphics2D;
|
||||
|
||||
import org.apache.fop.render.ps.NativeTextHandler;
|
||||
|
||||
public class ExampleEPSSimple {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
OutputStream out = new FileOutputStream("example_eps_simple.eps");
|
||||
EPSDocumentGraphics2D g2d = new EPSDocumentGraphics2D(false);
|
||||
g2d.setGraphicContext(new GraphicContext());
|
||||
g2d.setCustomTextHandler(new NativeTextHandler(g2d, null));
|
||||
g2d.setupDocument(out, 200, 100);
|
||||
g2d.setFont(new Font("Helvetica", Font.PLAIN, 12));
|
||||
g2d.drawString("Hi there Helvetica", 50, 50);
|
||||
g2d.finish();
|
||||
out.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
// Java
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.print.Doc;
|
||||
import javax.print.DocFlavor;
|
||||
import javax.print.DocPrintJob;
|
||||
import javax.print.PrintException;
|
||||
import javax.print.PrintService;
|
||||
import javax.print.PrintServiceLookup;
|
||||
import javax.print.ServiceUI;
|
||||
import javax.print.SimpleDoc;
|
||||
import javax.print.attribute.HashPrintRequestAttributeSet;
|
||||
import javax.print.attribute.PrintRequestAttributeSet;
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.render.print.PageableRenderer;
|
||||
|
||||
/**
|
||||
* This class demonstrates printing an FO file using JPS (Java Printing System).
|
||||
*/
|
||||
public class ExampleFO2JPSPrint {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
private DocPrintJob createDocPrintJob() {
|
||||
PrintService[] services = PrintServiceLookup.lookupPrintServices(
|
||||
DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
|
||||
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
|
||||
PrintService printService = ServiceUI.printDialog(null, 50, 50,
|
||||
services, services[0], null, attributes);
|
||||
if (printService != null) {
|
||||
return printService.createPrintJob();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints an FO file using JPS.
|
||||
* @param fo the FO file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a FOP problem
|
||||
* @throws TransformerException In case of a problem during XSLT processing
|
||||
* @throws PrintException If an error occurs while printing
|
||||
*/
|
||||
public void printFO(File fo)
|
||||
throws IOException, FOPException, TransformerException, PrintException {
|
||||
|
||||
//Set up DocPrintJob instance
|
||||
DocPrintJob printJob = createDocPrintJob();
|
||||
|
||||
//Set up a custom user agent so we can supply our own renderer instance
|
||||
FOUserAgent userAgent = fopFactory.newFOUserAgent();
|
||||
|
||||
PageableRenderer renderer = new PageableRenderer(userAgent);
|
||||
userAgent.setRendererOverride(renderer);
|
||||
|
||||
// Construct FOP with desired output format
|
||||
Fop fop = fopFactory.newFop(userAgent);
|
||||
|
||||
// Setup JAXP using identity transformer
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(); // identity transformer
|
||||
|
||||
// Setup input stream
|
||||
Source src = new StreamSource(fo);
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
|
||||
Doc doc = new SimpleDoc(renderer, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
|
||||
printJob.print(doc, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleFO2JPSPrint\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
|
||||
|
||||
System.out.println("Input: XSL-FO (" + fofile + ")");
|
||||
System.out.println("Output: JPS (Java Printing System)");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleFO2JPSPrint app = new ExampleFO2JPSPrint();
|
||||
app.printFO(fofile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
// Java
|
||||
import java.awt.print.PrinterJob;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
|
||||
/**
|
||||
* This class demonstrates printing an FO file to a PrinterJob instance.
|
||||
*/
|
||||
public class ExampleFO2OldStylePrint {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Prints an FO file using an old-style PrinterJob.
|
||||
* @param fo the FO file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a FOP problem
|
||||
*/
|
||||
public void printFO(File fo) throws IOException, FOPException {
|
||||
|
||||
//Set up PrinterJob instance
|
||||
PrinterJob printerJob = PrinterJob.getPrinterJob();
|
||||
printerJob.setJobName("FOP Printing Example");
|
||||
|
||||
try {
|
||||
//Set up a custom user agent so we can supply our own renderer instance
|
||||
FOUserAgent userAgent = fopFactory.newFOUserAgent();
|
||||
userAgent.getRendererOptions().put("printerjob", printerJob);
|
||||
|
||||
// Construct FOP with desired output format
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, userAgent);
|
||||
|
||||
// Setup JAXP using identity transformer
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(); // identity transformer
|
||||
|
||||
// Setup input stream
|
||||
Source src = new StreamSource(fo);
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleFO2OldStylePrint\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
|
||||
|
||||
System.out.println("Input: XSL-FO (" + fofile + ")");
|
||||
System.out.println("Output: old-style printing using PrinterJob");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleFO2OldStylePrint app = new ExampleFO2OldStylePrint();
|
||||
app.printFO(fofile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
// Java
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.FormattingResults;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
import org.apache.fop.apps.PageSequenceResults;
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of an FO file to PDF using FOP.
|
||||
*/
|
||||
public class ExampleFO2PDF {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Converts an FO file to a PDF file using FOP
|
||||
* @param fo the FO file
|
||||
* @param pdf the target PDF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a FOP problem
|
||||
*/
|
||||
public void convertFO2PDF(File fo, File pdf) throws IOException, FOPException {
|
||||
|
||||
OutputStream out = null;
|
||||
|
||||
try {
|
||||
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
|
||||
// configure foUserAgent as desired
|
||||
|
||||
// Setup output stream. Note: Using BufferedOutputStream
|
||||
// for performance reasons (helpful with FileOutputStreams).
|
||||
out = new FileOutputStream(pdf);
|
||||
out = new BufferedOutputStream(out);
|
||||
|
||||
// Construct fop with desired output format
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
|
||||
|
||||
// Setup JAXP using identity transformer
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(); // identity transformer
|
||||
|
||||
// Setup input stream
|
||||
Source src = new StreamSource(fo);
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
|
||||
// Result processing
|
||||
FormattingResults foResults = fop.getResults();
|
||||
java.util.List pageSequences = foResults.getPageSequences();
|
||||
for (Object pageSequence : pageSequences) {
|
||||
PageSequenceResults pageSequenceResults = (PageSequenceResults) pageSequence;
|
||||
System.out.println("PageSequence "
|
||||
+ (String.valueOf(pageSequenceResults.getID()).length() > 0
|
||||
? pageSequenceResults.getID() : "<no id>")
|
||||
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
|
||||
}
|
||||
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleFO2PDF\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
|
||||
//File fofile = new File(baseDir, "../fo/pagination/franklin_2pageseqs.fo");
|
||||
File pdffile = new File(outDir, "ResultFO2PDF.pdf");
|
||||
|
||||
System.out.println("Input: XSL-FO (" + fofile + ")");
|
||||
System.out.println("Output: PDF (" + pdffile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleFO2PDF app = new ExampleFO2PDF();
|
||||
app.convertFO2PDF(fofile, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
// Java
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.parsers.FactoryConfigurationError;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of an FO file to PDF using FOP.
|
||||
* It uses a SAXParser with FOP as the DefaultHandler
|
||||
*/
|
||||
public class ExampleFO2PDFUsingSAXParser {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Converts an FO file to a PDF file using FOP
|
||||
* @param fo the FO file
|
||||
* @param pdf the target PDF file
|
||||
* @throws FactoryConfigurationError In case of a problem with the JAXP factory configuration
|
||||
* @throws ParserConfigurationException In case of a problem with the parser configuration
|
||||
* @throws SAXException In case of a problem during XML processing
|
||||
* @throws IOException In case of an I/O problem
|
||||
*/
|
||||
public void convertFO2PDF(File fo, File pdf)
|
||||
throws FactoryConfigurationError,
|
||||
ParserConfigurationException,
|
||||
SAXException, IOException {
|
||||
|
||||
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
|
||||
// configure foUserAgent as desired
|
||||
|
||||
OutputStream out = null;
|
||||
|
||||
try {
|
||||
// Setup output stream. Note: Using BufferedOutputStream
|
||||
// for performance reasons (helpful with FileOutputStreams).
|
||||
out = new FileOutputStream(pdf);
|
||||
out = new BufferedOutputStream(out);
|
||||
|
||||
// Construct fop and setup output format
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
|
||||
|
||||
// Setup SAX parser
|
||||
// throws FactoryConfigurationError
|
||||
SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||
factory.setNamespaceAware(true);
|
||||
// throws ParserConfigurationException
|
||||
SAXParser parser = factory.newSAXParser();
|
||||
|
||||
// Obtain FOP's DefaultHandler
|
||||
// throws FOPException
|
||||
DefaultHandler dh = fop.getDefaultHandler();
|
||||
|
||||
// Start parsing and FOP processing
|
||||
// throws SAXException, IOException
|
||||
parser.parse(fo, dh);
|
||||
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleFO2PDFUsingSAXParser\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
|
||||
File pdffile = new File(outDir, "ResultFO2PDFUsingSAXParser.pdf");
|
||||
|
||||
System.out.println("Input: XSL-FO (" + fofile + ")");
|
||||
System.out.println("Output: PDF (" + pdffile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleFO2PDFUsingSAXParser app = new ExampleFO2PDFUsingSAXParser();
|
||||
app.convertFO2PDF(fofile, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
// Java
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of an FO file to RTF using FOP.
|
||||
* <p>
|
||||
* Please note that this is practically the same as the ExampleFO2PDF example. Only
|
||||
* the MIME parameter to the newFop() method is different!
|
||||
*/
|
||||
public class ExampleFO2RTF {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Converts an FO file to a RTF file using FOP
|
||||
* @param fo the FO file
|
||||
* @param rtf the target RTF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a FOP problem
|
||||
*/
|
||||
public void convertFO2RTF(File fo, File rtf) throws IOException, FOPException {
|
||||
|
||||
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
|
||||
// configure foUserAgent as desired
|
||||
|
||||
OutputStream out = null;
|
||||
|
||||
try {
|
||||
// Setup output stream. Note: Using BufferedOutputStream
|
||||
// for performance reasons (helpful with FileOutputStreams).
|
||||
out = new FileOutputStream(rtf);
|
||||
out = new BufferedOutputStream(out);
|
||||
|
||||
// Construct fop with desired output format
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_RTF, foUserAgent, out);
|
||||
|
||||
// Setup JAXP using identity transformer
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(); // identity transformer
|
||||
|
||||
// Setup input stream
|
||||
Source src = new StreamSource(fo);
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
|
||||
// Please note: getResults() won't work for RTF and other flow formats (like MIF)
|
||||
// as the layout engine is not involved in the conversion. The page-breaking
|
||||
// is done by the application opening the generated file (like MS Word).
|
||||
//FormattingResults foResults = fop.getResults();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleFO2RTF\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
|
||||
File rtffile = new File(outDir, "ResultFO2RTF.rtf");
|
||||
|
||||
System.out.println("Input: XSL-FO (" + fofile + ")");
|
||||
System.out.println("Output: PDF (" + rtffile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleFO2RTF app = new ExampleFO2RTF();
|
||||
app.convertFO2RTF(fofile, rtffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics2D;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.StringReader;
|
||||
|
||||
import javax.swing.JEditorPane;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import org.apache.xmlgraphics.util.UnitConv;
|
||||
|
||||
import org.apache.fop.configuration.Configuration;
|
||||
import org.apache.fop.configuration.ConfigurationException;
|
||||
import org.apache.fop.configuration.DefaultConfiguration;
|
||||
import org.apache.fop.svg.PDFDocumentGraphics2D;
|
||||
import org.apache.fop.svg.PDFDocumentGraphics2DConfigurator;
|
||||
|
||||
/**
|
||||
* This example class demonstrates the use of {@link PDFDocumentGraphics2D} that can be
|
||||
* used to create a PDF file from Java2D graphics (using the {@link Graphics2D} API).
|
||||
*/
|
||||
public class ExampleJava2D2PDF {
|
||||
|
||||
private Configuration createAutoFontsConfiguration() {
|
||||
//Create a default configuration using auto-detection of fonts.
|
||||
//This can be a bit slow but covers most use cases.
|
||||
DefaultConfiguration c = new DefaultConfiguration("cfg");
|
||||
DefaultConfiguration fonts = new DefaultConfiguration("fonts");
|
||||
c.addChild(fonts);
|
||||
DefaultConfiguration autodetect = new DefaultConfiguration("auto-detect");
|
||||
fonts.addChild(autodetect);
|
||||
return c;
|
||||
|
||||
/* You can also load the configuration from a file:
|
||||
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
|
||||
return cfgBuilder.buildFromFile(configFile);
|
||||
*/
|
||||
}
|
||||
|
||||
private void configure(PDFDocumentGraphics2D g2d, Configuration cfg)
|
||||
throws ConfigurationException {
|
||||
|
||||
PDFDocumentGraphics2DConfigurator configurator = new PDFDocumentGraphics2DConfigurator();
|
||||
boolean useComplexScriptFeatures = false;
|
||||
configurator.configure(g2d, cfg, useComplexScriptFeatures);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a PDF file. The contents are painted using a Graphics2D implementation that
|
||||
* generates an PDF file.
|
||||
* @param outputFile the target file
|
||||
* @throws IOException In case of an I/O error
|
||||
* @throws ConfigurationException if an error occurs configuring the PDF output
|
||||
*/
|
||||
public void generatePDF(File outputFile) throws IOException, ConfigurationException {
|
||||
OutputStream out = new java.io.FileOutputStream(outputFile);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
|
||||
//Instantiate the PDFDocumentGraphics2D instance
|
||||
PDFDocumentGraphics2D g2d = new PDFDocumentGraphics2D(false);
|
||||
g2d.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
|
||||
|
||||
//Configure the G2D with the necessary fonts
|
||||
configure(g2d, createAutoFontsConfiguration());
|
||||
|
||||
//Set up the document size
|
||||
Dimension pageSize = new Dimension(
|
||||
(int)Math.ceil(UnitConv.mm2pt(210)),
|
||||
(int)Math.ceil(UnitConv.mm2pt(297))); //page size A4 (in pt)
|
||||
g2d.setupDocument(out, pageSize.width, pageSize.height);
|
||||
g2d.translate(144, 72); //Establish some page borders
|
||||
|
||||
//A few rectangles rotated and with different color
|
||||
Graphics2D copy = (Graphics2D)g2d.create();
|
||||
int c = 12;
|
||||
for (int i = 0; i < c; i++) {
|
||||
float f = ((i + 1) / (float)c);
|
||||
Color col = new Color(0.0f, 1 - f, 0.0f);
|
||||
copy.setColor(col);
|
||||
copy.fillRect(70, 90, 50, 50);
|
||||
copy.rotate(-2 * Math.PI / c, 70, 90);
|
||||
}
|
||||
copy.dispose();
|
||||
|
||||
//Some text
|
||||
g2d.rotate(-0.25);
|
||||
g2d.setColor(Color.RED);
|
||||
g2d.setFont(new Font("sans-serif", Font.PLAIN, 36));
|
||||
g2d.drawString("Hello world!", 140, 140);
|
||||
g2d.setColor(Color.RED.darker());
|
||||
g2d.setFont(new Font("serif", Font.PLAIN, 36));
|
||||
g2d.drawString("Hello world!", 140, 180);
|
||||
|
||||
pageSize = new Dimension(pageSize.height, pageSize.width);
|
||||
g2d.nextPage(pageSize.width, pageSize.height);
|
||||
|
||||
//Demonstrate painting rich text
|
||||
String someHTML = "<html><body style=\"font-family:Verdana\">"
|
||||
+ "<p>Welcome to <b>page 2!</b></p>"
|
||||
+ "<h2>PDFDocumentGraphics2D Demonstration</h2>"
|
||||
+ "<p>We can <i>easily</i> paint some HTML here!</p>"
|
||||
+ "<p style=\"color:green;\">"
|
||||
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin accumsan"
|
||||
+ " condimentum ullamcorper. Sed varius quam id arcu fermentum luctus. Praesent"
|
||||
+ " nisi ligula, cursus sed vestibulum vel, sodales sed lectus.</p>"
|
||||
+ "</body></html>";
|
||||
JEditorPane htmlComp = new JEditorPane();
|
||||
htmlComp.setContentType("text/html");
|
||||
htmlComp.read(new StringReader(someHTML), null);
|
||||
htmlComp.setSize(new Dimension(pageSize.width - 72, pageSize.height - 72));
|
||||
//htmlComp.setBackground(Color.ORANGE);
|
||||
htmlComp.validate();
|
||||
htmlComp.printAll(g2d);
|
||||
|
||||
//Cleanup
|
||||
g2d.finish();
|
||||
} finally {
|
||||
IOUtils.closeQuietly(out);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP " + ExampleJava2D2PDF.class.getSimpleName() + "\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
if (!outDir.isDirectory()) {
|
||||
if (!outDir.mkdirs()) {
|
||||
throw new IOException("Could not create output directory: " + outDir);
|
||||
}
|
||||
}
|
||||
|
||||
//Setup output file
|
||||
File pdffile = new File(outDir, "ResultJava2D2PDF.pdf");
|
||||
|
||||
System.out.println("Output: PDF (" + pdffile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Generating...");
|
||||
|
||||
ExampleJava2D2PDF app = new ExampleJava2D2PDF();
|
||||
app.generatePDF(pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
// Java
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
|
||||
import embedding.model.ProjectTeam;
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of an arbitrary object file to a
|
||||
* PDF using JAXP (XSLT) and FOP (XSL:FO).
|
||||
*/
|
||||
public class ExampleObj2PDF {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Converts a ProjectTeam object to a PDF file.
|
||||
* @param team the ProjectTeam object
|
||||
* @param xslt the stylesheet file
|
||||
* @param pdf the target PDF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a FOP problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
*/
|
||||
public void convertProjectTeam2PDF(ProjectTeam team, File xslt, File pdf)
|
||||
throws IOException, FOPException, TransformerException {
|
||||
|
||||
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
|
||||
// configure foUserAgent as desired
|
||||
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(pdf);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
// Construct fop with desired output format
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
|
||||
|
||||
// Setup XSLT
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(new StreamSource(xslt));
|
||||
|
||||
// Setup input for XSLT transformation
|
||||
Source src = team.getSourceForProjectTeam();
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleObj2PDF\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
// Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
// Setup input and output
|
||||
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
|
||||
File pdffile = new File(outDir, "ResultObj2PDF.pdf");
|
||||
|
||||
System.out.println("Input: a ProjectTeam object");
|
||||
System.out.println("Stylesheet: " + xsltfile);
|
||||
System.out.println("Output: PDF (" + pdffile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleObj2PDF app = new ExampleObj2PDF();
|
||||
app.convertProjectTeam2PDF(ExampleObj2XML.createSampleProjectTeam(), xsltfile, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
//Hava
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
//JAXP
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import embedding.model.ProjectMember;
|
||||
import embedding.model.ProjectTeam;
|
||||
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of an arbitrary object file to an
|
||||
* XML file.
|
||||
*/
|
||||
public class ExampleObj2XML {
|
||||
|
||||
/**
|
||||
* Converts a ProjectTeam object to XML.
|
||||
* @param team the ProjectTeam object
|
||||
* @param xml the target XML file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
*/
|
||||
public void convertProjectTeam2XML(ProjectTeam team, File xml)
|
||||
throws IOException, TransformerException {
|
||||
|
||||
//Setup XSLT
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
/* Note:
|
||||
We use the identity transformer, no XSL transformation is done.
|
||||
The transformer is basically just used to serialize the
|
||||
generated document to XML. */
|
||||
|
||||
//Setup input
|
||||
Source src = team.getSourceForProjectTeam();
|
||||
|
||||
//Setup output
|
||||
Result res = new StreamResult(xml);
|
||||
|
||||
//Start XSLT transformation
|
||||
transformer.transform(src, res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a sample ProjectTeam instance for this demo.
|
||||
* @return ProjectTeam the newly created ProjectTeam instance
|
||||
*/
|
||||
public static ProjectTeam createSampleProjectTeam() {
|
||||
ProjectTeam team = new ProjectTeam();
|
||||
team.setProjectName("Rule the Galaxy");
|
||||
team.addMember(new ProjectMember(
|
||||
"Emperor Palpatine", "lead", "palpatine@empire.gxy"));
|
||||
team.addMember(new ProjectMember(
|
||||
"Lord Darth Vader", "Jedi-Killer", "vader@empire.gxy"));
|
||||
team.addMember(new ProjectMember(
|
||||
"Grand Moff Tarkin", "Planet-Killer", "tarkin@empire.gxy"));
|
||||
team.addMember(new ProjectMember(
|
||||
"Admiral Motti", "Death Star operations", "motti@empire.gxy"));
|
||||
return team;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleObj2XML\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output
|
||||
File xmlfile = new File(outDir, "ResultObj2XML.xml");
|
||||
|
||||
System.out.println("Input: a ProjectTeam object");
|
||||
System.out.println("Output: XML (" + xmlfile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Serializing...");
|
||||
|
||||
ExampleObj2XML app = new ExampleObj2XML();
|
||||
app.convertProjectTeam2XML(createSampleProjectTeam(), xmlfile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
//Java
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
//Batik
|
||||
import org.apache.batik.transcoder.Transcoder;
|
||||
import org.apache.batik.transcoder.TranscoderException;
|
||||
import org.apache.batik.transcoder.TranscoderInput;
|
||||
import org.apache.batik.transcoder.TranscoderOutput;
|
||||
|
||||
//FOP
|
||||
import org.apache.fop.svg.PDFTranscoder;
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of an SVG file to PDF using FOP.
|
||||
*/
|
||||
public class ExampleSVG2PDF {
|
||||
|
||||
/**
|
||||
* Converts an FO file to a PDF file using FOP
|
||||
* @param svg the SVG file
|
||||
* @param pdf the target PDF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws TranscoderException In case of a transcoding problem
|
||||
*/
|
||||
public void convertSVG2PDF(File svg, File pdf) throws IOException, TranscoderException {
|
||||
|
||||
//Create transcoder
|
||||
Transcoder transcoder = new PDFTranscoder();
|
||||
//Transcoder transcoder = new org.apache.fop.render.ps.PSTranscoder();
|
||||
|
||||
//Setup input
|
||||
InputStream in = new java.io.FileInputStream(svg);
|
||||
try {
|
||||
TranscoderInput input = new TranscoderInput(in);
|
||||
|
||||
//Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(pdf);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
TranscoderOutput output = new TranscoderOutput(out);
|
||||
|
||||
//Do the transformation
|
||||
transcoder.transcode(input, output);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleSVG2PDF\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
File svgfile = new File(baseDir, "xml/svg/helloworld.svg");
|
||||
File pdffile = new File(outDir, "ResultSVG2PDF.pdf");
|
||||
|
||||
System.out.println("Input: SVG (" + svgfile + ")");
|
||||
System.out.println("Output: PDF (" + pdffile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleSVG2PDF app = new ExampleSVG2PDF();
|
||||
app.convertSVG2PDF(svgfile, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
//Java
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
//JAXP
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of an XML file to an XSL-FO file
|
||||
* using JAXP (XSLT).
|
||||
*/
|
||||
public class ExampleXML2FO {
|
||||
|
||||
/**
|
||||
* Converts an XML file to an XSL-FO file using JAXP (XSLT).
|
||||
* @param xml the XML file
|
||||
* @param xslt the stylesheet file
|
||||
* @param fo the target XSL-FO file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
*/
|
||||
public void convertXML2FO(File xml, File xslt, File fo)
|
||||
throws IOException, TransformerException {
|
||||
|
||||
//Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(fo);
|
||||
try {
|
||||
//Setup XSLT
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(new StreamSource(xslt));
|
||||
|
||||
//Setup input for XSLT transformation
|
||||
Source src = new StreamSource(xml);
|
||||
|
||||
//Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new StreamResult(out);
|
||||
|
||||
//Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleXML2FO\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
File xmlfile = new File(baseDir, "xml/xml/projectteam.xml");
|
||||
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
|
||||
File fofile = new File(outDir, "ResultXML2FO.fo");
|
||||
|
||||
System.out.println("Input: XML (" + xmlfile + ")");
|
||||
System.out.println("Stylesheet: " + xsltfile);
|
||||
System.out.println("Output: XSL-FO (" + fofile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleXML2FO app = new ExampleXML2FO();
|
||||
app.convertXML2FO(xmlfile, xsltfile, fofile);
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
//Java
|
||||
import java.io.File;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of an XML file to PDF using
|
||||
* JAXP (XSLT) and FOP (XSL-FO).
|
||||
*/
|
||||
public class ExampleXML2PDF {
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleXML2PDF\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
// Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
// Setup input and output files
|
||||
File xmlfile = new File(baseDir, "xml/xml/projectteam.xml");
|
||||
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
|
||||
File pdffile = new File(outDir, "ResultXML2PDF.pdf");
|
||||
|
||||
System.out.println("Input: XML (" + xmlfile + ")");
|
||||
System.out.println("Stylesheet: " + xsltfile);
|
||||
System.out.println("Output: PDF (" + pdffile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
// configure fopFactory as desired
|
||||
final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
|
||||
// configure foUserAgent as desired
|
||||
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(pdffile);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
|
||||
try {
|
||||
// Construct fop with desired output format
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
|
||||
|
||||
// Setup XSLT
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(new StreamSource(xsltfile));
|
||||
|
||||
// Set the value of a <param> in the stylesheet
|
||||
transformer.setParameter("versionParam", "2.0");
|
||||
|
||||
// Setup input for XSLT transformation
|
||||
Source src = new StreamSource(xmlfile);
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding;
|
||||
|
||||
// Java
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.FormattingResults;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
import org.apache.fop.apps.PageSequenceResults;
|
||||
|
||||
/**
|
||||
* This class demonstrates the conversion of multiple FO files to PDF using FOP.
|
||||
* The FopFactory is reused. Its configuration is applied to each rendering run.
|
||||
* The FOUserAgent and Fop are newly created by the FopFactory for each run.
|
||||
* The FOUserAgent can be configured differently for each run.
|
||||
*/
|
||||
public class MultipleFO2PDF {
|
||||
|
||||
// configure fopFactory as desired
|
||||
// JAXP TransformerFactory can be reused, too
|
||||
private TransformerFactory factory = TransformerFactory.newInstance();
|
||||
|
||||
/**
|
||||
* Converts an FO file to a PDF file using FOP
|
||||
* @param fo the FO file
|
||||
* @param pdf the target PDF file
|
||||
* @throws TransformerException in case of a transformation problem
|
||||
* @throws IOException in case of an I/O problem
|
||||
* @throws FOPException in case of a FOP problem
|
||||
* @return the formatting results of the run
|
||||
*/
|
||||
public FormattingResults convertFO2PDF(File fo, File pdf)
|
||||
throws TransformerException, IOException, FOPException {
|
||||
FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
OutputStream out = null;
|
||||
Fop fop;
|
||||
|
||||
try {
|
||||
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
|
||||
// configure foUserAgent as desired
|
||||
|
||||
// Setup output stream. Note: Using BufferedOutputStream
|
||||
// for performance reasons (helpful with FileOutputStreams).
|
||||
out = new FileOutputStream(pdf);
|
||||
out = new BufferedOutputStream(out);
|
||||
|
||||
// Construct fop with desired output format and output stream
|
||||
fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
|
||||
|
||||
// Setup JAXP using identity transformer
|
||||
Transformer transformer = factory.newTransformer(); // identity transformer
|
||||
|
||||
// Setup input stream
|
||||
Source src = new StreamSource(fo);
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(out);
|
||||
}
|
||||
|
||||
return fop.getResults();
|
||||
}
|
||||
|
||||
/**
|
||||
* Listens on standard in for names of fo files to be transformed to pdf.
|
||||
* 'quit' or the null string (for piped input) cause the listener to stop listening.
|
||||
*/
|
||||
public void listen() {
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
BufferedReader in = new BufferedReader(new java.io.InputStreamReader(System.in));
|
||||
|
||||
while (true) {
|
||||
try {
|
||||
// Listen for the input file name
|
||||
System.out.print("Input XSL-FO file ('quit' to stop): ");
|
||||
String foname = in.readLine();
|
||||
if (foname == null) {
|
||||
System.out.println("Null input, quitting");
|
||||
return;
|
||||
}
|
||||
foname.trim();
|
||||
if (foname.equals("quit")) {
|
||||
System.out.println("Quitting");
|
||||
return;
|
||||
}
|
||||
File fofile = new File(baseDir, foname);
|
||||
String pdfname = foname;
|
||||
int p = foname.lastIndexOf('.');
|
||||
pdfname = foname.substring(0, p) + ".pdf";
|
||||
File pdffile = new File(outDir, pdfname);
|
||||
|
||||
// transform and render
|
||||
System.out.print("Transforming " + fofile + " to PDF file " + pdffile + "...");
|
||||
FormattingResults foResults = convertFO2PDF(fofile, pdffile);
|
||||
System.out.println("done!");
|
||||
|
||||
// Result processing
|
||||
java.util.List pageSequences = foResults.getPageSequences();
|
||||
for (Object pageSequence : pageSequences) {
|
||||
PageSequenceResults pageSequenceResults = (PageSequenceResults) pageSequence;
|
||||
System.out.println("PageSequence "
|
||||
+ (String.valueOf(pageSequenceResults.getID()).length() > 0
|
||||
? pageSequenceResults.getID() : "<no id>")
|
||||
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
|
||||
}
|
||||
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("failure!");
|
||||
e.printStackTrace(System.out);
|
||||
} finally {
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method. Set up the listener.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
System.out.println("FOP MultipleFO2PDF\n");
|
||||
System.out.println("Preparing...");
|
||||
MultipleFO2PDF m = new MultipleFO2PDF();
|
||||
m.listen();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.atxml;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
import org.apache.fop.area.AreaTreeModel;
|
||||
import org.apache.fop.area.AreaTreeParser;
|
||||
import org.apache.fop.area.RenderPagesModel;
|
||||
import org.apache.fop.fonts.FontInfo;
|
||||
import org.apache.fop.render.Renderer;
|
||||
import org.apache.fop.render.xml.XMLRenderer;
|
||||
|
||||
import embedding.ExampleObj2XML;
|
||||
import embedding.model.ProjectMember;
|
||||
import embedding.model.ProjectTeam;
|
||||
|
||||
/**
|
||||
* Example for the area tree XML format that demonstrates the concatenation of two documents
|
||||
* rendered to the area tree XML format. A single PDF file is generated from the two area tree
|
||||
* files.
|
||||
*/
|
||||
public class ExampleConcat {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Creates a sample ProjectTeam instance for this demo.
|
||||
* @return ProjectTeam the newly created ProjectTeam instance
|
||||
*/
|
||||
public static ProjectTeam createAnotherProjectTeam() {
|
||||
ProjectTeam team = new ProjectTeam();
|
||||
team.setProjectName("The Dynamic Duo");
|
||||
team.addMember(new ProjectMember(
|
||||
"Batman", "lead", "batman@heroes.org"));
|
||||
team.addMember(new ProjectMember(
|
||||
"Robin", "aid", "robin@heroes.org"));
|
||||
return team;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an XSL-FO document to an area tree XML file.
|
||||
* @param src the source file
|
||||
* @param xslt the stylesheet file
|
||||
* @param areaTreeFile the target area tree XML file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a FOP problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
*/
|
||||
public void convertToAreaTreeXML(Source src, Source xslt, File areaTreeFile)
|
||||
throws IOException, FOPException, TransformerException {
|
||||
|
||||
//Create a user agent
|
||||
FOUserAgent userAgent = fopFactory.newFOUserAgent();
|
||||
|
||||
//Create an instance of the target renderer so the XMLRenderer can use its font setup
|
||||
Renderer targetRenderer = userAgent.getRendererFactory().createRenderer(
|
||||
userAgent, MimeConstants.MIME_PDF);
|
||||
|
||||
//Create the XMLRenderer to create the area tree XML
|
||||
XMLRenderer xmlRenderer = new XMLRenderer(userAgent);
|
||||
|
||||
//Tell the XMLRenderer to mimic the target renderer
|
||||
xmlRenderer.mimicRenderer(targetRenderer);
|
||||
|
||||
//Make sure the prepared XMLRenderer is used
|
||||
userAgent.setRendererOverride(xmlRenderer);
|
||||
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(areaTreeFile);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
// Construct fop (the MIME type here is unimportant due to the override
|
||||
// on the user agent)
|
||||
Fop fop = fopFactory.newFop(null, userAgent, out);
|
||||
|
||||
// Setup XSLT
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer;
|
||||
if (xslt != null) {
|
||||
transformer = factory.newTransformer(xslt);
|
||||
} else {
|
||||
transformer = factory.newTransformer();
|
||||
}
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Concatenates an array of area tree XML files to a single PDF file.
|
||||
* @param files the array of area tree XML files
|
||||
* @param pdffile the target PDF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
* @throws SAXException In case of an XML-related problem
|
||||
*/
|
||||
public void concatToPDF(File[] files, File pdffile)
|
||||
throws IOException, TransformerException, SAXException {
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(pdffile);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
//Setup fonts and user agent
|
||||
FontInfo fontInfo = new FontInfo();
|
||||
FOUserAgent userAgent = fopFactory.newFOUserAgent();
|
||||
|
||||
//Construct the AreaTreeModel that will received the individual pages
|
||||
AreaTreeModel treeModel = new RenderPagesModel(userAgent,
|
||||
MimeConstants.MIME_PDF, fontInfo, out);
|
||||
|
||||
//Iterate over all area tree files
|
||||
AreaTreeParser parser = new AreaTreeParser();
|
||||
for (File file : files) {
|
||||
Source src = new StreamSource(file);
|
||||
parser.parse(src, treeModel, userAgent);
|
||||
}
|
||||
|
||||
//Signal the end of the processing. The renderer can finalize the target document.
|
||||
treeModel.endDocument();
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleConcat\n");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup output file
|
||||
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
|
||||
File[] files = new File[] {
|
||||
new File(outDir, "team1.at.xml"),
|
||||
new File(outDir, "team2.at.xml")};
|
||||
File pdffile = new File(outDir, "ResultConcat.pdf");
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
System.out.println("Area Tree XML file " + (i + 1) + ": "
|
||||
+ files[i].getCanonicalPath());
|
||||
}
|
||||
System.out.println("PDF Output File: " + pdffile.getCanonicalPath());
|
||||
System.out.println();
|
||||
|
||||
|
||||
ProjectTeam team1 = ExampleObj2XML.createSampleProjectTeam();
|
||||
ProjectTeam team2 = createAnotherProjectTeam();
|
||||
|
||||
ExampleConcat app = new ExampleConcat();
|
||||
|
||||
//Create area tree XML files
|
||||
app.convertToAreaTreeXML(
|
||||
team1.getSourceForProjectTeam(),
|
||||
new StreamSource(xsltfile), files[0]);
|
||||
app.convertToAreaTreeXML(
|
||||
team2.getSourceForProjectTeam(),
|
||||
new StreamSource(xsltfile), files[1]);
|
||||
|
||||
//Concatenate the individual area tree files to one document
|
||||
app.concatToPDF(files, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.atxml;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
import org.apache.fop.area.AreaTreeModel;
|
||||
import org.apache.fop.area.AreaTreeParser;
|
||||
import org.apache.fop.area.RenderPagesModel;
|
||||
import org.apache.fop.fonts.FontInfo;
|
||||
|
||||
import embedding.ExampleObj2XML;
|
||||
import embedding.model.ProjectTeam;
|
||||
|
||||
/**
|
||||
* Example for the area tree XML format that demonstrates the stamping of a document with some
|
||||
* kind of watermark. The resulting document is then rendered to a PDF file.
|
||||
*/
|
||||
public class ExampleStamp {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Stamps an area tree XML file and renders it to a PDF file.
|
||||
* @param atfile the area tree XML file
|
||||
* @param stampSheet the stylesheet that does the stamping
|
||||
* @param pdffile the target PDF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
* @throws SAXException In case of an XML-related problem
|
||||
*/
|
||||
public void stampToPDF(File atfile, File stampSheet, File pdffile)
|
||||
throws IOException, TransformerException, SAXException {
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(pdffile);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
//Setup fonts and user agent
|
||||
FontInfo fontInfo = new FontInfo();
|
||||
FOUserAgent userAgent = fopFactory.newFOUserAgent();
|
||||
|
||||
//Construct the AreaTreeModel that will received the individual pages
|
||||
AreaTreeModel treeModel = new RenderPagesModel(userAgent,
|
||||
MimeConstants.MIME_PDF, fontInfo, out);
|
||||
|
||||
//Iterate over all area tree files
|
||||
AreaTreeParser parser = new AreaTreeParser();
|
||||
Source src = new StreamSource(atfile);
|
||||
Source xslt = new StreamSource(stampSheet);
|
||||
|
||||
//Setup Transformer for XSLT processing
|
||||
TransformerFactory tFactory = TransformerFactory.newInstance();
|
||||
Transformer transformer = tFactory.newTransformer(xslt);
|
||||
|
||||
//Send XSLT result to AreaTreeParser
|
||||
SAXResult res = new SAXResult(parser.getContentHandler(treeModel, userAgent));
|
||||
|
||||
//Start XSLT transformation and area tree parsing
|
||||
transformer.transform(src, res);
|
||||
|
||||
//Signal the end of the processing. The renderer can finalize the target document.
|
||||
treeModel.endDocument();
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleConcat\n");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup output file
|
||||
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
|
||||
File atfile = new File(outDir, "team.at.xml");
|
||||
File stampxsltfile = new File(baseDir, "xml/xslt/atstamp.xsl");
|
||||
File pdffile = new File(outDir, "ResultStamped.pdf");
|
||||
System.out.println("Area Tree XML file : " + atfile.getCanonicalPath());
|
||||
System.out.println("Stamp XSLT: " + stampxsltfile.getCanonicalPath());
|
||||
System.out.println("PDF Output File: " + pdffile.getCanonicalPath());
|
||||
System.out.println();
|
||||
|
||||
ProjectTeam team1 = ExampleObj2XML.createSampleProjectTeam();
|
||||
|
||||
//Create area tree XML file
|
||||
ExampleConcat concatapp = new ExampleConcat();
|
||||
concatapp.convertToAreaTreeXML(
|
||||
team1.getSourceForProjectTeam(),
|
||||
new StreamSource(xsltfile), atfile);
|
||||
|
||||
//Stamp document and produce a PDF from the area tree XML format
|
||||
ExampleStamp app = new ExampleStamp();
|
||||
app.stampToPDF(atfile, stampxsltfile, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,227 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.events;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
import org.apache.fop.events.Event;
|
||||
import org.apache.fop.events.EventFormatter;
|
||||
import org.apache.fop.events.EventListener;
|
||||
import org.apache.fop.events.model.EventSeverity;
|
||||
|
||||
/**
|
||||
* This class demonstrates how to register an event listener with FOP so you can customize
|
||||
* FOP's error behaviour.
|
||||
*/
|
||||
public class ExampleEvents {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Converts an FO file to a PDF file using FOP
|
||||
* @param fo the FO file
|
||||
* @param pdf the target PDF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a FOP problem
|
||||
* @throws TransformerException In case of a problem with XSLT
|
||||
*/
|
||||
public void convertFO2PDF(URL fo, File pdf)
|
||||
throws IOException, FOPException, TransformerException {
|
||||
|
||||
OutputStream out = null;
|
||||
|
||||
try {
|
||||
//Create the user agent for this processing run
|
||||
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
|
||||
|
||||
//Adding a simple logging listener that writes to stdout and stderr
|
||||
foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());
|
||||
|
||||
// Add your own event listener
|
||||
foUserAgent.getEventBroadcaster().addEventListener(new MyEventListener());
|
||||
|
||||
// configure foUserAgent further as desired
|
||||
|
||||
// Setup output stream. Note: Using BufferedOutputStream
|
||||
// for performance reasons (helpful with FileOutputStreams).
|
||||
out = new FileOutputStream(pdf);
|
||||
out = new BufferedOutputStream(out);
|
||||
|
||||
// Construct fop with desired output format
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
|
||||
|
||||
// Setup JAXP using identity transformer
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer = factory.newTransformer(); // identity transformer
|
||||
|
||||
// Setup input stream
|
||||
Source src = new StreamSource(fo.toExternalForm());
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
|
||||
} finally {
|
||||
IOUtils.closeQuietly(out);
|
||||
}
|
||||
}
|
||||
|
||||
private static class MyEventListener implements EventListener {
|
||||
|
||||
public void processEvent(Event event) {
|
||||
if ("org.apache.fop.ResourceEventProducer.imageNotFound"
|
||||
.equals(event.getEventID())) {
|
||||
|
||||
//Get the FileNotFoundException that's part of the event's parameters
|
||||
FileNotFoundException fnfe = (FileNotFoundException)event.getParam("fnfe");
|
||||
|
||||
System.out.println("---=== imageNotFound Event for " + event.getParam("uri")
|
||||
+ "!!! ===---");
|
||||
//Stop processing when an image could not be found. Otherwise, FOP would just
|
||||
//continue without the image!
|
||||
|
||||
System.out.println("Throwing a RuntimeException...");
|
||||
throw new RuntimeException(EventFormatter.format(event), fnfe);
|
||||
} else {
|
||||
//ignore all other events
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** A simple event listener that writes the events to stdout and sterr. */
|
||||
private static class SysOutEventListener implements EventListener {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public void processEvent(Event event) {
|
||||
String msg = EventFormatter.format(event);
|
||||
EventSeverity severity = event.getSeverity();
|
||||
if (severity == EventSeverity.INFO) {
|
||||
System.out.println("[INFO ] " + msg);
|
||||
} else if (severity == EventSeverity.WARN) {
|
||||
System.out.println("[WARN ] " + msg);
|
||||
} else if (severity == EventSeverity.ERROR) {
|
||||
System.err.println("[ERROR] " + msg);
|
||||
} else if (severity == EventSeverity.FATAL) {
|
||||
System.err.println("[FATAL] " + msg);
|
||||
} else {
|
||||
assert false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method extracts the original exception from some exception. The exception
|
||||
* might be nested multiple levels deep.
|
||||
* @param t the Throwable to inspect
|
||||
* @return the original Throwable or the method parameter t if there are no nested Throwables.
|
||||
*/
|
||||
private static Throwable getOriginalThrowable(Throwable t) {
|
||||
if (t instanceof SAXException) {
|
||||
SAXException saxe = (SAXException)t;
|
||||
if (saxe.getException() != null) {
|
||||
return getOriginalThrowable(saxe.getException());
|
||||
} else {
|
||||
return saxe;
|
||||
}
|
||||
} else {
|
||||
if (t.getCause() != null) {
|
||||
return getOriginalThrowable(t.getCause());
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleEvents\n");
|
||||
System.out.println("Preparing...");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup input and output files
|
||||
URL fo = ExampleEvents.class.getResource("missing-image.fo");
|
||||
File pdffile = new File(outDir, "out.pdf");
|
||||
|
||||
System.out.println("Input: XSL-FO (" + fo.toExternalForm() + ")");
|
||||
System.out.println("Output: PDF (" + pdffile + ")");
|
||||
System.out.println();
|
||||
System.out.println("Transforming...");
|
||||
|
||||
ExampleEvents app = new ExampleEvents();
|
||||
|
||||
try {
|
||||
app.convertFO2PDF(fo, pdffile);
|
||||
} catch (TransformerException te) {
|
||||
//Note: We don't get the original exception here!
|
||||
//FOP needs to embed the exception in a SAXException and the TraX transformer
|
||||
//again wraps the SAXException in a TransformerException. Even our own
|
||||
//RuntimeException just wraps the original FileNotFoundException.
|
||||
//So we need to unpack to get the original exception (about three layers deep).
|
||||
Throwable originalThrowable = getOriginalThrowable(te);
|
||||
originalThrowable.printStackTrace(System.err);
|
||||
System.out.println("Aborted!");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
System.out.println("Success!");
|
||||
} catch (Exception e) {
|
||||
//Some other error (shouldn't happen in this example)
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" margin="2cm">
|
||||
<fo:region-body/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="A4">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block>
|
||||
The following image is not available:
|
||||
<fo:external-graphic src="my-missing-image.png"/>
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
|
|
@ -0,0 +1,226 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.intermediate;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
import org.apache.fop.render.intermediate.IFContext;
|
||||
import org.apache.fop.render.intermediate.IFDocumentHandler;
|
||||
import org.apache.fop.render.intermediate.IFException;
|
||||
import org.apache.fop.render.intermediate.IFSerializer;
|
||||
import org.apache.fop.render.intermediate.IFUtil;
|
||||
import org.apache.fop.render.intermediate.util.IFConcatenator;
|
||||
|
||||
import embedding.ExampleObj2XML;
|
||||
import embedding.model.ProjectMember;
|
||||
import embedding.model.ProjectTeam;
|
||||
|
||||
/**
|
||||
* Example for the intermediate format that demonstrates the concatenation of two documents
|
||||
* rendered to the intermediate format. A single PDF file is generated from the two intermediate
|
||||
* files.
|
||||
*/
|
||||
public class ExampleConcat {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Creates a sample ProjectTeam instance for this demo.
|
||||
* @return ProjectTeam the newly created ProjectTeam instance
|
||||
*/
|
||||
public static ProjectTeam createAnotherProjectTeam() {
|
||||
ProjectTeam team = new ProjectTeam();
|
||||
team.setProjectName("The Dynamic Duo");
|
||||
team.addMember(new ProjectMember(
|
||||
"Batman", "lead", "batman@heroes.org"));
|
||||
team.addMember(new ProjectMember(
|
||||
"Robin", "aid", "robin@heroes.org"));
|
||||
return team;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an XSL-FO document to an intermediate file.
|
||||
* @param src the source file
|
||||
* @param xslt the stylesheet file
|
||||
* @param intermediate the target intermediate file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws FOPException In case of a FOP problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
*/
|
||||
public void convertToIntermediate(Source src, Source xslt, File intermediate)
|
||||
throws IOException, FOPException, TransformerException {
|
||||
|
||||
//Create a user agent
|
||||
FOUserAgent userAgent = fopFactory.newFOUserAgent();
|
||||
|
||||
//Create an instance of the target document handler so the IFSerializer
|
||||
//can use its font setup
|
||||
IFDocumentHandler targetHandler = userAgent.getRendererFactory().createDocumentHandler(
|
||||
userAgent, MimeConstants.MIME_PDF);
|
||||
|
||||
//Create the IFSerializer to write the intermediate format
|
||||
IFSerializer ifSerializer = new IFSerializer(new IFContext(userAgent));
|
||||
|
||||
//Tell the IFSerializer to mimic the target format
|
||||
ifSerializer.mimicDocumentHandler(targetHandler);
|
||||
|
||||
//Make sure the prepared document handler is used
|
||||
userAgent.setDocumentHandlerOverride(ifSerializer);
|
||||
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(intermediate);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
// Construct FOP (the MIME type here is unimportant due to the override
|
||||
// on the user agent)
|
||||
Fop fop = fopFactory.newFop(null, userAgent, out);
|
||||
|
||||
// Setup XSLT
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
Transformer transformer;
|
||||
if (xslt != null) {
|
||||
transformer = factory.newTransformer(xslt);
|
||||
} else {
|
||||
transformer = factory.newTransformer();
|
||||
}
|
||||
|
||||
// Resulting SAX events (the generated FO) must be piped through to FOP
|
||||
Result res = new SAXResult(fop.getDefaultHandler());
|
||||
|
||||
// Start XSLT transformation and FOP processing
|
||||
transformer.transform(src, res);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Concatenates an array of intermediate files to a single PDF file.
|
||||
* @param files the array of intermediate files
|
||||
* @param pdffile the target PDF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
* @throws SAXException In case of an XML-related problem
|
||||
* @throws IFException if there was an IF-related error while creating the output file
|
||||
*/
|
||||
public void concatToPDF(File[] files, File pdffile)
|
||||
throws IOException, TransformerException, SAXException, IFException {
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(pdffile);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
//Setup user agent
|
||||
FOUserAgent userAgent = fopFactory.newFOUserAgent();
|
||||
|
||||
//Setup target handler
|
||||
String mime = MimeConstants.MIME_PDF;
|
||||
IFDocumentHandler targetHandler = fopFactory.getRendererFactory().createDocumentHandler(
|
||||
userAgent, mime);
|
||||
|
||||
//Setup fonts
|
||||
IFUtil.setupFonts(targetHandler);
|
||||
targetHandler.setResult(new StreamResult(pdffile));
|
||||
|
||||
IFConcatenator concatenator = new IFConcatenator(targetHandler, null);
|
||||
|
||||
//Iterate over all intermediate files
|
||||
for (File file : files) {
|
||||
Source src = new StreamSource(file);
|
||||
concatenator.appendDocument(src);
|
||||
}
|
||||
|
||||
//Signal the end of the processing so the target file can be finalized properly.
|
||||
concatenator.finish();
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleConcat (for the Intermediate Format)\n");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup output file
|
||||
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
|
||||
File[] files = new File[] {
|
||||
new File(outDir, "team1.if.xml"),
|
||||
new File(outDir, "team2.if.xml")};
|
||||
File pdffile = new File(outDir, "ResultIFConcat.pdf");
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
System.out.println("Intermediate file " + (i + 1) + ": "
|
||||
+ files[i].getCanonicalPath());
|
||||
}
|
||||
System.out.println("PDF Output File: " + pdffile.getCanonicalPath());
|
||||
System.out.println();
|
||||
|
||||
|
||||
ProjectTeam team1 = ExampleObj2XML.createSampleProjectTeam();
|
||||
ProjectTeam team2 = createAnotherProjectTeam();
|
||||
|
||||
ExampleConcat app = new ExampleConcat();
|
||||
|
||||
//Create intermediate files
|
||||
app.convertToIntermediate(
|
||||
team1.getSourceForProjectTeam(),
|
||||
new StreamSource(xsltfile), files[0]);
|
||||
app.convertToIntermediate(
|
||||
team2.getSourceForProjectTeam(),
|
||||
new StreamSource(xsltfile), files[1]);
|
||||
|
||||
//Concatenate the individual intermediate files to one document
|
||||
app.concatToPDF(files, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.intermediate;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.MimeConstants;
|
||||
import org.apache.fop.render.intermediate.IFDocumentHandler;
|
||||
import org.apache.fop.render.intermediate.IFException;
|
||||
import org.apache.fop.render.intermediate.IFParser;
|
||||
import org.apache.fop.render.intermediate.IFUtil;
|
||||
|
||||
import embedding.ExampleObj2XML;
|
||||
import embedding.model.ProjectTeam;
|
||||
|
||||
/**
|
||||
* Example for the intermediate format that demonstrates the stamping of a document with some
|
||||
* kind of watermark. The resulting document is then rendered to a PDF file.
|
||||
*/
|
||||
public class ExampleStamp {
|
||||
|
||||
// configure fopFactory as desired
|
||||
private final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
|
||||
|
||||
/**
|
||||
* Stamps an intermediate file and renders it to a PDF file.
|
||||
* @param iffile the intermediate file (area tree XML)
|
||||
* @param stampSheet the stylesheet that does the stamping
|
||||
* @param pdffile the target PDF file
|
||||
* @throws IOException In case of an I/O problem
|
||||
* @throws TransformerException In case of a XSL transformation problem
|
||||
* @throws SAXException In case of an XML-related problem
|
||||
* @throws IFException if there was an IF-related error while creating the output file
|
||||
*/
|
||||
public void stampToPDF(File iffile, File stampSheet, File pdffile)
|
||||
throws IOException, TransformerException, SAXException, IFException {
|
||||
// Setup output
|
||||
OutputStream out = new java.io.FileOutputStream(pdffile);
|
||||
out = new java.io.BufferedOutputStream(out);
|
||||
try {
|
||||
//user agent
|
||||
FOUserAgent userAgent = fopFactory.newFOUserAgent();
|
||||
|
||||
//Setup target handler
|
||||
String mime = MimeConstants.MIME_PDF;
|
||||
IFDocumentHandler targetHandler = fopFactory.getRendererFactory().createDocumentHandler(
|
||||
userAgent, mime);
|
||||
|
||||
//Setup fonts
|
||||
IFUtil.setupFonts(targetHandler);
|
||||
targetHandler.setResult(new StreamResult(pdffile));
|
||||
|
||||
IFParser parser = new IFParser();
|
||||
|
||||
Source src = new StreamSource(iffile);
|
||||
Source xslt = new StreamSource(stampSheet);
|
||||
|
||||
//Setup Transformer for XSLT processing
|
||||
TransformerFactory tFactory = TransformerFactory.newInstance();
|
||||
Transformer transformer = tFactory.newTransformer(xslt);
|
||||
|
||||
//Send XSLT result to AreaTreeParser
|
||||
SAXResult res = new SAXResult(parser.getContentHandler(targetHandler, userAgent));
|
||||
|
||||
//Start XSLT transformation and area tree parsing
|
||||
transformer.transform(src, res);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("FOP ExampleConcat (for the Intermediate Format)\n");
|
||||
|
||||
//Setup directories
|
||||
File baseDir = new File(".");
|
||||
File outDir = new File(baseDir, "out");
|
||||
outDir.mkdirs();
|
||||
|
||||
//Setup output file
|
||||
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
|
||||
File iffile = new File(outDir, "team.if.xml");
|
||||
File stampxsltfile = new File(baseDir, "xml/xslt/ifstamp.xsl");
|
||||
File pdffile = new File(outDir, "ResultIFStamped.pdf");
|
||||
System.out.println("Intermediate file : " + iffile.getCanonicalPath());
|
||||
System.out.println("Stamp XSLT: " + stampxsltfile.getCanonicalPath());
|
||||
System.out.println("PDF Output File: " + pdffile.getCanonicalPath());
|
||||
System.out.println();
|
||||
|
||||
ProjectTeam team1 = ExampleObj2XML.createSampleProjectTeam();
|
||||
|
||||
//Create intermediate file
|
||||
ExampleConcat concatapp = new ExampleConcat();
|
||||
concatapp.convertToIntermediate(
|
||||
team1.getSourceForProjectTeam(),
|
||||
new StreamSource(xsltfile), iffile);
|
||||
|
||||
//Stamp document and produce a PDF from the intermediate format
|
||||
ExampleStamp app = new ExampleStamp();
|
||||
app.stampToPDF(iffile, stampxsltfile, pdffile);
|
||||
|
||||
System.out.println("Success!");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.model;
|
||||
|
||||
/**
|
||||
* This bean represents a project member.
|
||||
*/
|
||||
public class ProjectMember {
|
||||
|
||||
private String name;
|
||||
private String function;
|
||||
private String email;
|
||||
|
||||
|
||||
/**
|
||||
* Default no-parameter constructor.
|
||||
*/
|
||||
public ProjectMember() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convenience constructor.
|
||||
* @param name name of the project member
|
||||
* @param function function in the team
|
||||
* @param email email address
|
||||
*/
|
||||
public ProjectMember(String name, String function, String email) {
|
||||
setName(name);
|
||||
setFunction(function);
|
||||
setEmail(email);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name.
|
||||
* @return String the name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the function.
|
||||
* @return String the function
|
||||
*/
|
||||
public String getFunction() {
|
||||
return function;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the email address.
|
||||
* @return String the email address
|
||||
*/
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the name.
|
||||
* @param name The name to set
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the function.
|
||||
* @param function The function to set
|
||||
*/
|
||||
public void setFunction(String function) {
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the email address.
|
||||
* @param email The email address to set
|
||||
*/
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.sax.SAXSource;
|
||||
|
||||
/**
|
||||
* This bean represents a ProjectTeam.
|
||||
*/
|
||||
public class ProjectTeam {
|
||||
|
||||
private String projectName;
|
||||
private List members = new java.util.ArrayList();
|
||||
|
||||
|
||||
/**
|
||||
* Returns a list of project members.
|
||||
* @return List a list of ProjectMember objects
|
||||
*/
|
||||
public List getMembers() {
|
||||
return this.members;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds a ProjectMember to this project team.
|
||||
* @param member the member to add
|
||||
*/
|
||||
public void addMember(ProjectMember member) {
|
||||
this.members.add(member);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the name of the project
|
||||
* @return String the name of the project
|
||||
*/
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the name of the project.
|
||||
* @param projectName the project name to set
|
||||
*/
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resturns a Source object for this object so it can be used as input for
|
||||
* a JAXP transformation.
|
||||
* @return Source The Source object
|
||||
*/
|
||||
public Source getSourceForProjectTeam() {
|
||||
return new SAXSource(new ProjectTeamXMLReader(),
|
||||
new ProjectTeamInputSource(this));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.model;
|
||||
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
/**
|
||||
* This class is a special InputSource decendant for using ProjectTeam
|
||||
* instances as XML sources.
|
||||
*/
|
||||
public class ProjectTeamInputSource extends InputSource {
|
||||
|
||||
private ProjectTeam projectTeam;
|
||||
|
||||
/**
|
||||
* Constructor for the ProjectTeamInputSource
|
||||
* @param projectTeam The ProjectTeam object to use
|
||||
*/
|
||||
public ProjectTeamInputSource(ProjectTeam projectTeam) {
|
||||
this.projectTeam = projectTeam;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the projectTeam.
|
||||
* @return ProjectTeam
|
||||
*/
|
||||
public ProjectTeam getProjectTeam() {
|
||||
return projectTeam;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the projectTeam.
|
||||
* @param projectTeam The projectTeam to set
|
||||
*/
|
||||
public void setProjectTeam(ProjectTeam projectTeam) {
|
||||
this.projectTeam = projectTeam;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.model;
|
||||
|
||||
//Java
|
||||
import java.io.IOException;
|
||||
|
||||
//SAX
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import embedding.tools.AbstractObjectReader;
|
||||
|
||||
/**
|
||||
* XMLReader implementation for the ProjectTeam class. This class is used to
|
||||
* generate SAX events from the ProjectTeam class.
|
||||
*/
|
||||
public class ProjectTeamXMLReader extends AbstractObjectReader {
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#parse(InputSource)
|
||||
*/
|
||||
public void parse(InputSource input) throws IOException, SAXException {
|
||||
if (input instanceof ProjectTeamInputSource) {
|
||||
parse(((ProjectTeamInputSource)input).getProjectTeam());
|
||||
} else {
|
||||
throw new SAXException("Unsupported InputSource specified. "
|
||||
+ "Must be a ProjectTeamInputSource");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Starts parsing the ProjectTeam object.
|
||||
* @param projectTeam The object to parse
|
||||
* @throws SAXException In case of a problem during SAX event generation
|
||||
*/
|
||||
public void parse(ProjectTeam projectTeam) throws SAXException {
|
||||
if (projectTeam == null) {
|
||||
throw new NullPointerException("Parameter projectTeam must not be null");
|
||||
}
|
||||
if (handler == null) {
|
||||
throw new IllegalStateException("ContentHandler not set");
|
||||
}
|
||||
|
||||
//Start the document
|
||||
handler.startDocument();
|
||||
|
||||
//Generate SAX events for the ProjectTeam
|
||||
generateFor(projectTeam);
|
||||
|
||||
//End the document
|
||||
handler.endDocument();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates SAX events for a ProjectTeam object.
|
||||
* @param projectTeam ProjectTeam object to use
|
||||
* @throws SAXException In case of a problem during SAX event generation
|
||||
*/
|
||||
protected void generateFor(ProjectTeam projectTeam) throws SAXException {
|
||||
if (projectTeam == null) {
|
||||
throw new NullPointerException("Parameter projectTeam must not be null");
|
||||
}
|
||||
if (handler == null) {
|
||||
throw new IllegalStateException("ContentHandler not set");
|
||||
}
|
||||
|
||||
handler.startElement("projectteam");
|
||||
handler.element("projectname", projectTeam.getProjectName());
|
||||
for (Object o : projectTeam.getMembers()) {
|
||||
ProjectMember member = (ProjectMember) o;
|
||||
generateFor(member);
|
||||
}
|
||||
handler.endElement("projectteam");
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates SAX events for a ProjectMember object.
|
||||
* @param projectMember ProjectMember object to use
|
||||
* @throws SAXException In case of a problem during SAX event generation
|
||||
*/
|
||||
protected void generateFor(ProjectMember projectMember) throws SAXException {
|
||||
if (projectMember == null) {
|
||||
throw new NullPointerException("Parameter projectMember must not be null");
|
||||
}
|
||||
if (handler == null) {
|
||||
throw new IllegalStateException("ContentHandler not set");
|
||||
}
|
||||
|
||||
handler.startElement("member");
|
||||
handler.element("name", projectMember.getName());
|
||||
handler.element("function", projectMember.getFunction());
|
||||
handler.element("email", projectMember.getEmail());
|
||||
handler.endElement("member");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.tools;
|
||||
|
||||
//Java
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
//SAX
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.DTDHandler;
|
||||
import org.xml.sax.ErrorHandler;
|
||||
import org.xml.sax.EntityResolver;
|
||||
|
||||
/**
|
||||
* This class can be used as base class for XMLReaders that generate SAX
|
||||
* events from Java objects.
|
||||
*/
|
||||
|
||||
public abstract class AbstractObjectReader implements XMLReader {
|
||||
|
||||
private static final String NAMESPACES =
|
||||
"http://xml.org/sax/features/namespaces";
|
||||
private static final String NS_PREFIXES =
|
||||
"http://xml.org/sax/features/namespace-prefixes";
|
||||
|
||||
private Map features = new java.util.HashMap();
|
||||
private ContentHandler orgHandler;
|
||||
|
||||
/** Proxy for easy SAX event generation */
|
||||
protected EasyGenerationContentHandlerProxy handler;
|
||||
/** Error handler */
|
||||
protected ErrorHandler errorHandler;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the AbstractObjectReader object
|
||||
*/
|
||||
public AbstractObjectReader() {
|
||||
setFeature(NAMESPACES, false);
|
||||
setFeature(NS_PREFIXES, false);
|
||||
}
|
||||
|
||||
/* ============ XMLReader interface ============ */
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#getContentHandler()
|
||||
*/
|
||||
public ContentHandler getContentHandler() {
|
||||
return this.orgHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#setContentHandler(ContentHandler)
|
||||
*/
|
||||
public void setContentHandler(ContentHandler handler) {
|
||||
this.orgHandler = handler;
|
||||
this.handler = new EasyGenerationContentHandlerProxy(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#getErrorHandler()
|
||||
*/
|
||||
public ErrorHandler getErrorHandler() {
|
||||
return this.errorHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#setErrorHandler(ErrorHandler)
|
||||
*/
|
||||
public void setErrorHandler(ErrorHandler handler) {
|
||||
this.errorHandler = handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#getDTDHandler()
|
||||
*/
|
||||
public DTDHandler getDTDHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#setDTDHandler(DTDHandler)
|
||||
*/
|
||||
public void setDTDHandler(DTDHandler handler) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#getEntityResolver()
|
||||
*/
|
||||
public EntityResolver getEntityResolver() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#setEntityResolver(EntityResolver)
|
||||
*/
|
||||
public void setEntityResolver(EntityResolver resolver) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#getProperty(String)
|
||||
*/
|
||||
public Object getProperty(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#setProperty(String, Object)
|
||||
*/
|
||||
public void setProperty(String name, Object value) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#getFeature(String)
|
||||
*/
|
||||
public boolean getFeature(String name) {
|
||||
return (Boolean) features.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the NAMESPACES feature is enabled.
|
||||
* @return boolean true if enabled
|
||||
*/
|
||||
protected boolean isNamespaces() {
|
||||
return getFeature(NAMESPACES);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the MS_PREFIXES feature is enabled.
|
||||
* @return boolean true if enabled
|
||||
*/
|
||||
protected boolean isNamespacePrefixes() {
|
||||
return getFeature(NS_PREFIXES);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#setFeature(String, boolean)
|
||||
*/
|
||||
public void setFeature(String name, boolean value) {
|
||||
this.features.put(name, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#parse(String)
|
||||
*/
|
||||
public void parse(String systemId) throws IOException, SAXException {
|
||||
throw new SAXException(
|
||||
this.getClass().getName()
|
||||
+ " cannot be used with system identifiers (URIs)");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.XMLReader#parse(InputSource)
|
||||
*/
|
||||
public abstract void parse(InputSource input)
|
||||
throws IOException, SAXException;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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$ */
|
||||
|
||||
package embedding.tools;
|
||||
|
||||
//SAX
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.AttributesImpl;
|
||||
|
||||
/**
|
||||
* This class is an implementation of ContentHandler which acts as a proxy to
|
||||
* another ContentHandler and has the purpose to provide a few handy methods
|
||||
* that make life easier when generating SAX events.
|
||||
* <br>
|
||||
* Note: This class is only useful for simple cases with no namespaces.
|
||||
*/
|
||||
|
||||
public class EasyGenerationContentHandlerProxy implements ContentHandler {
|
||||
|
||||
/** An empty Attributes object used when no attributes are needed. */
|
||||
public static final Attributes EMPTY_ATTS = new AttributesImpl();
|
||||
|
||||
private ContentHandler target;
|
||||
|
||||
|
||||
/**
|
||||
* Main constructor.
|
||||
* @param forwardTo ContentHandler to forward the SAX event to.
|
||||
*/
|
||||
public EasyGenerationContentHandlerProxy(ContentHandler forwardTo) {
|
||||
this.target = forwardTo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends the notification of the beginning of an element.
|
||||
* @param name Name for the element.
|
||||
* @throws SAXException Any SAX exception, possibly wrapping another exception.
|
||||
*/
|
||||
public void startElement(String name) throws SAXException {
|
||||
startElement(name, EMPTY_ATTS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends the notification of the beginning of an element.
|
||||
* @param name Name for the element.
|
||||
* @param atts The attributes attached to the element. If there are no
|
||||
* attributes, it shall be an empty Attributes object.
|
||||
* @throws SAXException Any SAX exception, possibly wrapping another exception.
|
||||
*/
|
||||
public void startElement(String name, Attributes atts) throws SAXException {
|
||||
startElement(null, name, name, atts);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a String of character data.
|
||||
* @param s The content String
|
||||
* @throws SAXException Any SAX exception, possibly wrapping another exception.
|
||||
*/
|
||||
public void characters(String s) throws SAXException {
|
||||
target.characters(s.toCharArray(), 0, s.length());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send the notification of the end of an element.
|
||||
* @param name Name for the element.
|
||||
* @throws SAXException Any SAX exception, possibly wrapping another exception.
|
||||
*/
|
||||
public void endElement(String name) throws SAXException {
|
||||
endElement(null, name, name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends notifications for a whole element with some String content.
|
||||
* @param name Name for the element.
|
||||
* @param value Content of the element.
|
||||
* @throws SAXException Any SAX exception, possibly wrapping another exception.
|
||||
*/
|
||||
public void element(String name, String value) throws SAXException {
|
||||
element(name, value, EMPTY_ATTS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends notifications for a whole element with some String content.
|
||||
* @param name Name for the element.
|
||||
* @param value Content of the element.
|
||||
* @param atts The attributes attached to the element. If there are no
|
||||
* attributes, it shall be an empty Attributes object.
|
||||
* @throws SAXException Any SAX exception, possibly wrapping another exception.
|
||||
*/
|
||||
public void element(String name, String value, Attributes atts) throws SAXException {
|
||||
startElement(name, atts);
|
||||
if (value != null) {
|
||||
characters(value.toCharArray(), 0, value.length());
|
||||
}
|
||||
endElement(name);
|
||||
}
|
||||
|
||||
/* =========== ContentHandler interface =========== */
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
|
||||
*/
|
||||
public void setDocumentLocator(Locator locator) {
|
||||
target.setDocumentLocator(locator);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#startDocument()
|
||||
*/
|
||||
public void startDocument() throws SAXException {
|
||||
target.startDocument();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#endDocument()
|
||||
*/
|
||||
public void endDocument() throws SAXException {
|
||||
target.endDocument();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
|
||||
*/
|
||||
public void startPrefixMapping(String prefix, String uri) throws SAXException {
|
||||
target.startPrefixMapping(prefix, uri);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#endPrefixMapping(String)
|
||||
*/
|
||||
public void endPrefixMapping(String prefix) throws SAXException {
|
||||
target.endPrefixMapping(prefix);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
|
||||
*/
|
||||
public void startElement(String namespaceURI, String localName,
|
||||
String qName, Attributes atts) throws SAXException {
|
||||
target.startElement(namespaceURI, localName, qName, atts);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#endElement(String, String, String)
|
||||
*/
|
||||
public void endElement(String namespaceURI, String localName, String qName)
|
||||
throws SAXException {
|
||||
target.endElement(namespaceURI, localName, qName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#characters(char[], int, int)
|
||||
*/
|
||||
public void characters(char[] ch, int start, int length) throws SAXException {
|
||||
target.characters(ch, start, length);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
|
||||
*/
|
||||
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
|
||||
target.ignorableWhitespace(ch, start, length);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#processingInstruction(String, String)
|
||||
*/
|
||||
public void processingInstruction(String target, String data) throws SAXException {
|
||||
this.target.processingInstruction(target, data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#skippedEntity(String)
|
||||
*/
|
||||
public void skippedEntity(String name) throws SAXException {
|
||||
target.skippedEntity(name);
|
||||
}
|
||||
|
||||
}
|
||||
30
apache_fop/fop/examples/embedding/xml/fo/helloworld.fo
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
|
||||
<fo:region-body/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="simpleA4">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block>Hello World!</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
26
apache_fop/fop/examples/embedding/xml/svg/helloworld.svg
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd">
|
||||
<svg xml:space="preserve" x="-1.70458in" y="0.198315in" width="2.6622in" height="1.89672in" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality"
|
||||
viewBox="-4330 0 6762 4818">
|
||||
<rect style="fill:none;stroke:#009BE1;stroke-width:35" x="-4312" y="18" width="6727" height="4782"/>
|
||||
<text x="-3653" y="841" style="fill:#1F1A17;font-weight:normal;font-size:639;font-family:Helvetica">Hello World!</text>
|
||||
<ellipse style="fill:#E77919" cx="-2697" cy="2934" rx="925" ry="925"/>
|
||||
<path style="fill:none;stroke:#A3D01C;stroke-width:35" d="M209 1102l799 239 798 239 191 811 192 811 -606 572 -607 571 -798 -239 -798 -240 -192 -810 -192 -811 607 -572 606 -571z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
46
apache_fop/fop/examples/embedding/xml/xml/projectteam.xml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<projectteam>
|
||||
<projectname>The Killer Application</projectname>
|
||||
<member>
|
||||
<name>John Doe</name>
|
||||
<function>lead</function>
|
||||
<email>jon.doe@killerapp.fun</email>
|
||||
</member>
|
||||
<member>
|
||||
<name>Paul Coder</name>
|
||||
<function>dev</function>
|
||||
<email>paul.coder@killerapp.fun</email>
|
||||
</member>
|
||||
<member>
|
||||
<name>Max Hacker</name>
|
||||
<function>dev</function>
|
||||
<email>max.hacker@killerapp.fun</email>
|
||||
</member>
|
||||
<member>
|
||||
<name>Donna Book</name>
|
||||
<function>doc</function>
|
||||
<email>donna.book@killerapp.fun</email>
|
||||
</member>
|
||||
<member>
|
||||
<name>Henry Tester</name>
|
||||
<function>qa</function>
|
||||
<email>henry.tester@killerapp.fun</email>
|
||||
</member>
|
||||
</projectteam>
|
||||
58
apache_fop/fop/examples/embedding/xml/xslt/atstamp.xsl
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>
|
||||
<!-- ========================= -->
|
||||
<!-- stamping... -->
|
||||
<!-- ========================= -->
|
||||
<xsl:template match="flow">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*"/>
|
||||
|
||||
<!-- Stamp a big "SPECIMEN" text over the whole page using an area tree fragment inserted at the right place... -->
|
||||
<block ipd="595275" bpd="841889" is-viewport-area="true" left-position="0" top-position="0" ctm="[1.0 0.0 0.0 1.0 0.0 0.0]" positioning="fixed">
|
||||
<block ipd="595275" bpd="841889" is-reference-area="true">
|
||||
<block ipd="595275" bpd="841889">
|
||||
<lineArea ipd="595275" bpd="841889">
|
||||
<viewport ipd="595275" bpd="841889" offset="0" pos="0 0 595275 841889">
|
||||
<foreignObject ipd="0" bpd="0" ns="http://www.w3.org/2000/svg">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||
<g transform="rotate(-50 50 50)">
|
||||
<text x="50" y="60" style="font-size:20;fill:#dfdfdf;stroke:none;font-family:sans-serif" text-anchor="middle">SPECIMEN</text>
|
||||
</g>
|
||||
</svg>
|
||||
</foreignObject>
|
||||
</viewport>
|
||||
</lineArea>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<xsl:apply-templates select="child::*"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<!-- ========================= -->
|
||||
<!-- identity transformation -->
|
||||
<!-- ========================= -->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
49
apache_fop/fop/examples/embedding/xml/xslt/ifstamp.xsl
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:if="http://xmlgraphics.apache.org/fop/intermediate">
|
||||
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>
|
||||
<!-- ========================= -->
|
||||
<!-- stamping... -->
|
||||
<!-- ========================= -->
|
||||
<xsl:template match="if:content">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*"/>
|
||||
|
||||
<!-- Stamp a big "SPECIMEN" text over the whole page using an area tree fragment inserted at the right place... -->
|
||||
<if:g transform="translate(100000, 750000) rotate(-55)">
|
||||
<if:font family="sans-serif" style="normal" weight="400" variant="normal" size="160000"
|
||||
color="#dfdfdf"/>
|
||||
<if:text xml:space="preserve" x="0" y="0">SPECIMEN</if:text>
|
||||
</if:g>
|
||||
<!-- Note: The free transformation above will not work with AFP output. In such a case,
|
||||
using an embedded SVG graphic is better. -->
|
||||
|
||||
<xsl:apply-templates select="child::*"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<!-- ========================= -->
|
||||
<!-- identity transformation -->
|
||||
<!-- ========================= -->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
|
||||
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>
|
||||
<xsl:param name="versionParam" select="'1.0'"/>
|
||||
<!-- ========================= -->
|
||||
<!-- root element: projectteam -->
|
||||
<!-- ========================= -->
|
||||
<xsl:template match="projectteam">
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
|
||||
<fo:region-body/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="simpleA4">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block font-size="16pt" font-weight="bold" space-after="5mm">Project: <xsl:value-of select="projectname"/>
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt" space-after="5mm">Version <xsl:value-of select="$versionParam"/>
|
||||
</fo:block>
|
||||
<fo:block font-size="10pt">
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="4cm"/>
|
||||
<fo:table-column column-width="4cm"/>
|
||||
<fo:table-column column-width="5cm"/>
|
||||
<fo:table-body>
|
||||
<xsl:apply-templates select="member"/>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
<!-- ========================= -->
|
||||
<!-- child element: member -->
|
||||
<!-- ========================= -->
|
||||
<xsl:template match="member">
|
||||
<fo:table-row>
|
||||
<xsl:if test="function = 'lead'">
|
||||
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
||||
</xsl:if>
|
||||
<fo:table-cell>
|
||||
<fo:block>
|
||||
<xsl:value-of select="name"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block>
|
||||
<xsl:value-of select="function"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block>
|
||||
<xsl:value-of select="email"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
6
apache_fop/fop/examples/fo/advanced/K3.README
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
The K3 3 of 9 barcode font is available from:
|
||||
|
||||
http://www.geocities.com/keith_dimmock/
|
||||
|
||||
Keith Dimmock states:
|
||||
Unless otherwise indicated all downloads are FREE, no cost and no nag screens.
|
||||
BIN
apache_fop/fop/examples/fo/advanced/K3.TTF
Normal file
1
apache_fop/fop/examples/fo/advanced/K3.xml
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?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>
|
||||
87
apache_fop/fop/examples/fo/advanced/bar.conf.xml
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
<?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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
|
||||
<!--
|
||||
FOP configuration for the barcode.fo example.
|
||||
-->
|
||||
|
||||
<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>
|
||||
|
||||
99
apache_fop/fop/examples/fo/advanced/barcode.fo
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-width="21cm"
|
||||
page-height="29.7cm"
|
||||
margin-top="5mm">
|
||||
<fo:region-body
|
||||
margin-bottom="4.5in"
|
||||
margin-right="5mm"
|
||||
margin-left="5mm"
|
||||
margin-top="5mm"/>
|
||||
<fo:region-after
|
||||
extent="4in" />
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:simple-page-master master-name="rest"
|
||||
page-width="21cm"
|
||||
page-height="29.7cm"
|
||||
margin-right="5mm"
|
||||
margin-left="5mm"
|
||||
margin-top="5mm"
|
||||
margin-bottom="5mm">
|
||||
<fo:region-body/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="A4">
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="first" page-position="first"/>
|
||||
<fo:conditional-page-master-reference master-reference="rest" page-position="rest"/>
|
||||
<fo:conditional-page-master-reference master-reference="rest"/>
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<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>
|
||||
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>
|
||||
normal text, follows second barcode.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
155
apache_fop/fop/examples/fo/advanced/bleed-and-crop-marks.fo
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"
|
||||
font-family="sans-serif" font-size="9pt">
|
||||
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="business-card"
|
||||
page-width="84mm" page-height="53mm"
|
||||
fox:bleed="3mm" fox:crop-box="media-box" fox:crop-offset="10mm" fox:scale="4">
|
||||
<fo:region-body margin-bottom="3mm" margin-left="3mm" margin-right="3mm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="business-card">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block-container id="crop-marks" absolute-position="fixed">
|
||||
<fo:block line-height="1" font-size="0pt">
|
||||
<fo:instream-foreign-object>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="84mm" height="53mm" viewBox="0 0 84 53" overflow="visible">
|
||||
<style type="text/css"><![CDATA[
|
||||
.line { fill:none; stroke:black; stroke-width:0.1 }
|
||||
.colorbox { stroke:black; stroke-width:0.1 }
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<rect id="box" class="colorbox" width="5" height="4"/>
|
||||
</defs>
|
||||
<g id="cut-marks">
|
||||
<polyline class="line" points="0,-3 0,-10" />
|
||||
<polyline class="line" points="84,-3 84,-10" />
|
||||
|
||||
<polyline class="line" points="-3,0 -10,0" />
|
||||
<polyline class="line" points="-3,53 -10,53" />
|
||||
|
||||
<polyline class="line" points="0,56 0,63" />
|
||||
<polyline class="line" points="84,56 84,63" />
|
||||
|
||||
<polyline class="line" points="87,0 94,0" />
|
||||
<polyline class="line" points="87,53 94,53" />
|
||||
</g>
|
||||
|
||||
<g id="grays" transform="translate(88,4)">
|
||||
<use xlink:href="#box" y="0" style="fill:rgb(0%,0%,0%)"/>
|
||||
<use xlink:href="#box" y="4" style="fill:rgb(10%,10%,10%)"/>
|
||||
<use xlink:href="#box" y="8" style="fill:rgb(20%,20%,20%)"/>
|
||||
<use xlink:href="#box" y="12" style="fill:rgb(30%,30%,30%)"/>
|
||||
<use xlink:href="#box" y="16" style="fill:rgb(40%,40%,40%)"/>
|
||||
<use xlink:href="#box" y="20" style="fill:rgb(50%,50%,50%)"/>
|
||||
<use xlink:href="#box" y="24" style="fill:rgb(60%,60%,60%)"/>
|
||||
<use xlink:href="#box" y="28" style="fill:rgb(70%,70%,70%)"/>
|
||||
<use xlink:href="#box" y="32" style="fill:rgb(80%,80%,80%)"/>
|
||||
<use xlink:href="#box" y="36" style="fill:rgb(90%,90%,90%)"/>
|
||||
<use xlink:href="#box" y="40" style="fill:rgb(100%,100%,100%)"/>
|
||||
</g>
|
||||
|
||||
<g id="cyan" transform="translate(4,-9)">
|
||||
<use xlink:href="#box" x="0" style="fill:rgb(0%,100%,100%)"/>
|
||||
<use xlink:href="#box" x="5" style="fill:rgb(5%,100%,100%)"/>
|
||||
<use xlink:href="#box" x="10" style="fill:rgb(25%,100%,100%)"/>
|
||||
<use xlink:href="#box" x="15" style="fill:rgb(50%,100%,100%)"/>
|
||||
<use xlink:href="#box" x="20" style="fill:rgb(75%,100%,100%)"/>
|
||||
<use xlink:href="#box" x="25" style="fill:rgb(95%,100%,100%)"/>
|
||||
</g>
|
||||
<g id="magenta" transform="translate(50,-9)">
|
||||
<use xlink:href="#box" x="0" style="fill:rgb(100%,0%,100%)"/>
|
||||
<use xlink:href="#box" x="5" style="fill:rgb(100%,5%,100%)"/>
|
||||
<use xlink:href="#box" x="10" style="fill:rgb(100%,25%,100%)"/>
|
||||
<use xlink:href="#box" x="15" style="fill:rgb(100%,50%,100%)"/>
|
||||
<use xlink:href="#box" x="20" style="fill:rgb(100%,75%,100%)"/>
|
||||
<use xlink:href="#box" x="25" style="fill:rgb(100%,95%,100%)"/>
|
||||
</g>
|
||||
<g id="yellow" transform="translate(4,58)">
|
||||
<use xlink:href="#box" x="0" style="fill:rgb(100%,100%,0%)"/>
|
||||
<use xlink:href="#box" x="5" style="fill:rgb(100%,100%,5%)"/>
|
||||
<use xlink:href="#box" x="10" style="fill:rgb(100%,100%,25%)"/>
|
||||
<use xlink:href="#box" x="15" style="fill:rgb(100%,100%,50%)"/>
|
||||
<use xlink:href="#box" x="20" style="fill:rgb(100%,100%,75%)"/>
|
||||
<use xlink:href="#box" x="25" style="fill:rgb(100%,100%,95%)"/>
|
||||
</g>
|
||||
<g id="base-colors" transform="translate(50,58)">
|
||||
<use xlink:href="#box" x="0" style="fill:red"/>
|
||||
<use xlink:href="#box" x="5" style="fill:green"/>
|
||||
<use xlink:href="#box" x="10" style="fill:blue"/>
|
||||
<use xlink:href="#box" x="15" style="fill:cyan"/>
|
||||
<use xlink:href="#box" x="20" style="fill:magenta"/>
|
||||
<use xlink:href="#box" x="25" style="fill:yellow"/>
|
||||
</g>
|
||||
|
||||
</svg>
|
||||
</fo:instream-foreign-object>
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
|
||||
<fo:block-container id="background" absolute-position="fixed"
|
||||
inline-progression-dimension="84mm" block-progression-dimension="14mm"
|
||||
overflow="visible">
|
||||
<fo:block line-height="1" font-size="0pt">
|
||||
<fo:instream-foreign-object>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||
width="84mm" height="14mm" viewBox="0 0 84 14" overflow="visible">
|
||||
|
||||
<defs>
|
||||
<linearGradient id="MyGradient">
|
||||
<stop offset="0%" stop-color="#FF0000"/>
|
||||
<stop offset="30%" stop-color="#FF0000"/>
|
||||
<stop offset="55%" stop-color="#FFFFFF"/>
|
||||
<stop offset="100%" stop-color="#FFFFFF"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect x="-3" y="-3" width="87" height="17" style="fill:url(#MyGradient); stroke:none"/>
|
||||
</svg>
|
||||
</fo:instream-foreign-object>
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
|
||||
<fo:block-container block-progression-dimension="14mm" display-align="center">
|
||||
<fo:block font-weight="bold" font-size="9mm" line-height="1.5" color="white">ACME</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block start-indent="3mm" end-indent="3mm"/>
|
||||
<fo:block text-align="end" space-before="3mm" space-before.conditionality="retain">
|
||||
<fo:block font-size="14pt" font-weight="bold" space-after="2mm">
|
||||
Pepé Le Pew
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt" space-after="4mm">
|
||||
Expert d'Amour
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<fo:block>13 Pleasantstreet</fo:block>
|
||||
<fo:block>Acme Acres</fo:block>
|
||||
<fo:block>+1 (23) 456-7890</fo:block>
|
||||
<fo:block>pepe@looney.toon</fo:block>
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
455
apache_fop/fop/examples/fo/advanced/cid-fonts.fo
Normal file
|
|
@ -0,0 +1,455 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE fo:root [
|
||||
<!ENTITY nbsp " ">
|
||||
]>
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="A4"
|
||||
page-width="21cm"
|
||||
page-height="29.7cm" >
|
||||
<fo:region-body
|
||||
margin-bottom="1.5cm"
|
||||
margin-right="2cm"
|
||||
margin-left="2cm"
|
||||
margin-top="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:bookmark-tree>
|
||||
<fo:bookmark internal-destination="sec0">
|
||||
<fo:bookmark-title>Adding Fonts to FOP</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
|
||||
<fo:bookmark internal-destination="sec1">
|
||||
<fo:bookmark-title>Adding additional Type 1 fonts</fo:bookmark-title>
|
||||
|
||||
<fo:bookmark internal-destination="sec1-1">
|
||||
<fo:bookmark-title>Generating a font metrics file</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
<fo:bookmark internal-destination="sec1-2">
|
||||
<fo:bookmark-title>Register the fonts within FOP</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
</fo:bookmark>
|
||||
|
||||
<fo:bookmark internal-destination="sec2">
|
||||
<fo:bookmark-title>Adding additional TrueType fonts</fo:bookmark-title>
|
||||
|
||||
<fo:bookmark internal-destination="sec2-1">
|
||||
<fo:bookmark-title>Generating a font metrics file</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
<fo:bookmark internal-destination="sec2-2">
|
||||
<fo:bookmark-title>TrueType collections</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
<fo:bookmark internal-destination="sec2-3">
|
||||
<fo:bookmark-title>Register the fonts within FOP</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
|
||||
</fo:bookmark>
|
||||
|
||||
<fo:bookmark internal-destination="sec3">
|
||||
<fo:bookmark-title>Embedding fonts in the PDF</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
|
||||
<fo:bookmark internal-destination="sec4">
|
||||
<fo:bookmark-title>Example embedding MSGothic</fo:bookmark-title>
|
||||
|
||||
<fo:bookmark internal-destination="sec4-1">
|
||||
<fo:bookmark-title>Setup CLASSPATH</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
|
||||
<fo:bookmark internal-destination="sec4-2">
|
||||
<fo:bookmark-title>Create the metrics file</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
|
||||
<fo:bookmark internal-destination="sec4-3">
|
||||
<fo:bookmark-title>Edit msgothic.xml</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
|
||||
<fo:bookmark internal-destination="sec4-4">
|
||||
<fo:bookmark-title>Register the font with FOP</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
</fo:bookmark>
|
||||
|
||||
<fo:bookmark internal-destination="sec5">
|
||||
<fo:bookmark-title>Japanese Examples</fo:bookmark-title>
|
||||
</fo:bookmark>
|
||||
</fo:bookmark-tree>
|
||||
|
||||
<fo:page-sequence master-reference="A4">
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:wrapper font-family="Times" font-size="12pt" text-align="justify">
|
||||
<fo:block id="sec0"
|
||||
text-align="center"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
font-size="18pt"
|
||||
color="#0050B2" space-after.optimum="6pt">
|
||||
Adding Fonts to FOP
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
When building PDF files, FOP normally supports only the base 14 font
|
||||
package defined in the Adobe PDF specification. That includes the
|
||||
following fonts: Helvetica, Times, Courier, Symbol and ZapfDingbats.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
Font support in FOP can be extended by the addition of font metric
|
||||
files (written in XML) created from Adobe Type 1 fonts and Truetype
|
||||
fonts. No other font types (Type 3, etc.) are supported at this time.
|
||||
</fo:block>
|
||||
|
||||
<fo:block id="sec1"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
font-size="14pt"
|
||||
color="#0050B2"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Adding additional Type 1 fonts
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt" >
|
||||
As mentioned above you need an XML file containing font metrics to
|
||||
be able to use an additional font. FOP contains a tool that can generate
|
||||
such a font metrics file from a PFM file, which normally comes with the
|
||||
font file.
|
||||
</fo:block>
|
||||
|
||||
<fo:block id="sec1-1"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt" >
|
||||
Generating a font metrics file
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt" >
|
||||
Run the class <fo:inline font-family="Courier">org.apache.fop.fonts.apps.PFMReader</fo:inline>
|
||||
to generate the XML file.
|
||||
<fo:block font-family="Courier" font-size="10pt"
|
||||
space-before.optimum="6pt" space-after.optimum="6pt" margin-left="6pt" text-align="start">
|
||||
java org.apache.fop.fonts.apps.PFMReader pfm-file xml-file
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt" margin-left="6pt">
|
||||
Note: The tool will construct some values (FontBBox, StemV and ItalicAngle) based
|
||||
on assumptions and calculations which are only an approximation to the real values.
|
||||
FontBBox and Italic Angle can be found in the human-readable part of the PFB file.
|
||||
The PFMReader tool does not yet interpret PFB files, so if you want to be correct,
|
||||
you may have to adjust the values in the XML file manually. The constructed values
|
||||
however appear to have no visible influence.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block id="sec1-2"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt" >
|
||||
Register the fonts within FOP
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
Edit conf/userconfig.xml and add entries for the font if the fonts section, ie:
|
||||
<fo:block font-family="Courier" font-size="10pt"
|
||||
space-before.optimum="6pt"
|
||||
white-space-collapse="false" margin-left="6pt" text-align="start">
|
||||
<![CDATA[
|
||||
<font metrics-file="cyberbit.xml" kerning="yes" embed-file="C:\WINNT\Fonts\Cyberbit.ttf">
|
||||
<font-triplet name="Cyberbit" style="normal" weight="normal">
|
||||
</font>]]></fo:block>
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block id="sec2"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
font-size="14pt"
|
||||
color="#0050B2"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Adding additional TrueType fonts
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
Adding Truetype fonts is almost identical to the process of adding type 1 fonts.
|
||||
The main difference is in the first step.
|
||||
</fo:block>
|
||||
|
||||
<fo:block id="sec2-1"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt" >
|
||||
Generating a font metrics file
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
As mentioned above you need an XML file containing font metrics to be able to use
|
||||
an additional font. FOP contains a tool that can generate such a font metrics file
|
||||
from your truetype font file.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
Create metrics for the fontfile. We'll use MS Gothic as an example:
|
||||
|
||||
<fo:block font-family="Courier" font-size="10pt"
|
||||
space-before.optimum="6pt" space-after.optimum="6pt" margin-left="6pt" text-align="start">
|
||||
java org.apache.fop.fonts.apps.TTFReader C:\WINNT\Fonts\msgothic.ttf msgothic.xml
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
|
||||
<fo:block id="sec2-2"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt" >
|
||||
TrueType collections
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
TrueType collections (.ttc files) contains more than one font. To create metrics
|
||||
for a ttc file you must specify the font in the collection with the -ttcname
|
||||
option to TTFReader.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
To get a list of the fonts in a collection, just start the TTFReader as if it
|
||||
were a normal truetype file (without the -ttcname option). It will then display
|
||||
all the font names and exit with an Exception.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
Example on generating metrics for a .ttc file:
|
||||
<fo:block font-family="Courier" font-size="10pt"
|
||||
space-before.optimum="6pt" space-after.optimum="6pt" margin-left="6pt" text-align="start">
|
||||
java org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho" msmincho.ttc msminch.xml
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
|
||||
<fo:block id="sec2-3"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt" >
|
||||
Register the fonts within FOP
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
Same as for <fo:basic-link internal-destination="sec1-2" color="blue">
|
||||
<fo:inline text-decoration="underline">Type 1 fonts</fo:inline></fo:basic-link>.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block id="sec3"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
font-size="14pt"
|
||||
color="#0050B2"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Embedding fonts
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
Font embedding is enabled in the userconfig.xml file. Start Fop with -c userconfig.xml
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block id="sec4"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
font-size="14pt"
|
||||
color="#0050B2"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Example embedding MSGothic
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
This example will use the Microsoft Gothic TrueType font. This is the font used to render this examples
|
||||
given in the last section of this file. If you don't have it installed,
|
||||
you can download an installer at <fo:basic-link color="blue"
|
||||
external-destination="ftp://ftp.cc.monash.edu.au/pub/nihongo/ie3lpkja.exe">
|
||||
<fo:inline text-decoration="underline">ftp://ftp.cc.monash.edu.au/pub/nihongo/ie3lpkja.exe</fo:inline>
|
||||
</fo:basic-link>.
|
||||
</fo:block>
|
||||
|
||||
<fo:block id="sec4-1"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Setup your classpath to run FOP:
|
||||
</fo:block>
|
||||
<fo:block font-family="Courier" font-size="10pt"
|
||||
space-before.optimum="6pt"
|
||||
white-space-collapse="false" margin-left="6pt" text-align="start">
|
||||
C:\Fop-0.18.1> set CLASSPATH=fop.jar;lib\xerces-1.2.3.jar;lib\xalan-2.0.0.jar;lib\batik.jar
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block id="sec4-2"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Create the metrics file:
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-family="Courier" font-size="10pt"
|
||||
space-before.optimum="6pt"
|
||||
white-space-collapse="false" margin-left="6pt" text-align="start">
|
||||
C:\Fop-0.18.1> java org.apache.fop.fonts.apps.TTFReader c:\WINNT\Fonts\msgothic.ttf msgothic.xml
|
||||
TTF Reader v1.1.1
|
||||
|
||||
Reading /home/camk/cjkv/msgothic.ttf...
|
||||
|
||||
Number of glyphs in font: 13104
|
||||
Postscript format 3
|
||||
Creating xml font file...
|
||||
|
||||
Creating CID encoded metrics
|
||||
Writing xml font file msgothic.xml...
|
||||
|
||||
This font contains no embedding license restrictions
|
||||
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block id="sec4-3"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Edit the msgothic.xml file and set the <fo:inline font-family="Courier">font-name</fo:inline>
|
||||
to "MSGothic".
|
||||
</fo:block>
|
||||
|
||||
<fo:block id="sec4-4"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Edit conf/userconfig.xml and add the following to the <fonts> section:
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-family="Courier" font-size="10pt"
|
||||
space-before.optimum="6pt"
|
||||
white-space-collapse="false" margin-left="6pt" text-align="start">
|
||||
<![CDATA[
|
||||
<font metrics-file="msgothic.xml" kerning="yes"
|
||||
embed-file="C:\WINNT\Fonts\msgothic.ttf">
|
||||
<font-triplet name="MSGothic" style="normal" weight="normal"/>
|
||||
</font>
|
||||
]]>
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="6pt">
|
||||
Now you can use MSGothic in your .fo files by setting font-family="MSGothic". You'll need to
|
||||
start FOP specifying the config file as in this example:
|
||||
<fo:block font-family="Courier" font-size="10pt"
|
||||
space-before.optimum="6pt"
|
||||
white-space-collapse="false" margin-left="6pt" text-align="start"
|
||||
>java -jar fop.jar -c conf/userconfig.xml -fo myfo.fo -pdf mypdf.pdf</fo:block>
|
||||
</fo:block>
|
||||
|
||||
<fo:block id="sec5"
|
||||
font-family="Helvetica"
|
||||
font-weight="bold"
|
||||
font-size="14pt"
|
||||
color="#0050B2"
|
||||
space-after.optimum="6pt"
|
||||
space-before.optimum="12pt">
|
||||
Examples from <fo:basic-link color="blue" external-destination="http://www.csse.monash.edu.au/~jwb/j_jmdict.html">
|
||||
<fo:inline text-decoration="underline">JMDict</fo:inline></fo:basic-link> Japanese glossary:
|
||||
</fo:block>
|
||||
|
||||
</fo:wrapper>
|
||||
<fo:table table-layout="fixed" width="100%">
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-header>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-weight="bold" font-family="Helvetica">Japanese (kanji or kanadzukai)</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block font-weight="bold" font-family="Helvetica">English</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block font-weight="bold" font-family="Helvetica">German</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-header>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">うん</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>"yeah" or "uh huh"</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">アウタースペース</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>outer space</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">スペースクラフト</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>spacecraft</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">スペースシャトル</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>space shuttle</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">著わす</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>"to write", "to publish"</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>veröffentlichen</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">電子出版</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>electronic publishing</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">五輪</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>the Olympics</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>Olympische Spiele</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">空港</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>airport</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>Flughafen</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">チューリッヒ</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>Zurich</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>Zürich</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">コロラド</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>Colorado</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block font-family="MSGothic">コロラドスプリングス</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>Colorado Springs</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
</fo:flow>
|
||||
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
561
apache_fop/fop/examples/fo/advanced/cid-fonts.pdf
Normal file
1258
apache_fop/fop/examples/fo/advanced/giro.fo
Normal file
126
apache_fop/fop/examples/fo/advanced/rounded-corners.fo
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<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="main" page-width="21cm" page-height="29.7cm" margin-top="5mm">
|
||||
<fo:region-body margin-bottom="30pt" margin-right="60pt" margin-left="60pt" margin-top="30pt"/>
|
||||
<fo:region-after extent="4in"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="main">
|
||||
<fo:flow flow-name="xsl-region-body" font-size="12pt">
|
||||
<fo:block font-size="14pt" font-weight="bold">
|
||||
Examples using Rounded Corners
|
||||
</fo:block>
|
||||
<fo:block margin="20pt 0 40pt 0">
|
||||
<fo:block>The "border-radius" property in the http://xmlgraphics.apache.org/fop/extensions namespace is a shorthand property for setting appropriate values for "border-*-radius" (see below), and is used to specify round corners on block areas. The property takes one or two values:
|
||||
</fo:block>
|
||||
<fo:block-container margin="10 20pt 20pt 20pt">
|
||||
<fo:block border-style="solid" border-width="10" border-color="#00f" fox:border-radius="20pt" padding="20pt" text-align="center" margin-bottom="10pt"> Circular corners are specified when 'border-radius' is set to a single value. This value is the radius of the outer quadrant of the corner.</fo:block>
|
||||
<fo:block border-style="solid" border-width="10" border-color="#00f" fox:border-radius="20pt 40pt" padding="20pt" text-align="center" margin-bottom="10pt">Quarter-ellipse corners can be generated by setting two values for the property. The first value is the radius in the Inline Progression Direction. The second value is the radius in the Block Progression Direction.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
<fo:block margin="20pt 0 40pt 0">
|
||||
<fo:block>The radii for a specific corner can be specified for each <fo:inline font-style="italic">CORNER</fo:inline> (in 'before-start', 'before-end', 'after-start', 'after-end') with the property "border-<fo:inline font-style="italic">CORNER</fo:inline>-radius". These properties
|
||||
have the same interpretation as the "border-radius" property. </fo:block>
|
||||
<fo:table border-collapse="separate" margin-top="10pt">
|
||||
<fo:table-column column-width="200pt"/>
|
||||
<fo:table-column column-width="200pt"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell>
|
||||
<fo:block margin-left="50pt" border-style="solid" border-width="50pt 0 0 50pt" border-color="#00f" fox:border-before-start-radius="100pt" height="100pt">
|
||||
<fo:block padding="50pt"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block margin-left="50pt" border-style="solid" border-width="50pt 0 0 50pt" border-color="#00f" fox:border-before-start-radius="200pt 100pt" height="100pt">
|
||||
<fo:block padding="50pt"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:block>
|
||||
<fo:block margin="20pt">
|
||||
<fo:block border-style="solid" background-color="#aaf" border-width="10" border-color="#00f" fox:border-radius="50pt" padding="20pt" text-align="center" margin-bottom="20pt">Backgrounds are cropped…</fo:block>
|
||||
<fo:block break-after="page" border-style="solid" background-color="#aaf" border-width="0" border-color="#00f" fox:border-radius="50pt" padding="20pt" text-align="center" margin-bottom="20pt">…even with zero width borders.</fo:block>
|
||||
</fo:block>
|
||||
<fo:block>There are two canonical cases for rounded corners distinguished by the following condition: The width of each border segment is less than the corner radius perpendicular to that segment. This is demonstrated in Case <fo:inline font-style="italic">I</fo:inline> when this condition is <fo:inline font-style="italic">true</fo:inline> and Case <fo:inline font-style="italic">II</fo:inline> when <fo:inline font-style="italic">false</fo:inline>.</fo:block>
|
||||
<fo:table border-collapse="separate" margin-bottom="25pt">
|
||||
<fo:table-column column-width="200pt"/>
|
||||
<fo:table-column column-width="200pt"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell height="100pt">
|
||||
<fo:block margin-left="50pt" border-style="solid" border-width="70pt 0 0 70pt" border-color="#00f" fox:border-before-start-radius="100pt" height="100pt">
|
||||
<fo:block padding="50pt" text-align="center">
|
||||
<fo:inline font-style="italic">I</fo:inline>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell height="100pt">
|
||||
<fo:block margin-left="50pt" border-style="solid" border-width="70pt 0 0 70pt" border-color="#00f" fox:border-before-start-radius="50pt" height="100pt">
|
||||
<fo:block padding="50pt" text-align="center">
|
||||
<fo:inline font-style="italic">II</fo:inline>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<fo:table border-collapse="separate" margin="40pt 0 20pt 0" break-after="page">
|
||||
<fo:table-column column-width="150pt"/>
|
||||
<fo:table-column column-width="150pt"/>
|
||||
<fo:table-column column-width="150pt"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell number-columns-spanned="3">
|
||||
<fo:block margin-bottom="20pt">The border segments join at a line that coincides with the one that intersects the inner and outer corners of the equivalent rectangular corner. This is clearly demonstrated below where rounded borders are overlayed on top of rectangular borders.</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="50pt" height="100pt">
|
||||
<fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="50pt" border-before-width="50pt" border-start-width="50pt" height="100pt">
|
||||
<fo:block margin-bottom="100pt"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="50pt" height="100pt">
|
||||
<fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="100pt" border-before-width="50pt" border-start-width="50pt" height="100pt">
|
||||
<fo:block margin-bottom="100pt"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="50pt" height="100pt">
|
||||
<fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="150pt 100pt" border-before-width="50pt" border-start-width="50pt" height="100pt">
|
||||
<fo:block margin-bottom="100pt"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="100pt" height="100pt">
|
||||
<fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="50pt" border-before-width="50pt" border-start-width="100pt" height="100pt">
|
||||
<fo:block margin-bottom="100pt"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="100pt" height="100pt">
|
||||
<fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="100pt" border-before-width="50pt" border-start-width="100pt" height="100pt">
|
||||
<fo:block margin-bottom="100pt"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell border-style="solid" border-width="0" border-before-color="#afa" border-start-color="#aaf" border-before-width="50pt" border-start-width="100pt" height="100pt">
|
||||
<fo:block margin-top="-50pt" border-style="solid" border-width="0" border-before-color="#0f0" border-start-color="#00f" fox:border-before-start-radius="150pt 100pt" border-before-width="50pt" border-start-width="100pt" height="100pt">
|
||||
<fo:block margin-bottom="100pt"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<fo:block margin="20pt 0 40pt 0">
|
||||
<fo:block> </fo:block>
|
||||
<fo:block-container margin="10 20pt 20pt 20pt">
|
||||
<fo:block border-style="solid" border-width="10" border-color="#00f" fox:border-radius="2000pt" padding="20pt" text-align="center" margin-bottom="10pt">If border radii are specified that would produce overlapping curves (as is the case for the block containg <fo:inline font-style="italic">this</fo:inline> text), then all border radii are proportionally reduced until none of them overlap. This is in accordance to the procedure described at http://www.w3.org/TR/css3-background/#corner-overlap.</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
207
apache_fop/fop/examples/fo/basic/alignment.fo
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="one">
|
||||
<fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="20pt" margin-right="20pt" />
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="one">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block><fo:inline font-weight="bold">Ex 1:</fo:inline> This
|
||||
is a longer line of text that provides a context for the line with the images aligned on it.
|
||||
This is a line with before-edge
|
||||
<fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="50">
|
||||
<svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="47" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 42l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="40">
|
||||
<svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="40" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, middle<fo:instream-foreign-object vertical-align="middle">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="3" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, and no<fo:instream-foreign-object>
|
||||
<svg:svg width="25" height="40">
|
||||
<svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="40" style="stroke:black;stroke-width:1.5"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object> alignment.
|
||||
And this is the line of text that follows the line with the aligned objects on it.
|
||||
And finally, this line illustrates the normal spacing between lines of text in this font.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block>
|
||||
|
||||
<fo:block><fo:inline font-weight="bold">Ex 2:</fo:inline> This
|
||||
is a longer line of text that provides a context for the line with the images aligned on it.
|
||||
This is a line with before-edge
|
||||
<fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="50">
|
||||
<svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="47" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 42l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="40">
|
||||
<svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="40" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, middle<fo:instream-foreign-object vertical-align="middle">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="3" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object> alignment.
|
||||
And this is the line of text that follows the line with the aligned objects on it.
|
||||
And finally, this line illustrates the normal spacing between lines of text in this font.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block>
|
||||
|
||||
<fo:block><fo:inline font-weight="bold">Ex 3:</fo:inline> This
|
||||
is a longer line of text that provides a context for the line with the images aligned on it.
|
||||
This is a line with before-edge
|
||||
<fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="50">
|
||||
<svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="47" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 42l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="40">
|
||||
<svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="40" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object> alignment.
|
||||
And this is the line of text that follows the line with the aligned objects on it.
|
||||
And finally, this line illustrates the normal spacing between lines of text in this font.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block>
|
||||
|
||||
<fo:block><fo:inline font-weight="bold">Ex 4:</fo:inline> This
|
||||
is a longer line of text that provides a context for the line with the images aligned on it.
|
||||
This is a line with before-edge
|
||||
<fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="40">
|
||||
<svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="37" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 32l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="50">
|
||||
<svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="50" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object> alignment.
|
||||
And this is the line of text that follows the line with the aligned objects on it.
|
||||
And finally, this line illustrates the normal spacing between lines of text in this font.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block>
|
||||
|
||||
<fo:block><fo:inline font-weight="bold">Ex 5:</fo:inline> This
|
||||
is a longer line of text that provides a context for the line with the images aligned on it.
|
||||
This is a line with before-edge
|
||||
<fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="top">
|
||||
<svg:svg width="25" height="40">
|
||||
<svg:rect x="0" y="0" width="25" height="40" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="0" x2="12.5" y2="37" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 32l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, after-edge<fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="25" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object><fo:instream-foreign-object vertical-align="bottom">
|
||||
<svg:svg width="25" height="50">
|
||||
<svg:rect x="0" y="0" width="25" height="50" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="2" x2="12.5" y2="50" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>, middle<fo:instream-foreign-object vertical-align="middle">
|
||||
<svg:svg width="25" height="25">
|
||||
<svg:rect x="0" y="0" width="25" height="25" style="fill:none;stroke:#000000"/>
|
||||
<svg:line x1="12.5" y1="3" x2="12.5" y2="22" style="stroke:black;stroke-width:1.5"/>
|
||||
<svg:path d="M5 17l7.5 8l7.5 -8z" style="fill:black"/>
|
||||
<svg:path d="M5 8l7.5 -8l7.5 8z" style="fill:black"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object> alignment.
|
||||
And this is the line of text that follows the line with the aligned objects on it.
|
||||
And finally, this line illustrates the normal spacing between lines of text in this font.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after="15pt"><fo:leader leader-pattern="rule"/></fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
170
apache_fop/fop/examples/fo/basic/blockcontainer.fo
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="one">
|
||||
<fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="50pt" margin-right="50pt" />
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="one">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block text-align="center" font-size="16pt" font-weight="bold">
|
||||
Block Containers
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
The fo:block-container object can be used to create an area with
|
||||
a different writing mode or a different reference orientation.
|
||||
The areas can be part of the flow or absolutely positioned.
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
This is a normal block container within the flow layout.
|
||||
<fo:block-container>
|
||||
<fo:block>
|
||||
BC:A
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
This block container has a different reference orientation.
|
||||
<fo:block-container reference-orientation="90" inline-progression-dimension="100pt">
|
||||
<fo:block>
|
||||
BC:B
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
The areas are stacked normally but the orientation of the
|
||||
area is rotated 90 degrees anti-clockwise.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
The blocks continue until exhausted as the layout
|
||||
height of this container is fixed in the parent
|
||||
block progression dimension. The clipping of the result
|
||||
is determined by the overflow property. The block
|
||||
progression dimension of this container is effectively
|
||||
infinite.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
This block container has a different reference orientation.
|
||||
<fo:block-container reference-orientation="270" inline-progression-dimension="100pt">
|
||||
<fo:block>
|
||||
BC:B II
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
The areas are stacked normally but the orientation of the
|
||||
area is rotated 90 degrees clockwise.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
The blocks continue until exhausted as the layout
|
||||
height of this container is fixed in the parent
|
||||
block progression dimension. The clipping of the result
|
||||
is determined by the overflow property.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
This block container has a different reference orientation.
|
||||
<fo:block-container reference-orientation="180" inline-progression-dimension="100pt">
|
||||
<fo:block>
|
||||
BC:B III
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
The areas are stacked normally but the orientation of the
|
||||
area is rotated 180 degrees clockwise.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
This block container behaves as part of the flow except
|
||||
the contents are drawn rotated within the viewport by
|
||||
180 degrees.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
different writing mode
|
||||
<fo:block-container writing-mode="rl">
|
||||
<fo:block>
|
||||
BC:C
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
The areas in this block are stacked according to the rl (tb)
|
||||
writing mode.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
The next block-container has an absolute position. It does
|
||||
not affect the flow layout of other blocks.
|
||||
<fo:block-container absolute-position="absolute"
|
||||
left="20pt" top="400pt" right="220pt" bottom="550pt">
|
||||
<fo:block>
|
||||
BC:D
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
This is a normal block that is confined to the
|
||||
block container.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
The next block-container has an absolute position. It does
|
||||
not affect the flow layout of other blocks. This time with
|
||||
the reference-orientation set.
|
||||
<fo:block-container reference-orientation="270" absolute-position="absolute"
|
||||
left="400pt" top="370pt" right="500pt" bottom="270pt">
|
||||
<fo:block>
|
||||
BC:E
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
This is a normal block that is confined to the
|
||||
block container.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
<fo:block break-after="page">
|
||||
End of page.
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
The next block-container tests the clipping.
|
||||
<fo:block-container reference-orientation="180" absolute-position="absolute"
|
||||
right="100pt" bottom="550pt" left="200pt" top="700pt"
|
||||
overflow="hidden">
|
||||
<fo:block>
|
||||
BC:F
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
This is a normal block that is confined to the
|
||||
block container. It also has contents that are
|
||||
larger than the block-container so that this text
|
||||
will be clipped to the viewport.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
The next block-container tests error-if-overflow.
|
||||
<fo:block-container reference-orientation="90" absolute-position="absolute"
|
||||
bottom="220pt" left="600pt" top="320pt" right="700pt"
|
||||
overflow="error-if-overflow">
|
||||
<fo:block>
|
||||
BC:G
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
This is a normal block that is confined to the
|
||||
block container. It also has contents that are
|
||||
larger than the block-container so that this text
|
||||
will be clipped to the viewport.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
199
apache_fop/fop/examples/fo/basic/border.fo
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="first"
|
||||
margin-right="0.5cm"
|
||||
margin-left="0.5cm"
|
||||
margin-bottom="0.5cm"
|
||||
margin-top="0.75cm"
|
||||
page-width="21cm"
|
||||
page-height="29.7cm">
|
||||
<fo:region-body></fo:region-body>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:simple-page-master master-name="rest"
|
||||
margin-right="2.5cm"
|
||||
margin-left="2.5cm"
|
||||
margin-bottom="2cm"
|
||||
margin-top="1cm"
|
||||
page-width="21cm"
|
||||
page-height="29.7cm">
|
||||
<fo:region-body></fo:region-body>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="psmA">
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="first"
|
||||
page-position="first" />
|
||||
<fo:conditional-page-master-reference master-reference="rest"
|
||||
page-position="rest" />
|
||||
<!-- recommended fallback procedure -->
|
||||
<fo:conditional-page-master-reference master-reference="rest" />
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="psmA">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block-container height="4cm" width="12cm" top="0cm" left="0cm" position="absolute">
|
||||
<fo:block text-align="start" line-height="18pt" font-family="sans-serif" font-weight="bold" font-size="14pt">
|
||||
PX7.net
|
||||
</fo:block>
|
||||
<fo:block text-align="start" line-height="18pt" font-family="sans-serif" font-weight="bold" font-size="14pt">
|
||||
44 Liberty St
|
||||
</fo:block>
|
||||
<fo:block text-align="start" line-height="18pt" font-family="sans-serif" font-weight="bold" font-size="14pt">
|
||||
Newburyport, MA 01950
|
||||
</fo:block>
|
||||
<fo:block text-align="start" line-height="18pt" font-family="sans-serif" font-weight="bold" font-size="14pt">
|
||||
978-462-1152
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container height="1cm" width="6cm" top="0cm" left="14cm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="22pt" font-family="sans-serif" font-size="23pt">
|
||||
Sales Receipt
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="2.49cm" top="1.2cm" left="13.8cm" padding=".6mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt">
|
||||
DATE
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="2.49cm" top="1.87cm" left="13.8cm" padding=".6mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="10pt">
|
||||
01/01/2000
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="2.49cm" top="1.2cm" left="16.46cm" padding=".6mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt">
|
||||
SALE #
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="2.49cm" top="1.87cm" left="16.46cm" padding=".6mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="10pt">
|
||||
1
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
|
||||
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="8.95cm" top="3cm" left="0cm" padding=".6mm" position="absolute">
|
||||
<fo:block text-align="start" line-height="14pt" font-family="sans-serif" font-size="12pt">
|
||||
SOLD TO
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="3cm" width="8.95cm" top="3.67cm" left="0cm" padding=".6mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt">
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="8.95cm" top="3cm" left="10cm" padding=".6mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt">
|
||||
SHIP TO
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="3cm" width="8.95cm" top="3.67cm" left="10cm" padding=".6mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt">
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
|
||||
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="3.96cm" top="7.25cm" left="10.74cm" padding="1mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt">
|
||||
PMT METHOD
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="3.96cm" top="8cm" left="10.74cm" padding="1mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="10pt">
|
||||
Check
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="3.96cm" top="7.25cm" left="14.95cm" padding="1mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="12pt">
|
||||
CHECK #
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width=".5mm" height="0.5cm" width="3.96cm" top="8cm" left="14.95cm" padding="1mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="14pt" font-family="sans-serif" font-size="10pt">
|
||||
1234
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
|
||||
|
||||
<fo:block-container height="17cm" width="19cm" top="9.4cm" left="0cm" position="absolute">
|
||||
<fo:table border-collapse="separate" height="17cm" border-color="yellow" border-style="solid" border-width=".6mm" table-layout="fixed" width="100%">
|
||||
<fo:table-column column-width="2.5cm"/>
|
||||
<fo:table-column column-width="11.5cm"/>
|
||||
<fo:table-column column-width="2.5cm"/>
|
||||
<fo:table-column column-width="2.5cm"/>
|
||||
<fo:table-body font-family="sans-serif" font-weight="normal" font-size="10pt">
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell border-width="1pt" border-color="green" border-style="solid" padding="1mm">
|
||||
<fo:block text-align="end">QUANTITY</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell border-width="1pt" border-color="red" border-style="solid" padding="1mm">
|
||||
<fo:block text-align="start">DESCRIPTION</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell border-color="blue" border-style="solid" padding="1mm">
|
||||
<fo:block text-align="center">RATE</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell border-color="orange" border-style="solid" padding="1mm">
|
||||
<fo:block text-align="center">AMOUNT</fo:block>
|
||||
</fo:table-cell>
|
||||
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">1</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="start">Wide Widget</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">$22.23</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">22.31</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">1</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="start">Widget</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">$22.23</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">22.31</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">3</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="start">Nuts</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">$12.00</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell padding="2pt">
|
||||
<fo:block text-align="end">36.00</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width="0.5mm" height="1cm" width="13.31cm" top="26.5cm" left="0cm" padding="1mm" position="absolute">
|
||||
<fo:block text-align="start" line-height="15pt" font-family="sans-serif" font-size="12pt">Please remit to the above address</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width="0.5mm" height="1cm" width="2.5cm" top="26.5cm" left="13.56cm" padding="1mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="25pt" font-family="sans-serif" font-size="22pt">Total</fo:block>
|
||||
</fo:block-container>
|
||||
<fo:block-container border-color="black" border-style="solid" border-width="0.5mm" height="1cm" width="2.5cm" top="26.5cm" left="16.31cm" padding="1mm" position="absolute">
|
||||
<fo:block text-align="start" space-after.optimum="3pt" line-height="15pt" font-family="sans-serif" font-size="10pt">$3.00</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
160
apache_fop/fop/examples/fo/basic/bordershorthand.fo
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<!-- example for a simple fo file. At the beginning the page layout is set.
|
||||
Below fo:root there is always
|
||||
- a single fo:layout-master-set which defines one or more page layouts
|
||||
- an optional fo:declarations,
|
||||
- and a sequence of one or more fo:page-sequences containing the text and formatting instructions -->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- layout for the first page -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.0cm + 0.5cm"
|
||||
margin-right="(5cm * 1cm) div 2cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<!-- layout for the other pages -->
|
||||
<fo:simple-page-master master-name="rest"
|
||||
page-height="abs(-30cm + .3cm)"
|
||||
page-width="(10cm * 2) + 1cm"
|
||||
margin-top="round(.5) * 1cm"
|
||||
margin-bottom="round(2.4) * 1cm"
|
||||
margin-left="2.5 * 1cm"
|
||||
margin-right="5.5cm - 3cm">
|
||||
<fo:region-body margin-top="2.5cm"/>
|
||||
<fo:region-before extent="2.5cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="basicPSM" >
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="first"
|
||||
page-position="first" />
|
||||
<fo:conditional-page-master-reference master-reference="rest"
|
||||
page-position="rest" />
|
||||
<!-- recommended fallback procedure -->
|
||||
<fo:conditional-page-master-reference master-reference="rest" />
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="basicPSM">
|
||||
|
||||
<!-- header -->
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block text-align="end"
|
||||
font-size="10pt"
|
||||
font-family="serif"
|
||||
line-height="1em + 4pt"
|
||||
>
|
||||
Border and Padding Shorthand Tests - p. <fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- defines text title level 1-->
|
||||
<fo:block font-size="min(18pt,20pt)"
|
||||
font-family="sans-serif"
|
||||
line-height="max(24pt,18pt)"
|
||||
space-after.optimum="5 mod 3 * 7.5pt"
|
||||
background-color="rgb(128,128,128)"
|
||||
color="rgb(255,255,255)"
|
||||
text-align="center"
|
||||
padding-top="3pt">
|
||||
Border and Padding Shorthand Tests
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-after="12pt"
|
||||
text-align="start"
|
||||
background-color="rgb(150,150,150)"
|
||||
start-indent="3mm" end-indent="3mm"
|
||||
padding-left="3mm" padding-right="3mm"
|
||||
padding-top="4mm" padding-bottom="4mm"
|
||||
border-style="dashed"
|
||||
border-left-width="1pt" border-right-width="1pt"
|
||||
border-top-width="2pt" border-bottom-width="2pt"
|
||||
border-top-color="rgb(100,100,100)" border-bottom-color="rgb(200,200,200)">
|
||||
In this example, padding and border properties are specified using absolute properties:
|
||||
padding-left, padding-right, padding-top, and padding-bottom, etc.
|
||||
According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-after="12pt"
|
||||
text-align="start"
|
||||
background-color="rgb(150,150,150)"
|
||||
start-indent="3mm" end-indent="3mm"
|
||||
padding="3mm + 1mm 3mm"
|
||||
border-top="rgb(100,100,100) 1pt + 1pt dashed"
|
||||
border-bottom="2pt rgb(200,200,200) solid"
|
||||
border-left="solid 1pt" border-right="solid 1pt">
|
||||
In this example, padding and border properties are specified using shorthand properties:
|
||||
padding, border-width, border-color.
|
||||
According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-after="3pt"
|
||||
text-align="start"
|
||||
background-color="rgb(150,150,150)"
|
||||
start-indent="3mm" end-indent="3mm"
|
||||
padding-before="4mm" padding-after="4mm"
|
||||
padding-start.length="3mm" padding-end.length="3mm"
|
||||
border-style="solid"
|
||||
border-start-width="1pt" border-end-width="1pt"
|
||||
border-before-width="2pt" border-after-width="2pt"
|
||||
border-before-color="rgb(100,100,100)"
|
||||
border-after-color="rgb(200,200,200)">
|
||||
In this example, padding and border properties are specified using writing-mode relative properties:
|
||||
padding-before, padding-after, padding-start, and padding-end, etc.
|
||||
According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-after="3pt"
|
||||
text-align="start"
|
||||
background-color="rgb(200,200,200)"
|
||||
start-indent="3mm" end-indent="3mm"
|
||||
padding = "3mm"
|
||||
padding-before="4mm" padding-after="4mm"
|
||||
border-width = "2pt" border-style="solid"
|
||||
border-color="black"
|
||||
border-start-width="1pt" border-end-width="1pt"
|
||||
border-before-width="2pt" border-after-width="2pt"
|
||||
border-before-color="rgb(200,200,200)"
|
||||
border-after-color="rgb(100,100,100)">
|
||||
In this example, padding and border properties are specified using
|
||||
shorthand and writing-mode relative properties:
|
||||
padding-before, padding-after, padding-start, and padding-end, etc.
|
||||
According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
105
apache_fop/fop/examples/fo/basic/character.fo
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!-- example for a simple fo file. At the beginning the page layout is set.
|
||||
Below fo:root there is always
|
||||
- a single fo:layout-master-set which defines one or more page layouts
|
||||
- an optional fo:declarations
|
||||
- and a sequence of one or more fo:page-sequences containing the text and formatting instructions
|
||||
-->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
<!-- fo:layout-master-set defines in its children the page layout:
|
||||
the pagination and layout specifications
|
||||
- page-masters: have the role of describing the intended subdivisions
|
||||
of a page and the geometry of these subdivisions
|
||||
In this case there is only a simple-page-master which defines the
|
||||
layout for all pages of the text
|
||||
-->
|
||||
<!-- layout information -->
|
||||
<fo:simple-page-master master-name="simple"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
|
||||
<!-- start page-sequence
|
||||
here comes the text (contained in flow objects)
|
||||
the page-sequence can contain different fo:flows
|
||||
the attribute value of master-name refers to the page layout
|
||||
which is to be used to layout the text contained in this
|
||||
page-sequence-->
|
||||
<fo:page-sequence master-reference="simple">
|
||||
|
||||
<!-- start fo:flow
|
||||
each flow is targeted
|
||||
at one (and only one) of the following:
|
||||
xsl-region-body (usually: normal text)
|
||||
xsl-region-before (usually: header)
|
||||
xsl-region-after (usually: footer)
|
||||
xsl-region-start (usually: left margin)
|
||||
xsl-region-end (usually: right margin)
|
||||
['usually' applies here to languages with left-right and top-down
|
||||
writing direction like English]
|
||||
in this case there is only one target: xsl-region-body
|
||||
-->
|
||||
<fo:flow flow-name="xsl-region-body"
|
||||
text-align="justify">
|
||||
|
||||
<!-- each paragraph is encapsulated in a block element
|
||||
the attributes of the block define
|
||||
font-family and size, line-heigth etc. -->
|
||||
|
||||
|
||||
<!-- this defines normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
>
|
||||
1. Why <fo:character character="T" font-size="16pt" color="red"/><fo:character character="E" font-size="16pt" color="blue"/><fo:character character="I" font-size="16pt" color="green"/>? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too.
|
||||
Why T<fo:character character="E"/>I? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. <fo:character character="Y"/>ou should use it too.
|
||||
</fo:block>
|
||||
|
||||
<!-- this defines normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
>
|
||||
1. Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too.
|
||||
Why TEI? I know, you know, I know (Paul Grice). Using TEI is quite a challenge. ou should use it too.
|
||||
</fo:block>
|
||||
|
||||
<!-- this defines normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
>
|
||||
1. Why TEI? Using <fo:inline text-decoration="underline">TEI</fo:inline> is quite a challenge. <fo:character character="Y" font-size="16pt" />ou should use it too.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow> <!-- closes the flow element-->
|
||||
</fo:page-sequence> <!-- closes the page-sequence -->
|
||||
</fo:root>
|
||||
228
apache_fop/fop/examples/fo/basic/corresprop.fo
Normal file
|
|
@ -0,0 +1,228 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<!-- example for a simple fo file. At the beginning the page layout is set.
|
||||
Below fo:root there is always
|
||||
- a single fo:layout-master-set which defines one or more page layouts
|
||||
- an optional fo:declarations,
|
||||
- and a sequence of one or more fo:page-sequences containing the text and formatting instructions -->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- layout for the first page -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.0cm + 0.5cm"
|
||||
margin-right="(5cm * 1cm) div 2cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<!-- layout for the other pages -->
|
||||
<fo:simple-page-master master-name="rest"
|
||||
page-height="abs(-30cm + .3cm)"
|
||||
page-width="(10cm * 2) + 1cm"
|
||||
margin-top="round(.5) * 1cm"
|
||||
margin-bottom="round(2.4) * 1cm"
|
||||
margin-left="2.5 * 1cm"
|
||||
margin-right="5.5cm - 3cm">
|
||||
<fo:region-body margin-top="2.5cm"/>
|
||||
<fo:region-before extent="2.5cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="basicPSM" >
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="first"
|
||||
page-position="first" />
|
||||
<fo:conditional-page-master-reference master-reference="rest"
|
||||
page-position="rest" />
|
||||
<!-- recommended fallback procedure -->
|
||||
<fo:conditional-page-master-reference master-reference="rest" />
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="basicPSM">
|
||||
|
||||
<!-- header -->
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block text-align="end"
|
||||
font-size="10pt"
|
||||
font-family="serif"
|
||||
line-height="1em + 4pt" >
|
||||
Corresponding Property Tests - p. <fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- defines text title level 1-->
|
||||
<fo:block font-size="min(18pt,20pt)"
|
||||
font-family="sans-serif"
|
||||
line-height="max(24pt,18pt)"
|
||||
space-after.optimum="5 mod 3 * 7.5pt"
|
||||
background-color="rgb(0,0,255)"
|
||||
color="rgb(255,255,255)"
|
||||
text-align="center"
|
||||
padding-top="3pt">
|
||||
Corresponding Property Tests
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-after="12pt"
|
||||
text-align="start"
|
||||
background-color="rgb(200,200,200)"
|
||||
start-indent="3mm" end-indent="3mm"
|
||||
padding-left="3mm" padding-right="3mm"
|
||||
padding-top="4mm" padding-bottom="4mm"
|
||||
border-left-width="1pt" border-right-width="1pt"
|
||||
border-top-width="2pt" border-bottom-width="2pt"
|
||||
border-top-color="red" border-bottom-color="blue">
|
||||
In this example, padding and border properties are specified using absolute properties:
|
||||
padding-left, padding-right, padding-top, and padding-bottom, etc.
|
||||
According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-after="3pt"
|
||||
text-align="start"
|
||||
background-color="rgb(200,200,200)"
|
||||
start-indent="3mm" end-indent="3mm"
|
||||
padding-before="4mm" padding-after="4mm"
|
||||
padding-start.length="3mm" padding-end.length="3mm"
|
||||
border-start-width="1pt" border-end-width="1pt"
|
||||
border-before-width="2pt" border-after-width="2pt"
|
||||
border-before-color="red" border-after-color="blue">
|
||||
In this example, padding and border properties are specified using writing-mode relative properties:
|
||||
padding-before, padding-after, padding-start, and padding-end, etc.
|
||||
According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="start"
|
||||
start-indent="1cm">
|
||||
This block has a start-indent of 1cm and no borders or padding. It has
|
||||
no margin-left set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="start"
|
||||
margin-left="1cm">
|
||||
This block has a margin-left of 1cm and no borders or padding. It has
|
||||
no start-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="start"
|
||||
start-indent="1cm"
|
||||
padding-left="4mm" border-left-width="1mm">
|
||||
This block has a start-indent of 1cm, padding-left of 4mm and border-left-width of 1mm. It has
|
||||
no margin-left set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="start"
|
||||
margin-left="5mm"
|
||||
padding-left="4mm" border-left-width="1mm">
|
||||
This block has a margin-left of 5mm, padding-left of 4mm and border-left-width of 1mm. (Margin is outside the border rectangle.) It has
|
||||
no start-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
|
||||
<!-- defines text title level 1-->
|
||||
<fo:block font-size="14pt"
|
||||
font-family="serif"
|
||||
font-weight="bold"
|
||||
line-height="16pt"
|
||||
space-after="6pt"
|
||||
text-align="center"
|
||||
break-before="page">
|
||||
End-indent tests
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="end"
|
||||
end-indent="1cm">
|
||||
This block has an end-indent of 1cm and no borders or padding. It has
|
||||
no margin-right set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="end"
|
||||
margin-right="1cm">
|
||||
This block has a margin-right of 1cm and no borders or padding. It has
|
||||
no end-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="end"
|
||||
end-indent="1cm"
|
||||
padding-end="4mm" border-end-width="1mm">
|
||||
This block has an end-indent of 1cm, padding-end of 4mm and border-end-width of 1mm. It has
|
||||
no margin-right set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="end"
|
||||
margin-right="5mm"
|
||||
padding-right="4mm" border-right-width="1mm">
|
||||
This block has a margin-right of 5mm, padding-right of 4mm and
|
||||
border-right-width of 1mm. (Margin is outside the border rectangle.) It has
|
||||
no end-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-before="12pt"
|
||||
space-after="3pt"
|
||||
text-align="end"
|
||||
margin-right="5mm"
|
||||
padding-end="4mm" border-end-width="1mm">
|
||||
This block has a margin-right of 5mm, padding-end of 4mm and
|
||||
border-end-width of 1mm. (Margin is outside the border rectangle.) It has
|
||||
no end-indent set. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text. Here is some more text to fill out the block. Here is some more text to fill out the block. Here is some more text to fill out the block.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
148
apache_fop/fop/examples/fo/basic/extensive.fo
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="one">
|
||||
<fo:region-body margin-top="50pt" margin-bottom="50pt" margin-left="100pt" margin-right="100pt"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="one">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block>A Block</fo:block>
|
||||
<fo:block text-align="end">An End Aligned Block</fo:block>
|
||||
<fo:block text-align="center">A Centered Block</fo:block>
|
||||
<fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks. Alignment is default.</fo:block>
|
||||
<fo:block text-align="end">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. Alignment is end.</fo:block>
|
||||
<fo:block text-align="center">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. Alignment is centered.</fo:block>
|
||||
<fo:block text-align="justify">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. I'm going to keep going so I can get three lines to check how all but the last justify. There, that should do it. Alignment is justified.</fo:block>
|
||||
<fo:block>A block for comparison</fo:block>
|
||||
<fo:block space-before.optimum="12pt">A block with 12pt space-before</fo:block>
|
||||
<fo:block>A block for comparison</fo:block>
|
||||
<fo:block space-after.optimum="12pt">A block with 12pt space-after</fo:block>
|
||||
<fo:block>A block for comparison</fo:block>
|
||||
<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block with both 12pt space-before and space-after</fo:block>
|
||||
<fo:block>A block for comparison</fo:block>
|
||||
<fo:block start-indent="50pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. There is a start-indent of 50pt.</fo:block>
|
||||
<fo:block end-indent="50pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. There is an end-indent of 50pt.</fo:block>
|
||||
<fo:block start-indent="50pt" end-indent="50pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. There is a start-indent and end-indent of 50pt.</fo:block>
|
||||
<fo:block font-size="15pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The font-size is set to 15pt.</fo:block>
|
||||
<fo:block line-height="20pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The line-height is set to 20pt.</fo:block>
|
||||
<fo:block font-size="15pt" line-height="20pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The font-size is set to 15pt and the line-height is set to 20pt.</fo:block>
|
||||
<fo:block font-size="15pt" line-height="15pt">This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The font-size is set to 15pt and the line-height is set to 15pt.</fo:block>
|
||||
<fo:block space-before.optimum="12pt" space-after.optimum="12pt"><fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block within a block</fo:block></fo:block>
|
||||
<fo:block space-before.optimum="12pt" space-after.optimum="12pt">Text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block within a block</fo:block>Text after</fo:block>
|
||||
<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="50pt">Text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block within a block with 50pt start-intent</fo:block>Text after</fo:block>
|
||||
<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="50pt">And again for the page break, text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block within a block with 50pt start-intent</fo:block>Text after</fo:block>
|
||||
<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="50pt">Text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A block with 50pt start-indent within a block with 50pt start-intent</fo:block>Text after</fo:block>
|
||||
<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="50pt">Text before<fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="100pt">A block with 100pt start-indent within a block with 50pt start-intent</fo:block>Text after</fo:block>
|
||||
<fo:list-block provisional-distance-between-starts="12pt" space-before.optimum="12pt" text-align="justify">
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body>
|
||||
</fo:list-item>
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</fo:list-block>
|
||||
<fo:list-block start-indent="50pt" provisional-distance-between-starts="12pt" space-before.optimum="12pt" text-align="justify">
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The list-block has a start-indent of 50pt and a text-align of justified.</fo:block></fo:list-item-body>
|
||||
</fo:list-item>
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a second multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a third multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</fo:list-block>
|
||||
<fo:list-block provisional-distance-between-starts="12pt" space-before.optimum="12pt" text-align="justify">
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block start-indent="100pt">This is a multiple line block with start-indent 100pt that extends over more than one line. There should be appropriate line breaks.</fo:block><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body>
|
||||
</fo:list-item>
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()"><fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.<fo:block>This is an embedded multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block>This is a multiple line block that extends over more than one line. There should be appropriate line breaks.</fo:block></fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</fo:list-block>
|
||||
<fo:list-block provisional-distance-between-starts="12pt" space-before.optimum="12pt">
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()"><fo:block>A block in a list-item-body</fo:block></fo:list-item-body>
|
||||
</fo:list-item>
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:list-block provisional-distance-between-starts="12pt">
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()"><fo:block>This is a list item in a list that is itself a list item</fo:block></fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</fo:list-block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</fo:list-block>
|
||||
<fo:block break-before="page" font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt">Next Stage</fo:block>
|
||||
<fo:block>Right, now we are ready to try some newly implemented things like rules. What follows is a display rule of default thickness 1pt and a space-before and space-after of 12pt.</fo:block>
|
||||
<fo:block><fo:leader leader-pattern="rule" space-before.optimum="12pt" space-after.optimum="12pt"/></fo:block>
|
||||
<fo:block>Now what follows is a leader of thickness 5pt with start-indent of 100pt (same space-before/after as before).</fo:block>
|
||||
<fo:block><fo:leader leader-pattern="rule" space-before.optimum="12pt" space-after.optimum="12pt" rule-thickness="5pt" start-indent="100pt"/></fo:block>
|
||||
<fo:block font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt"
|
||||
><fo:inline color="#500">C</fo:inline
|
||||
><fo:inline color="#700">o</fo:inline
|
||||
><fo:inline color="#900">l</fo:inline
|
||||
><fo:inline color="#B00">o</fo:inline
|
||||
><fo:inline color="#D00">u</fo:inline
|
||||
><fo:inline color="#F00">r</fo:inline
|
||||
></fo:block>
|
||||
<fo:block color="black">black</fo:block>
|
||||
<fo:block color="green">green</fo:block>
|
||||
<fo:block color="silver">silver</fo:block>
|
||||
<fo:block color="lime">lime</fo:block>
|
||||
<fo:block color="gray">gray</fo:block>
|
||||
<fo:block color="olive">olive</fo:block>
|
||||
<fo:block color="white">white</fo:block>
|
||||
<fo:block color="yellow">yellow</fo:block>
|
||||
<fo:block color="maroon">maroon</fo:block>
|
||||
<fo:block color="navy">navy</fo:block>
|
||||
<fo:block color="red">red</fo:block>
|
||||
<fo:block color="blue">blue</fo:block>
|
||||
<fo:block color="purple">purple</fo:block>
|
||||
<fo:block color="teal">teal</fo:block>
|
||||
<fo:block color="fuchsia">fuchsia</fo:block>
|
||||
<fo:block color="aqua">aqua</fo:block>
|
||||
<fo:block break-before="even-page" font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt">Wrap</fo:block>
|
||||
<fo:block space-before.optimum="12pt">This is a rather long sentence that is going to keep on going and going, not really to demonstrate anything other that normal wrapping because the following paragraph will show what happens when wrap-option is set to no-wrap.</fo:block>
|
||||
<fo:block space-before.optimum="12pt" wrap-option="no-wrap">This is a rather long sentence that is going to keep on going and going to demonstrate what happens when wrap-option is set to no-wrap which is unlike the preceding sentence where it defaults to wrap.</fo:block>
|
||||
<fo:block space-before.optimum="12pt" wrap-option="wrap">This is a rather long sentence that is going to keep on going and going, not really to demonstrate anything other that normal wrapping but it differs from the first of these three sentences in that wrap is set explicitly.</fo:block>
|
||||
<fo:block font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt">White Space Collapse</fo:block>
|
||||
<fo:block>This is default!</fo:block>
|
||||
<fo:block white-space-collapse="false">This is false!</fo:block>
|
||||
<fo:block white-space-collapse="true">This is true!</fo:block>
|
||||
<fo:block font-family="monospace"
|
||||
white-space-collapse="false"
|
||||
linefeed-treatment="preserve"
|
||||
white-space-treatment="preserve"
|
||||
wrap-option="no-wrap">
|
||||
<![CDATA[<?xml version="1.0"?>
|
||||
<document>
|
||||
<heading>This is a heading</heading>
|
||||
<list>
|
||||
<item>Item one</item>
|
||||
<item>Item two</item>
|
||||
</list>
|
||||
</document>]]>
|
||||
</fo:block>
|
||||
<fo:block break-before="page" font-size="24pt" line-height="28pt" space-before.optimum="12pt" space-after.optimum="12pt">Embedded SVG</fo:block>
|
||||
<fo:block><fo:instream-foreign-object>
|
||||
<svg:svg width="400pt" height="200pt">
|
||||
<svg:rect style="fill:none;stroke:blue" x="20pt" y="20pt" width="100pt" height="100pt"/>
|
||||
<svg:line x1="20pt" y1="20pt" x2="120pt" y2="120pt"/>
|
||||
<svg:line x1="120pt" y1="20pt" x2="20pt" y2="120pt"/>
|
||||
<svg:text x="20pt" y="150pt">Hello SVG!</svg:text>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object></fo:block>
|
||||
<fo:block>The above is an example of an SVG graphic</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
|
||||
|
||||
195
apache_fop/fop/examples/fo/basic/fonts.fo
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
<?xml version="1.0" ?>
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<!-- defines the layout master -->
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<!-- starts actual layout -->
|
||||
<fo:page-sequence master-reference="first">
|
||||
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<fo:block font-family="Helvetica" font-size="14pt">
|
||||
Helvetica
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="10pt" font-family="Helvetica">
|
||||
! " # $ % & ' ( ) *
|
||||
+ , - . / 0 1 2 3 4
|
||||
5 6 7 8 9 : ; < = >
|
||||
? @ A B C D E F G H
|
||||
I J K L M N O P Q R
|
||||
S T U V W X Y Z [ \
|
||||
] ^ _ ` a b c d e f
|
||||
g h i j k l m n o p
|
||||
q r s t u v w x y z
|
||||
{ | } ~ ¡ ¢ £ ¤ ¥ ¦
|
||||
§ ¨ © ª « ¬ ® ¯ ° ±
|
||||
² ³ ´ µ ¶ · ¸ ¹ º »
|
||||
¼ ½ ¾ ¿ À Á Â Ã Ä Å
|
||||
Æ Ç È É Ê Ë Ì Í Î Ï
|
||||
Ð Ñ Ò Ó Ô Õ Ö × Ø Ù
|
||||
Ú Û Ü Ý Þ ß à á â ã
|
||||
ä å æ ç è é ê ë ì í
|
||||
î ï ð ñ ò ó ô õ ö ÷
|
||||
ø ù ú û ü ý þ ÿ
|
||||
Œ œ Š š Ÿ
|
||||
Ž ž ƒ ˜ – — ‘
|
||||
’ ‚ “ ” „ † ‡
|
||||
• … ‰ ‹ › ™
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-family="Helvetica" font-size="14pt">
|
||||
Times Roman
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="10pt" font-family="Times Roman">
|
||||
! " # $ % & ' ( ) *
|
||||
+ , - . / 0 1 2 3 4
|
||||
5 6 7 8 9 : ; < = >
|
||||
? @ A B C D E F G H
|
||||
I J K L M N O P Q R
|
||||
S T U V W X Y Z [ \
|
||||
] ^ _ ` a b c d e f
|
||||
g h i j k l m n o p
|
||||
q r s t u v w x y z
|
||||
{ | } ~ ¡ ¢ £ ¤ ¥ ¦
|
||||
§ ¨ © ª « ¬ ® ¯ ° ±
|
||||
² ³ ´ µ ¶ · ¸ ¹ º »
|
||||
¼ ½ ¾ ¿ À Á Â Ã Ä Å
|
||||
Æ Ç È É Ê Ë Ì Í Î Ï
|
||||
Ð Ñ Ò Ó Ô Õ Ö × Ø Ù
|
||||
Ú Û Ü Ý Þ ß à á â ã
|
||||
ä å æ ç è é ê ë ì í
|
||||
î ï ð ñ ò ó ô õ ö ÷
|
||||
ø ù ú û ü ý þ ÿ Œ
|
||||
œ Š š Ÿ Ž ž ƒ
|
||||
˜ – — ‘ ’ ‚
|
||||
“ ” „ † ‡ • …
|
||||
‰ ‹ › ™
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-family="Helvetica" font-size="14pt">
|
||||
Courier
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="10pt" font-family="Courier">
|
||||
! " # $ % & ' ( ) *
|
||||
+ , - . / 0 1 2 3 4
|
||||
5 6 7 8 9 : ; < = >
|
||||
? @ A B C D E F G H
|
||||
I J K L M N O P Q R
|
||||
S T U V W X Y Z [ \
|
||||
] ^ _ ` a b c d e f
|
||||
g h i j k l m n o p
|
||||
q r s t u v w x y z
|
||||
{ | } ~ ¡ ¢ £ ¤ ¥ ¦
|
||||
§ ¨ © ª « ¬ ® ¯ ° ±
|
||||
² ³ ´ µ ¶ · ¸ ¹ º »
|
||||
¼ ½ ¾ ¿ À Á Â Ã Ä Å
|
||||
Æ Ç È É Ê Ë Ì Í Î Ï
|
||||
Ð Ñ Ò Ó Ô Õ Ö × Ø Ù
|
||||
Ú Û Ü Ý Þ ß à á â ã
|
||||
ä å æ ç è é ê ë ì í
|
||||
î ï ð ñ ò ó ô õ ö ÷
|
||||
ø ù ú û ü ý þ ÿ Œ
|
||||
œ Š š Ÿ Ž
|
||||
ž ƒ ˜ – — ‘
|
||||
’ ‚ “ ” „ † ‡
|
||||
• … ‰ ‹ › ™
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-family="Helvetica" font-size="14pt">
|
||||
ZapfDingbats:
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="10pt" font-family="ZapfDingbats">
|
||||
✁ ✂ ✃ ✄ ☎ ✆ ✇
|
||||
✈ ✉ ☛ ☞ ✌ ✍ ✎
|
||||
✏ ✐ ✑ ✒ ✓ ✔ ✕
|
||||
✖ ✗ ✘ ✙ ✚ ✛ ✜
|
||||
✝ ✞ ✟ ✠ ✡ ✢ ✣
|
||||
✤ ✥ ✦ ✧ ★ ✩ ✪
|
||||
✫ ✬ ✭ ✮ ✯ ✰ ✱
|
||||
✲ ✳ ✴ ✵ ✶ ✷ ✸
|
||||
✹ ✺ ✻ ✼ ✽ ✾ ✿
|
||||
❀ ❁ ❂ ❃ ❄ ❅ ❆
|
||||
❇ ❈ ❉ ❊ ❋ ● ❍
|
||||
■ ❏ ❐ ❑ ❒ ▲ ▼
|
||||
◆ ❖ ◗ ❘ ❙ ❚ ❛
|
||||
❜ ❝ ❞ ❡ ❢ ❣ ❤
|
||||
❥ ❦ ❧ ♣ ♦ ♥ ♠
|
||||
① ② ③ ④ ⑤ ⑥ ⑦
|
||||
⑧ ⑨ ⑩ ❶ ❷ ❸ ❹
|
||||
❺ ❻ ❼ ❽ ❾ ❿ ➀
|
||||
➁ ➂ ➃ ➄ ➅ ➆ ➇
|
||||
➈ ➉ ➊ ➋ ➌ ➍ ➎
|
||||
➏ ➐ ➑ ➒ ➓ ➔ →
|
||||
↔ ↕ ➘ ➙ ➚ ➛ ➜
|
||||
➝ ➞ ➟ ➠ ➡ ➢ ➣
|
||||
➤ ➥ ➦ ➧ ➨ ➩ ➪
|
||||
➫ ➬ ➭ ➮ ➯ ➱ ➲
|
||||
➳ ➴ ➵ ➶ ➷ ➸ ➹
|
||||
➺ ➻ ➼ ➽ ➾  
|
||||
      
|
||||
    
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-family="Helvetica" font-size="14pt">
|
||||
Symbol:
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="10pt" font-family="Symbol">
|
||||
! # % & ( ) + , . /
|
||||
0 1 2 3 4 5 6 7 8 9
|
||||
: ; < = > ? [ ] _ m
|
||||
{ | } ¬ ° ± µ × ÷
|
||||
ƒ Α Β Γ Ε Ζ Η
|
||||
Θ Ι Κ Λ Μ Ν Ξ
|
||||
Ο Π Ρ Σ Τ Υ Φ
|
||||
Χ Ψ α β γ δ ε
|
||||
ζ η θ ι κ λ ν
|
||||
ξ ο π ρ ς σ τ
|
||||
υ φ χ ψ ω ϑ ϒ
|
||||
ϕ ϖ • … ′ ″ ⁄
|
||||
ℑ ℘ ℜ Ω ℵ ← ↑
|
||||
→ ↓ ↔ ↵ ⇐ ⇑ ⇒
|
||||
⇓ ⇔ ∀ ∂ ∃ ∅ ∆
|
||||
∇ ∈ ∉ ∋ ∏ ∑ −
|
||||
∗ √ ∝ ∞ ∠ ∧ ∨
|
||||
∩ ∪ ∫ ∴ ∼ ≅ ≈
|
||||
≠ ≡ ≤ ≥ ⊂ ⊃ ⊄
|
||||
⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌠
|
||||
⌡ 〈 〉 ◊ ♠ ♣ ♥
|
||||
♦      
|
||||
      
|
||||
      
|
||||
      
|
||||
 
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-family="Helvetica" font-size="12pt">
|
||||
Some special characters:
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="10pt" font-family="Helvetica">
|
||||
Euro ( dec 8364, hex 20AC): €
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block space-after.optimum="10pt" font-family="Helvetica">
|
||||
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
|
||||
428
apache_fop/fop/examples/fo/basic/hyphen.fo
Normal file
|
|
@ -0,0 +1,428 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- example for a simple fo file. At the beginning the page layout is set.
|
||||
Below fo:root there is always
|
||||
- a single fo:layout-master-set which defines one or more page layouts
|
||||
- an optional fo:declarations
|
||||
- and a sequence of one or more fo:page-sequences containing the text and formatting instructions
|
||||
-->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
<!-- fo:layout-master-set defines in its children the page layout:
|
||||
the pagination and layout specifications
|
||||
- page-masters: have the role of describing the intended subdivisions
|
||||
of a page and the geometry of these subdivisions
|
||||
In this case there is only a simple-page-master which defines the
|
||||
layout for all pages of the text
|
||||
-->
|
||||
<!-- layout information -->
|
||||
<fo:simple-page-master master-name="simple"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="7cm"
|
||||
margin-right="3cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
|
||||
<!-- start page-sequence
|
||||
here comes the text (contained in flow objects)
|
||||
the page-sequence can contain different fo:flows
|
||||
the attribute value of master-name refers to the page layout
|
||||
which is to be used to layout the text contained in this
|
||||
page-sequence-->
|
||||
<fo:page-sequence master-reference="simple">
|
||||
|
||||
<!-- start fo:flow
|
||||
each flow is targeted
|
||||
at one (and only one) of the following:
|
||||
xsl-region-body (usually: normal text)
|
||||
xsl-region-before (usually: header)
|
||||
xsl-region-after (usually: footer)
|
||||
xsl-region-start (usually: left margin)
|
||||
xsl-region-end (usually: right margin)
|
||||
['usually' applies here to languages with left-right and top-down
|
||||
writing direction like English]
|
||||
in this case there is only one target: xsl-region-body
|
||||
-->
|
||||
<fo:flow flow-name="xsl-region-body"
|
||||
text-align="justify">
|
||||
|
||||
<!-- each paragraph is encapsulated in a block element
|
||||
the attributes of the block define
|
||||
font-family and size, line-heigth etc. -->
|
||||
|
||||
<!-- this defines a title -->
|
||||
<fo:block font-size="18pt"
|
||||
font-family="sans-serif"
|
||||
line-height="24pt"
|
||||
space-after.optimum="15pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="center"
|
||||
padding-top="3pt">
|
||||
Hyphenation tests
|
||||
</fo:block>
|
||||
|
||||
<!-- this defines a title -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="start">
|
||||
US English
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="justify"
|
||||
language="en"
|
||||
country="US"
|
||||
hyphenate="true"
|
||||
hyphenation-push-character-count="2"
|
||||
hyphenation-remain-character-count="2" >
|
||||
This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a
|
||||
W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from
|
||||
another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its
|
||||
widespread deployment. This enhances the functionality and interoperability of the Web.
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="justify"
|
||||
language="en"
|
||||
country="US"
|
||||
hyphenate="true"
|
||||
hyphenation-push-character-count="2"
|
||||
hyphenation-remain-character-count="2" >
|
||||
This document specifies a syntax created by subsetting an existing, widely used international text processing standard
|
||||
(Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It
|
||||
is a product of the W3C XML Activity, details of which can be found at the w3c website. A list of current W3C
|
||||
Recommendations and other technical documents can be found there too.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- this defines a title -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="start">
|
||||
German
|
||||
</fo:block>
|
||||
|
||||
<!-- this defines normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
language="de"
|
||||
hyphenate="true"
|
||||
hyphenation-push-character-count="2"
|
||||
hyphenation-remain-character-count="2" >
|
||||
1. Warum TEI?
|
||||
Die Verwendungszeit elektronischer Editionen wird von mehreren
|
||||
Faktoren verkürzt: der kurzen Lebensdauer der Programme, die zu
|
||||
ihrer Darstellung verwendet werden, der etwas längeren der
|
||||
Betriebssysteme, unter denen die Darstellungsprogramme laufen,
|
||||
der logischen Einrichtung des Datenträgers, auf dem sich die
|
||||
Edition befindet, und dessen physischer Dauer. Um die besonders
|
||||
unangenehme Abhängigkeit elektronischer Texte von bestimmten
|
||||
Programmen und Betriebssystemen zu vermeiden, haben
|
||||
Wissenschaftler ein Textauszeichnungssystem für philologische
|
||||
Belange entwickelt, das nach dem Entwicklerteam "Text Encoding
|
||||
Initiative" (TEI) genannt wird (1).
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
language="de"
|
||||
hyphenate="true">
|
||||
Das Auszeichnungssystem TEI ist eine Anwendung der Metasprache
|
||||
zur Beschreibung programmunabhängiger Auszeichnungssysteme SGML
|
||||
(Standard Generalized Markup Language), so wie auch HTML, mit
|
||||
dem die meisten Texte des Internets zur Zeit ausgezeichnet
|
||||
sind, eine Anwendung von SGML ist. Daten, die entsprechend den
|
||||
TEI-Richtlinien ausgezeichnet worden sind, können also mit
|
||||
jedem Programm, das SGML-Daten verarbeiten kann, dargestellt,
|
||||
umgewandelt oder durchsucht werden. (2)
|
||||
</fo:block>
|
||||
|
||||
<!-- this defines normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
language="de"
|
||||
hyphenate="true">
|
||||
|
||||
Verwendet wurde für die Auszeichnung 'teilite', das eine
|
||||
Teilmenge des gesamten Auszeichnungssystems TEI bietet, aber
|
||||
auf einige der komplexeren Merkmale verzichtet und deshalb auch
|
||||
eine einfache Konvertierung der Daten zu neueren Metasprachen
|
||||
für Auszeichnungssysteme wie XML, einer Teilmenge von SGML,
|
||||
ermöglicht.
|
||||
SGML-Programme mit der Leistungsfähigkeit von Folio Views sind
|
||||
z.Zt. noch relativ teuer, daher wurde für die vorliegende
|
||||
Edition der Weg gewählt, den Text doppelt auf die CD zu legen:
|
||||
Einmal für die sofortige Nutzung mit einer komfortablen
|
||||
Oberfläche und einmal ohne Software in einem Format, das seine
|
||||
langfristige Verwendbarkeit garantiert.
|
||||
Das Nachstehende soll einige Hinweise zur Einrichtung der TEI-
|
||||
Dateien geben, um deren weitere Verwendung zu erleichtern.
|
||||
</fo:block>
|
||||
|
||||
|
||||
|
||||
<!-- Finnish example sent in by Jarno Elovirta -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="start">
|
||||
Finnish
|
||||
</fo:block>
|
||||
|
||||
<fo:block language="fi"
|
||||
hyphenate="true">
|
||||
<fo:block font-weight="bold">Internet - tuo kaiken pahan lähde?</fo:block>
|
||||
<fo:block>Internet on saanut nauttia lähes täydellisestä sananvapaudesta koko
|
||||
olemassaolonsa ajan. Parin viimeiksi kuluneen vuoden aikana on kuitenkin
|
||||
julkisuudessa keskusteltu ahkerasti sen rajoittamisesta. Muutamat ilmaista
|
||||
kotisivutilaa tarjoavat palvelut ovatkin jo kieltäneet esimerkiksi natsimia
|
||||
kannattavien sivujen ylläpidon.</fo:block> <fo:block>Astetta pahempaan
|
||||
suuntaan ollaan kuitenkin menossa. Nettihuutokaupoissa tarjotaan kaikkea
|
||||
ihmiselimistä lähtien ja itsemurhiin etsitään avustajia itsemurhia suosivilta
|
||||
nettisivustoilta. Etelä-Koreassa poliisi on pidättänyt 20-vuotiaan miehen,
|
||||
jota epäillään ns. netti-itsemurhassa avustamisesta. Mies oli luvannut noin
|
||||
4000 dollarin korvausta vastaan kuristaa 23-vuotiaan naisen kuoliaaksi. Nainen
|
||||
tuli kuitenkin viime hetkellä toisiin ajatuksiin. Mies väittää kyseessä olleen
|
||||
pelkän vitsin. Viime kuussa Etelä-Koreassa kaksi opiskelijaa myrkytti itsensä
|
||||
netistä löytämiensä ohjeiden avulla.</fo:block> <fo:block>FBI puolestaan
|
||||
tutkii tapausta, jossa äiti oli myynyt kaksostytöt adoptoitavaksi korkeinta
|
||||
tarjousta vastaan nettihuutokaupalla. Tytöt myytiin ensin Kaliforniaan Allenin
|
||||
pariskunnalle, josta äiti kuitenkin kävi ryöstämässä lapset, sillä
|
||||
englantilainen Kilshawin pariskunta oli tarjonnut tytöistä tuplasumman.
|
||||
Kilshawit kuljettivat lapset Englantiin ja nyt tyttöjen perässä ovat sekä
|
||||
kahdet adoptiovanhemmat että iso liuta eri viranomaistahoja. Myös
|
||||
Iso-Britannian pääministeri Tony Blair on pitänyt lehdistötilaisuuden
|
||||
aiheeseen liittyen. Lue juttu.</fo:block> <fo:block>K2, 23:10. Lähde:
|
||||
Newsbytes | 5 kommenttia</fo:block> <fo:block font-weight="bold">Mato ryömii
|
||||
Linux-palvelimiin</fo:block> <fo:block>Internetissä leviää Ramen nimellä
|
||||
tunnettu mato, joka ilmeisesti hyödyntää kahta tunnettua tietoturva-aukkoa Red
|
||||
Hat Linuxin 6.2 ja 7.0 versioissa esiintyvissä wu-ftpd ja RPC.statd
|
||||
-ohjelmissa. Jos mato pääsee sisään järjestelmään, se korvaa palvelimella
|
||||
sijaitsevan HTML-pääsivun tekstillä, jossa kerrotaan hakkereiden pitävän
|
||||
nuudeleista. Madon on todettu leviävän erittäin nopeasti, sillä jos kaistaa
|
||||
riittää se pystyy skannaamaan jopa kaksi B-luokan verkkoa 15 minuutissa. Madon
|
||||
ei ole todettu avaavan palvelimiin takaovia, joiden kautta madon kirjoittaja
|
||||
pääsisi sisään järjestelmään. Lue juttu</fo:block> <fo:block>oma, 20:48.
|
||||
Lähde: ZDNet | 6 kommenttia</fo:block> <fo:block font-weight="bold">Macromedia
|
||||
ja Allaire yhdistyvät</fo:block> <fo:block>Macromedian ja Allairen
|
||||
julkaisemissa lehdistötiedotteissa kerrotaan yhtiöiden
|
||||
yhdistymissuunnitelmista. Macromedialle yrityskauppa maksaa noin 2,2 miljardia
|
||||
markkaa. Uuden yhdistyneen yrityksen nimenä säilyy Macromedia ja sen johdossa
|
||||
jatkaa Macromedian nykyinen toimitusjohtaja Rob Burgess. Yrityksen tuotteisiin
|
||||
lukeutuvat mm. Macromedia Dreamweaver, Macromedia Flash, Allaire ColdFusion ja
|
||||
Allaire JRun. Lue juttu.</fo:block>
|
||||
</fo:block>
|
||||
|
||||
<!-- Italian example sent in by Stéphane Bline-->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="start">
|
||||
Italian
|
||||
</fo:block>
|
||||
|
||||
<fo:block language="it"
|
||||
hyphenate="true">
|
||||
<fo:block
|
||||
space-before.optimum="0.6em" space-before.minimum="0.4em"
|
||||
space-before.maximum="0.8em">Un'applicazione di servizio consiste nell'utilizzo
|
||||
di applicazioni nell'ambito aziendale, senza procedere ad installazioni locali.
|
||||
L'applicazione ha la particolaritàdi essere ospitata "in-house" tramite
|
||||
Intranet o presso un fornitore esterno di applicazioni di servizi (ASP, acronimo
|
||||
di Application Service Provider) e di transitare grazie al protocollo di
|
||||
Internet. Intermediario eventuale tra l'editore di software e il cliente che
|
||||
desidera utilizzarli, il provider permette agli utenti di accedere ai vari
|
||||
programmi, previo contratto d'abbonamento.</fo:block> <fo:block
|
||||
space-before.optimum="0.6em" space-before.minimum="0.4em"
|
||||
space-before.maximum="0.8em">L'utilizzazione in linea rende automatica la
|
||||
manutenzione e l'aggiornamento delle applicazioni. A partire da una semplice
|
||||
interfaccia Web installata su un thin client, l'utente può accedere via
|
||||
Internet o Intranet all'insieme delle applicazioni attraverso il proprio account
|
||||
personale e dedicarsi all'utilizzazione approfondita delle applicazioni
|
||||
professionali.</fo:block> <fo:block font-weight="bold"
|
||||
space-after.optimum="6pt">Esempio 1.1. Esempio di applicazione di
|
||||
servizio</fo:block> <fo:block space-before.optimum="0.6em"
|
||||
space-before.minimum="0.4em" space-before.maximum="0.8em">Si prenda il caso di
|
||||
una societàA che desidera ottimizzare la comunicazione interna e la
|
||||
condivisione delle informazioni. Un fornitore di applicazioni di servizio
|
||||
potràrispondere rapidamente a questa aspettativa. Inoltre, potràproporre
|
||||
servizi complementari che permettono di proteggere i dati di A. Dopo aver
|
||||
studiato l'offerta, un responsabile della società firma con il fornitore B un
|
||||
contratto d'abbonamento a un'applicazione di servizio perfettamente adattata. Le
|
||||
società e B scambiano informazioni relative all'utilizzo online di questa
|
||||
applicazione, come il costo del servizio, le modalitàdi pagamento e la gestione
|
||||
degli account utente come i profili.</fo:block> </fo:block>
|
||||
|
||||
|
||||
<!-- this defines a title -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="start">
|
||||
Danish
|
||||
</fo:block>
|
||||
<fo:block language="da"
|
||||
hyphenate="true">
|
||||
Bekendtgørelsen har som udkast været
|
||||
notificeret i overensstemmelse med Europa-parlamentets og Rådets direktiv
|
||||
98/34/EF (Informationsproceduredirektivet), som senest ændret ved direktiv
|
||||
98/48/EF. Bekendtgørelsen indeholder bestemmelser der gennemfører dele af
|
||||
Rådets direktiv 89/677/EØF (EF-tidende L 398 s. 19).
|
||||
</fo:block>
|
||||
|
||||
<fo:block language="da"
|
||||
hyphenate="true">
|
||||
Bekendtgørelsens regler hindrer
|
||||
ikke import, salg og anvendelse af produkter, der på tidspunktet for
|
||||
bekendtgørelsens ikrafttræden er reguleret i medfør af anden lovgivning,
|
||||
der implementerer EU-direktiver, samt anden lovgivning i øvrigt, herunder
|
||||
bl.a. bekendtgørelse nr. 807 af 2. december 1986 om
|
||||
begrænsning af motorbenzins indhold af blyforbindelser og benzen.
|
||||
</fo:block>
|
||||
<fo:block language="da"
|
||||
hyphenate="true">
|
||||
Import og salg af produkter, der
|
||||
indeholder kemiske forbindelser af bly, er forbudt fra 1. marts 2001.
|
||||
Uanset forbudet i stk.
|
||||
1 er import og salg af produkter, der indeholder kemiske forbindelser af
|
||||
bly, fortsat tilladt for de produktkategorier, som er nævnt i bilag
|
||||
1 til denne bekendtgørelse, indtil de i bilaget anførte
|
||||
tidspunkter.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- this defines a title -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="start">
|
||||
Norwegian
|
||||
</fo:block>
|
||||
|
||||
<!-- this defines normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
language="no"
|
||||
hyphenate="true">
|
||||
|
||||
<fo:block>
|
||||
Av forståelige grunner har året 1814 vært av de mest omdiskuterte i norsk historieforskning.
|
||||
Med denne bibliografien vil man for første gang få en samlet oversikt over den viktigste
|
||||
historiske litteraturen omkring dette året og dets mangslungne begivenheter. Likevel har det
|
||||
vært en tilnærmet umulig oppgave å få med absolutt alt som er skrevet om Riksforsamlingen og
|
||||
Grunnloven i monografier, erindringsverker, bygdebøker, brevsamlinger, tidsskrifter og
|
||||
aviser helt fra 1814 og til i dag. Bibliografien er et forsøk på å samle de viktigste
|
||||
arbeider om 1814 som kan være av interesse både for forskere og for et bredt
|
||||
historieinteressert publikum. I denne korte historiografien vil det bli gjort rede for
|
||||
hvordan dette spennende året er blitt forstått og fortolket av norske og nordiske
|
||||
historikere gjennom fem ulike tidsepoker.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
Litteraturen om 1814 kan klassifiseres på flere måter. Grovt sett går det et skille mellom
|
||||
tre genrer: historiske oversiktsverker, historiske spesialstudier, erindringer og dagbøker
|
||||
og kilde- og dokumentutgivelser. Av oversiktsverker peker de store Norgeshistoriene seg ut
|
||||
med sin relativt omfattende behandling av 1814: Nevnes kan
|
||||
<fo:inline font-style="italic">Norges historie fremstillet for
|
||||
det norske folk</fo:inline>, bd. VI.1 (1913),
|
||||
<fo:inline font-style="italic">Det norske folks liv og historie</fo:inline> bd. VII (1933),
|
||||
<fo:inline font-style="italic">Vårt folks historie</fo:inline> bd. 6 (1964),
|
||||
<fo:inline font-style="italic">Cappelens Norges historie</fo:inline> bd. 9 (1978) og
|
||||
<fo:inline font-style="italic">Aschehougs Norgeshistorie</fo:inline> bd. 7 (1996). Disse oversiktene er i vesentlig grad bygd på den omfattende
|
||||
spesiallitteraturen i bok- eller artikkelform som har et meget vidt spenn, fra biografier
|
||||
over lokale Eidsvollsmenn til krigshistoriske analyser av felttoget. Mye tidligere skjult
|
||||
kunnskap er dessuten blitt hentet ut fra dagbøkene til sentrale aktører. Endelig har den
|
||||
lange rekken av kildeutgivelser hatt stor betydning for forskningen omkring 1814 og bidratt
|
||||
til å endre forskningsbildet flere ganger.
|
||||
</fo:block>
|
||||
<fo:block font-weight="bold">
|
||||
1814-1864
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
Det norske samfunnet etter 1814 ble rekonstruert på den nye Grunnlovens grunn, og vernet om
|
||||
den stod sentralt i den politiske kampen de neste 25 årene. Til tross for dette må man kunne
|
||||
si at dokumentasjonen av hva som egentlig hadde skjedd i 1814 i mange år forble temmelig
|
||||
beskjeden. Historiene levde, men da helst muntlig eller gjennom private brev og dagbøker.
|
||||
Dette var kanskje en uunngåelig konsekvens av omstendighetene. Landet var fattig på kultur,
|
||||
forleggere og historikere, og de politiske og økonomiske realiteter kalte mer på praktisk
|
||||
fornuft enn på idealistisk pasjon. Det forekom å være en lang vei fra den nasjonale raptus
|
||||
under de lyse vårukene på et grønnende Eidsvoll til den mer prosaiske og realpolitiske
|
||||
aksept av union og svenskekonge i et høstlig og tåketungt Christiania. Det var den nye
|
||||
Grunnloven av 4. november 1814 som gjaldt og regulerte det norske samfunnet, supplert av
|
||||
Riksakten av 1815.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
Riksforsamlingens forhandlinger i 1814 ble utgitt i 6 hefter allerede samme år av de valgte
|
||||
redaktører, professor Georg Sverdrup, professor Ludvig Stoud Platou og tollprokurør
|
||||
Christopher Omsen. At de ikke ble reprodusert i de følgende år, hadde sammenheng med den
|
||||
svenske holdningen. Forhandlingene på det ekstraordinære Storting ble utgitt både i 1815 og
|
||||
igjen i 1835, men Carl Johan oppfattet lenge interessen for Riksforsamlingen og 17. mai-
|
||||
Grunnloven som en indirekte underkjenning av unionsverket og kongens politiske autoritet.
|
||||
Etter påtrykk fra ham prøvde norske myndigheter å sette en stopper for offentlig feiring av
|
||||
17. mai helt frem til midten av 1830-årene.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
Rimeligvis ble da forholdet til Danmark snarere enn forholdet til Sverige ett av de første
|
||||
alvorlige stridsspørsmål i perioden. Presten og Eidsvollsmannen Nicolai Wergeland ble
|
||||
beryktet for den danskfiendtlige og unionsvennlige posisjon han inntok i boken
|
||||
<fo:inline font-style="italic">En sandfærdig Beretning om Danmarks politiske Forbrydelser imod Kongeriget Norge
|
||||
</fo:inline> (anonymt, 1816) som
|
||||
fulgte nasjonalhistorien helt opp til Kielfreden. Skriftet vakte debatt og kraftige
|
||||
reaksjoner ikke minst blant det gamle selvstendighetsparti. Blant annet publiserte Christian
|
||||
Magnus Falsen to motskrifter i 1817. Falsen prøvde også å popularisere Grunnlovens innhold
|
||||
for den mindre "oplyste" borgerklasse og allmue gjennom skriftet
|
||||
<fo:inline font-style="italic">Norges Grundlov gjennemgaaet i Spørgs-maal og Svar
|
||||
</fo:inline> (1818, forkortet versjon 1825). Men det må kunne påstås
|
||||
at den mer detaljerte historien om grunnlovsverkets tilblivelse og første fase lenge ble
|
||||
stående i noe av et halvmørke både for det alminnelige folk og for de nye generasjoner, og
|
||||
at dette skyldtes den politiske situasjonen. Det var Nicolai Wergeland som leverte selve
|
||||
pionerarbeidet blant de personlige kildesamlingene,
|
||||
<fo:inline font-style="italic">Fortrolige Breve til en Ven, Skrevne fra
|
||||
Eidsvold i Aaret 1814</fo:inline> (anonymt, 1830). Men det var først da det unionspolitiske klimaet
|
||||
mildnet etter 1837 at det ble åpnet for en grundigere historisk analyse av Grunnlovens
|
||||
forhistorie og tilblivelse.
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
</fo:flow> <!-- closes the flow element-->
|
||||
</fo:page-sequence> <!-- closes the page-sequence -->
|
||||
</fo:root>
|
||||
168
apache_fop/fop/examples/fo/basic/images.fo
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<fo:root font-family="Times Roman" font-size="12pt" text-align="center"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
xmlns:fox="http://xml.apache.org/fop/extensions">
|
||||
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="right"
|
||||
margin-top="75pt"
|
||||
margin-bottom="25pt"
|
||||
margin-left="100pt"
|
||||
margin-right="50pt">
|
||||
<fo:region-body margin-bottom="50pt"/>
|
||||
<fo:region-after extent="25pt"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:simple-page-master master-name="left"
|
||||
margin-top="75pt"
|
||||
margin-bottom="25pt"
|
||||
margin-left="50pt"
|
||||
margin-right="100pt">
|
||||
<fo:region-body margin-bottom="50pt"/>
|
||||
<fo:region-after extent="25pt"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="psmOddEven" >
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="right"
|
||||
page-position="first" />
|
||||
<fo:conditional-page-master-reference master-reference="left"
|
||||
odd-or-even="even" />
|
||||
<fo:conditional-page-master-reference master-reference="right"
|
||||
odd-or-even="odd" />
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence id="N2528" master-reference="psmOddEven">
|
||||
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block text-align-last="center" font-size="10pt">
|
||||
<fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block font-size="18pt" font-weight="bold">1. FOP test for images</fo:block>
|
||||
<fo:block id="N2531">
|
||||
|
||||
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A GIF image in FOP</fo:block>
|
||||
<fo:block>
|
||||
<fo:external-graphic src="../graphics/xml_feather.gif"/>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
<fo:block id="N2535">
|
||||
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A transparent GIF image in FOP</fo:block>
|
||||
<fo:block>
|
||||
<fo:external-graphic src="../graphics/xml_feather_transparent.gif"/>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
<fo:block id="N2545">
|
||||
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A JPEG image in FOP</fo:block>
|
||||
<fo:block>
|
||||
<fo:external-graphic src="../graphics/fop.jpg"/>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
<fo:block id="N2550">
|
||||
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A BMP image in FOP</fo:block>
|
||||
<fo:block>
|
||||
<fo:external-graphic src="../graphics/linux.bmp"/>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
<fo:block id="N2555">
|
||||
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A PNG image in FOP</fo:block>
|
||||
<fo:block>
|
||||
<fo:external-graphic src="../graphics/asf-logo.png"/>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
<fo:block id="N2556">
|
||||
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A TIFF image in FOP</fo:block>
|
||||
<fo:block>
|
||||
<fo:external-graphic src="../graphics/asf-logo.tif"/>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
<fo:block id="N2559">
|
||||
<fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em"/>
|
||||
This section is only required to show that the layout still works.
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
|
||||
</fo:page-sequence>
|
||||
|
||||
<fo:page-sequence id="N2561" master-reference="psmOddEven">
|
||||
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block text-align-last="center" font-size="10pt">
|
||||
<fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body" text-align="start" font-size="10pt">
|
||||
<fo:block id="e-g-use" font-size="18pt" font-weight="bold">A. The usage of fo:external-graphic</fo:block>
|
||||
<fo:block>
|
||||
<fo:block>The image used in these examples has the following properties:</fo:block>
|
||||
<fo:block start-indent="1cm">
|
||||
<fo:block>169 x 51 px, 96 dpi, results in an intrinsic size of 44.715 x 13.494 mm</fo:block>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
All the examples here will have a border="solid 0.1pt" to show the size of the viewport generated by the
|
||||
external-graphic element and a background-color="yellow" to show what parts of the viewport are painted
|
||||
upon by the image in the reference area. The image used is the non-transparent version of asf-logo.png:
|
||||
file:../graphics/asf-logo-nt.png (nt=non-transparent)
|
||||
</fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: [none]</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: inline-progression-dimension="60mm" block-progression-dimension="20mm"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" inline-progression-dimension="60mm" block-progression-dimension="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: width="30mm" height="20mm"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="30mm" height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: width="30mm" height="20mm" overflow="hidden"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="30mm" height="20mm" overflow="hidden" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm" text-align="center" display-align="center"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" text-align="center" display-align="center" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: content-height="20mm"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: content-width="60mm" content-height="40mm"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-width="60mm" content-height="40mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: content-width="60mm" content-height="40mm" scaling="non-uniform"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-width="60mm" content-height="40mm" scaling="non-uniform" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm" content-width="scale-to-fit"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block keep-with-next.within-column="always">Properties: width="60mm" content-width="scale-to-fit"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
|
||||
<fo:block break-before="page"/>
|
||||
<fo:block keep-with-next.within-column="always">Properties: width="100%" content-width="scale-to-fit"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
<fo:block space-before="0.5em">
|
||||
The following example shows how to fit an oversized image into the
|
||||
available width, but not scale smaller images up. This is a work-around
|
||||
until "scale-down-to-fit" is supported. The second feather below is in
|
||||
a block-container with a width of 40mm to simulate an oversized image.
|
||||
</fo:block>
|
||||
<fo:block keep-with-next.within-column="always">Properties: width="100%" content-width="scale-to-fit" content-height="100%"</fo:block>
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" content-height="100%" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
<fo:block-container width="40mm" background-color="lightgray">
|
||||
<fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" content-height="100%" border="solid 0.1pt" background-color="yellow"/></fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
|
||||
</fo:page-sequence>
|
||||
|
||||
</fo:root>
|
||||
|
||||
166
apache_fop/fop/examples/fo/basic/inhprop.fo
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<!-- example for a simple fo file. At the beginning the page layout is set.
|
||||
Below fo:root there is always
|
||||
- a single fo:layout-master-set which defines one or more page layouts
|
||||
- an optional fo:declarations,
|
||||
- and a sequence of one or more fo:page-sequences containing the text and formatting instructions -->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- layout for the first page -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.0cm + 0.5cm"
|
||||
margin-right="(5cm * 1cm) div 2cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<!-- layout for the other pages -->
|
||||
<fo:simple-page-master master-name="rest"
|
||||
page-height="abs(-30cm + .3cm)"
|
||||
page-width="(10cm * 2) + 1cm"
|
||||
margin-top="round(.5) * 1cm"
|
||||
margin-bottom="round(2.4) * 1cm"
|
||||
margin-left="2.5 * 1cm"
|
||||
margin-right="5.5cm - 3cm">
|
||||
<fo:region-body margin-top="2.5cm"/>
|
||||
<fo:region-before extent="2.5cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="basicPSM" >
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="first"
|
||||
page-position="first" />
|
||||
<fo:conditional-page-master-reference master-reference="rest"
|
||||
page-position="rest" />
|
||||
<!-- recommended fallback procedure -->
|
||||
<fo:conditional-page-master-reference master-reference="rest" />
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="basicPSM">
|
||||
|
||||
<!-- header -->
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block text-align="end"
|
||||
font-size="10pt"
|
||||
font-family="serif"
|
||||
line-height="1em + 4pt" >
|
||||
Property Function Tests - p. <fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- defines text title level 1-->
|
||||
<fo:block font-size="min(18pt,20pt)"
|
||||
font-family="sans-serif"
|
||||
line-height="max(24pt,18pt)"
|
||||
space-after.optimum="5 mod 3 * 7.5pt"
|
||||
background-color="rgb(0,0,255)"
|
||||
color="rgb(255,255,255)"
|
||||
text-align="center"
|
||||
padding-top="3pt">
|
||||
Property Function Tests
|
||||
</fo:block>
|
||||
|
||||
<!-- defines text title level 2-->
|
||||
<fo:block font-size="floor(16.3) * 1pt"
|
||||
font-family="sans-serif"
|
||||
line-height="2pt * ceiling(9.3)"
|
||||
space-before.optimum="10pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start"
|
||||
keep-with-next.within-page="always"
|
||||
keep-together.within-page="always"
|
||||
padding-top="3pt">
|
||||
Function: object from-parent( <fo:inline font-weight='bold'>NCName</fo:inline>)
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-after="3pt"
|
||||
keep-together="auto"
|
||||
text-align="start">
|
||||
The from-parent function returns a computed value of the property
|
||||
whose name matches the argument specified. The value returned is that
|
||||
for the parent of the formatting object for which the expression is
|
||||
evaluated. If there is no parent, the value returned is the initial
|
||||
value. If the argument specifies a shorthand property and if the
|
||||
expression only consists of the from-parent function with an argument
|
||||
matching the property being computed, it is interpreted as an
|
||||
expansion of the shorthand with each property into which the shorthand
|
||||
expands, each having a value of from-parent with an argument matching
|
||||
the property. It is an error if arguments matching a shorthand
|
||||
property are used in any other way.
|
||||
<fo:block font-size="from-parent(font-size) - 2pt"
|
||||
font-family="sans-serif"
|
||||
space-before="from-parent(space-after)"
|
||||
text-align="center">
|
||||
Here is a nested block with font-size =
|
||||
from-parent(font-size) - 2pt.
|
||||
Since its parent has font-size=12pt, that should mean 10pt. It should
|
||||
keep the line height of 1.25em, which means 12.5pt leading. It's
|
||||
space-before value is set to the space-after value from its
|
||||
parent. Note that neither of these are inheritable. Does it look right?
|
||||
</fo:block>
|
||||
<fo:block font-size="from-parent(font-size) + 2pt"
|
||||
space-before="2pt"
|
||||
space-after="from-parent(space-after)"
|
||||
font-family="sans-serif"
|
||||
start-indent="from-parent(start-indent) + 1cm"
|
||||
end-indent="from-parent(end-indent) + 1cm"
|
||||
text-align="end"
|
||||
background-color="black" color="rgb(50%,50%,50%)">
|
||||
Here is a nested block with text 2pt larger than its parent (that
|
||||
should be 14pt). This parent is indented 1cm on both start and end
|
||||
directions with respect to the values from its parent (which aren't
|
||||
specified, so they default to 0.0). The color is set to 50% (using the
|
||||
rgb function with % arguements, and the background color for this
|
||||
block is black (specified as a keyword). In this block, we'll put an
|
||||
<fo:inline color='inherited-property-value(background-color)'
|
||||
background-color='inherited-property-value(color)'>inline object</fo:inline>
|
||||
whose background and foreground colors invert those of its containing
|
||||
block. This uses the <fo:inline
|
||||
font-style='oblique'>inherited-property-value</fo:inline>
|
||||
function. Here's an <fo:inline color='black' background-color='white'>inline
|
||||
object</fo:inline> with fixed colors (black on white). That doesn't
|
||||
work either. Guess it's not my problem ... So let's try it with font
|
||||
sizes. In this block, we'll put an
|
||||
<fo:inline font-size='inherited-property-value(font-size)+2pt'>inline
|
||||
object whose font-size is 2 pt bigger than its parent's font-size.</fo:inline></fo:block>
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
space-before="6pt"
|
||||
line-height="1em + 2pt"
|
||||
font-family="sans-serif"
|
||||
text-align="start"
|
||||
background-color="rgb(50%,50%,50%)">
|
||||
An outer block with 12 pt text on 14 pt leading, default color
|
||||
and 50% grey background color. Test inherited color changes with
|
||||
nested blocks.
|
||||
<fo:block color='from-parent(background-color)'
|
||||
background-color='from-parent(color)'>
|
||||
Interchange color and background color using from-parent function.
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
114
apache_fop/fop/examples/fo/basic/instream.fo
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="one">
|
||||
<fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="50pt" margin-right="50pt" />
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="one">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block>This is used to show how foreign objects are placed in a line area.</fo:block>
|
||||
<fo:block>
|
||||
Some block text to separate instream objects.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
Some text before
|
||||
<fo:instream-foreign-object>
|
||||
<svg:svg width="20" height="20">
|
||||
<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>
|
||||
and some after the svg element.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
A text line below the instream object.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<fo:instream-foreign-object>
|
||||
<svg:svg width="250" height="50">
|
||||
<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:text style="font-family:Helvetica;fill:blue" x="10" y="30">SVG placed in a block</svg:text>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
A text line below the block.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
A text line with an instream foreign object that is before the line break.
|
||||
<fo:instream-foreign-object>
|
||||
<svg:svg width="50" height="50">
|
||||
<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:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>
|
||||
With some text on the next line. With a bit more text to go over the to the next line.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
A text line with an instream foreign object that is after the line break.
|
||||
With some text on the next line. With a bit
|
||||
<fo:instream-foreign-object>
|
||||
<svg:svg width="50" height="50">
|
||||
<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:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>
|
||||
more text to go over the to the next line.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
A text line with an instream foreign object that is over the line break.
|
||||
With some text
|
||||
<fo:instream-foreign-object>
|
||||
<svg:svg width="50" height="50">
|
||||
<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:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>
|
||||
on the next line. With a bit more text to go over the to the next line to
|
||||
see it handles it properly.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
The next block has an instream object wider than the area.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<fo:instream-foreign-object>
|
||||
<svg:svg width="550" height="50">
|
||||
<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:rect style="fill:none;stroke:black" x="0" y="0" width="549" height="49"/>
|
||||
<svg:text x="10" y="30">SVG placed in a really wide block</svg:text>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
This block has an instream object wider than the area after this text
|
||||
<fo:instream-foreign-object>
|
||||
<svg:svg width="550" height="50">
|
||||
<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:rect style="fill:none;stroke:black" x="0" y="0" width="549" height="49"/>
|
||||
<svg:text style="font-family:Helvetica" x="10" y="30">SVG placed in a really wide block</svg:text>
|
||||
</svg:svg>
|
||||
</fo:instream-foreign-object>
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
781
apache_fop/fop/examples/fo/basic/leader.fo
Normal file
|
|
@ -0,0 +1,781 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- examples for the use of the fo leader -->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="sans-serif">
|
||||
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- page layout -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="2.5cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
|
||||
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="first">
|
||||
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
>
|
||||
Leader examples
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
fo:leader is mainly used a) in table-of-contents to generate sequences of "." glyphs that separate titles from page numbers
|
||||
b) to create entry fields in fill-in-the-blank forms c) to create horizontal rules for use as separators. You
|
||||
define the look and use of fo:leader with the property "leader-pattern". It can have the following values: a) space. This
|
||||
just creates an space. b) dots. This creates a sequence of "." c) rule. This creates a line. d) use-content. This creates a
|
||||
repeating pattern of the content of fo:leader.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
The dimensions of fo:leader are determined by the compound property leader-length. It consists of the
|
||||
3 sub values: leader-length.minimum (default = 0), leader-length.optimum (default = 12pt), leader-length.maximum
|
||||
(default = 100%). If you want to make sure, that leader-length has a fixed size, you should use the compound
|
||||
property (p.e. leader-length="5cm"). If you want to fill the rest of the remaining space with dots in a table of
|
||||
content, you can use the default values.
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="14pt"
|
||||
font-family="sans-serif"
|
||||
line-height="17pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start"
|
||||
background-color="blue"
|
||||
color="white">
|
||||
leader with leader-pattern="space"
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (space) -->
|
||||
<fo:block text-align="start">Entry 1
|
||||
<fo:leader leader-pattern="space"
|
||||
leader-length="6cm"/>p. 12
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (space) -->
|
||||
<fo:block text-align="start">Entry 2
|
||||
<fo:leader leader-pattern="space"
|
||||
leader-length="6cm"/>p. 24
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (space) -->
|
||||
<fo:block text-align="start">Left side
|
||||
<fo:leader leader-pattern="space"
|
||||
leader-length="5.5cm"/>middle
|
||||
<fo:leader leader-pattern="space"
|
||||
leader-length="5.5cm"/>right side
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block font-size="14pt"
|
||||
font-family="sans-serif"
|
||||
line-height="17pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
>
|
||||
Using fo:leader with leader-pattern="dots"
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
There are two properties which allow you to specify the looks of the dotted line. First
|
||||
"leader-pattern-width". It specifies the length of one dot and the space up to the next dot.
|
||||
Second leader-alignment. It can be used to make sure, the dots in different lines are parallel (only value "reference-area"
|
||||
is supported).
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 1
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-length="6cm"/>p. 12
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 2
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-length="6cm"/>p. 24
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
Using fo:leader with leader-pattern="dots" and leader-pattern-width="5pt" and "8pt"
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 1
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="5pt"
|
||||
leader-length="6cm"/>p. 12
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 2
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="5pt"
|
||||
leader-length="6cm"/>p. 24
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 1
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"/>p. 12
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 2
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"/>p. 24
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
Using fo:leader with leader-pattern="dots" in a list
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="start"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
Using fo:leader with leader-pattern="dots", leader-pattern-width="5pt" and "8pt", leader-alignment="reference-area"
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 1
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="5pt"
|
||||
leader-alignment="reference-area"
|
||||
leader-length="6cm"/>p. 12
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 2
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="5pt"
|
||||
leader-alignment="reference-area"
|
||||
leader-length="6cm"/>p. 24
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 3 is longer
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="5pt"
|
||||
leader-alignment="reference-area"
|
||||
leader-length="6cm"/>p. 36
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 4 is even longer
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-alignment="reference-area"
|
||||
leader-pattern-width="5pt"
|
||||
leader-length="6cm"/>p. 48
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">1
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"
|
||||
leader-alignment="reference-area"/>p. 12
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 2
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"
|
||||
leader-alignment="reference-area"/>p. 24
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 3 is longer
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"
|
||||
leader-alignment="reference-area"/>p. 36
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 4 is even longer
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"
|
||||
leader-alignment="reference-area"/>p. 48
|
||||
</fo:block>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- list start -->
|
||||
<!-- use provisional-distance-between-starts to define
|
||||
the distance between the start of the label and the item text
|
||||
|
||||
use provisional-label-separation to define the distance between
|
||||
the end of the item label and the start of item text
|
||||
-->
|
||||
<fo:list-block provisional-distance-between-starts="0.3cm"
|
||||
provisional-label-separation="0.15cm">
|
||||
|
||||
<!-- list item -->
|
||||
<fo:list-item>
|
||||
<!-- insert a bullet -->
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block><fo:inline font-size="10pt">·</fo:inline></fo:block>
|
||||
</fo:list-item-label>
|
||||
<!-- list text -->
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 1
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="5pt"
|
||||
leader-length="6cm"/>p. 12
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<!-- list item -->
|
||||
<fo:list-item>
|
||||
<!-- insert a bullet -->
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block><fo:inline font-size="10pt">·</fo:inline></fo:block>
|
||||
</fo:list-item-label>
|
||||
<!-- list text -->
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<!-- Inserts a leader (dots) -->
|
||||
<fo:block text-align="start">Entry 2
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="5pt"
|
||||
leader-length="6cm"/>p. 24
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</fo:list-block>
|
||||
<!-- list end -->
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
Using fo:leader with leader-pattern="dots" in a table
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="20mm"/>
|
||||
<fo:table-column column-width="60mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>Entry 1</fo:block></fo:table-cell>
|
||||
<fo:table-cell >
|
||||
<fo:block text-align="start">
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell ><fo:block>p. 12</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>Entry 2 </fo:block></fo:table-cell>
|
||||
<fo:table-cell >
|
||||
<fo:block text-align="start">
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell ><fo:block>p. 24</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>Entry 3 </fo:block></fo:table-cell>
|
||||
<fo:table-cell >
|
||||
<fo:block text-align="start">
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="6cm"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell ><fo:block>p. 36</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<!-- table end -->
|
||||
|
||||
|
||||
|
||||
<fo:block text-align="center"
|
||||
font-size="15pt"
|
||||
space-before.optimum="16pt"
|
||||
space-after.optimum="12pt">
|
||||
Table of Content
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="start"
|
||||
font-size="10pt"
|
||||
space-after.optimum="12pt">
|
||||
shows the use of leader properties in combination to build a table of content.
|
||||
Following values are used for the leader:
|
||||
leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-alignment="reference-area"
|
||||
no leader-length is specified, so the default values are used (min: 0, opt: 12pt, max: 100%)
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- Here starts the table -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="1cm"/>
|
||||
<fo:table-column column-width="14.2cm"/>
|
||||
<fo:table-column column-width="0.3cm"/>
|
||||
<fo:table-body font-size="12pt" font-family="sans-serif">
|
||||
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell><fo:block text-align="end">A) </fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="start" text-align-last="justify">This is some longer sample text<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-alignment="reference-area"
|
||||
/></fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="end">1</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell><fo:block text-align="end">B) </fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="start" text-align-last="justify">Some text<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-alignment="reference-area"
|
||||
/></fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="end">2</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell><fo:block text-align="end" >C) </fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="start" text-align-last="justify">Text<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-alignment="reference-area"
|
||||
/></fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="end">3</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell><fo:block text-align="end">D) </fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="start" text-align-last="justify">This text is even longer than the first entry <fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-alignment="reference-area"
|
||||
/></fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="end">4</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell><fo:block text-align="end">E) </fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="start" text-align-last="justify">Shorter text example<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-alignment="reference-area"
|
||||
/></fo:block></fo:table-cell>
|
||||
<fo:table-cell><fo:block text-align="end">5</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block font-size="14pt"
|
||||
font-family="sans-serif"
|
||||
line-height="17pt"
|
||||
space-before.optimum="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
>
|
||||
Leader with leader-pattern="rule"
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="start">text before the rule (start)
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="3.0pt"
|
||||
leader-length="6cm"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt"
|
||||
start-indent="1.5cm"
|
||||
end-indent="2cm"
|
||||
background-color="blue"
|
||||
color="yellow"/>
|
||||
text after the rule
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center">text before the rule (center)
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="3.0pt"
|
||||
leader-length="6cm"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt"
|
||||
start-indent="1.5cm"
|
||||
end-indent="2cm"
|
||||
background-color="blue"
|
||||
color="yellow"/>
|
||||
text after the rule
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="end">text before the rule (end)
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="3.0pt"
|
||||
leader-length="6cm"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt"
|
||||
start-indent="1.5cm"
|
||||
end-indent="2cm"
|
||||
background-color="blue"
|
||||
color="yellow"/>
|
||||
text after the rule
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
Here are some fo:leader with the property rule and different rule styles
|
||||
(solid, dashed, dotted, double, groove, ridge the last one with colored backgrounds
|
||||
to the effect)
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="1pt"
|
||||
leader-length="6cm"/>
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
|
||||
<fo:leader leader-pattern="rule"
|
||||
leader-length="6cm"
|
||||
rule-thickness="1pt"
|
||||
rule-style="dashed"/>
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
leader-length="6cm"
|
||||
rule-style="dotted"
|
||||
rule-thickness="1pt"/>
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
leader-length="6cm"
|
||||
rule-thickness="2pt"
|
||||
rule-style="double"/>
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="center" background-color="silver"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
leader-length="6cm"
|
||||
rule-thickness="1pt"
|
||||
rule-style="groove"
|
||||
color="black" />
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="center" background-color="silver"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
leader-length="6cm"
|
||||
rule-thickness="1pt"
|
||||
rule-style="ridge"
|
||||
color="black" />
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
Here are 4 fo:leader with increasing rule-thickness (1pt, 2pt, 3pt, 4pt)
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="1.0pt"
|
||||
leader-length="6cm"/>
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="2.0pt"
|
||||
leader-length="6cm"/>
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="3.0pt"
|
||||
leader-length="6cm"/>
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="4.0pt"
|
||||
leader-length="6cm"/>
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
Here are 4 fo:leader with increasing rule-thickness (1pt, 2pt, 3pt, 4pt) and leader-length: 25%, 50%, 75%, 100%
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="1.0pt"
|
||||
leader-length="25%"/>
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="2.0pt"
|
||||
leader-length="50%"/>
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="3.0pt"
|
||||
leader-length="75%"/>
|
||||
</fo:block>
|
||||
|
||||
<!-- Inserts a leader (rule). Because leader is an inline fo you have
|
||||
to wrap it into a block element -->
|
||||
<fo:block text-align="center"
|
||||
space-before.optimum="12pt"
|
||||
space-after.optimum="12pt">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="4.0pt"
|
||||
leader-length="100%"/>
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block text-align="center"
|
||||
font-size="15pt"
|
||||
space-before.optimum="16pt"
|
||||
space-after.optimum="12pt">
|
||||
Using leader in combination with justified text
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block text-align="justify">Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here comes the leader (dots width 8pt):
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="8pt"
|
||||
leader-length="5cm"/>Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here is some longer text. Here is some longer text.
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="justify">Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here comes the leader (dots width 5pt):
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-pattern-width="5pt"
|
||||
leader-length="5cm"/>Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here is some longer text. Here is some longer text.
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="justify">Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here comes the leader (dots):
|
||||
<fo:leader leader-pattern="dots"
|
||||
leader-length="5cm"/>Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here is some longer text. Here is some longer text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block text-align="justify">Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here comes the leader (rule):
|
||||
<fo:leader leader-pattern="rule"
|
||||
leader-length="5cm"/>Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here is some longer text. Here is some longer text.
|
||||
</fo:block>
|
||||
|
||||
<fo:block text-align="justify">Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here comes the leader (space):
|
||||
<fo:leader leader-pattern="space"
|
||||
leader-length="5cm"/>Here is some longer text. Here is some longer text.
|
||||
Here is some longer text. Here is some longer text. Here is some longer text.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-before.optimum="15pt" font-weight="bold" font-size="14pt">
|
||||
Use-Content
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-before.optimum="8pt" font-size="12pt">
|
||||
The following examples show Leader with "use-content".
|
||||
The inline areas from the context of the leader are
|
||||
repeated until the length of the leader. The
|
||||
"leader-pattern-width" can be used to set the width
|
||||
of each repeated pattern element. <fo:inline font-style="italic">
|
||||
If this width is less than the inline areas then the width
|
||||
of the inline areas is used.</fo:inline>
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-before.optimum="5pt" text-align="start">Characters:
|
||||
<fo:leader leader-pattern="use-content">abcd</fo:leader>End
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-before.optimum="5pt" text-align="start">Set width:
|
||||
<fo:leader leader-pattern="use-content"
|
||||
leader-pattern-width="50pt">abcd</fo:leader>End
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-before.optimum="5pt" text-align="start">Small Width:
|
||||
<fo:leader leader-pattern="use-content"
|
||||
leader-pattern-width="2pt">abcd</fo:leader>End
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-before.optimum="5pt" text-align="start">SVG:
|
||||
<fo:leader leader-pattern="use-content">
|
||||
<fo:instream-foreign-object>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10">
|
||||
<rect x="0" y="0" width="5" height="5" style="fill:red"/>
|
||||
<rect x="5" y="5" width="5" height="5" style="fill:black"/>
|
||||
</svg>
|
||||
</fo:instream-foreign-object>
|
||||
</fo:leader>End
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-before.optimum="5pt" text-align="start">Mixed:
|
||||
<fo:leader leader-pattern="use-content">
|
||||
abc
|
||||
<fo:instream-foreign-object>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10">
|
||||
<rect x="0" y="0" width="5" height="5" style="fill:red"/>
|
||||
<rect x="5" y="5" width="5" height="5" style="fill:black"/>
|
||||
</svg>
|
||||
</fo:instream-foreign-object>
|
||||
</fo:leader>End
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-before.optimum="5pt" text-align="start">Mixed:
|
||||
<fo:leader leader-pattern="use-content">
|
||||
abc
|
||||
<fo:instream-foreign-object>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10">
|
||||
<rect x="0" y="0" width="5" height="5" style="fill:red"/>
|
||||
<rect x="5" y="5" width="5" height="5" style="fill:black"/>
|
||||
</svg>
|
||||
</fo:instream-foreign-object>
|
||||
def
|
||||
</fo:leader>End
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
146
apache_fop/fop/examples/fo/basic/link.fo
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<!-- defines page layout -->
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="first">
|
||||
|
||||
<!-- text body -->
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">0. Normal text without link
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center"
|
||||
font-family="serif">1. <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">---</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">
|
||||
2. A one line example (text-align='start'): <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">---</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="start">
|
||||
3. A multiline text (text-align='start'). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information
|
||||
go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">---</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">
|
||||
4. A multiline text (text-align='centered'). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information
|
||||
go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">---</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="end">
|
||||
5. A multiline text (text-align='end'). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information
|
||||
go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">---</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="justify">
|
||||
6. A multiline text (text-align='justify'). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information
|
||||
go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="center">---</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="start"
|
||||
space-before.optimum="6pt"
|
||||
line-height="24pt"
|
||||
font-family="serif"
|
||||
padding-top="3pt"
|
||||
>
|
||||
7. A multiline text (text-align='start', space-before.optimum=6pt, font-family=serif padding-top="3pt"). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable <fo:basic-link external-destination="normal.pdf">generic</fo:basic-link> SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information
|
||||
go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="start"
|
||||
space-before.optimum="6pt"
|
||||
line-height="24pt"
|
||||
font-family="serif"
|
||||
padding-top="3pt"
|
||||
>
|
||||
8. A multiline text (text-align='start', space-before.optimum=6pt, font-family=serif, padding-top="3pt"). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable <fo:basic-link external-destination="normal.pdf">generic</fo:basic-link> SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information
|
||||
go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block text-align="start"
|
||||
space-before.optimum="6pt"
|
||||
line-height="24pt"
|
||||
font-family="serif"
|
||||
padding-top="3pt"
|
||||
>
|
||||
9. Linking to a specific page of an external:
|
||||
<fo:basic-link external-destination="extensive.pdf#page=1">extensive.pdf, Page 2</fo:basic-link>.
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<!-- <fo:block text-align="start"
|
||||
space-before.optimum="6pt"
|
||||
line-height="24pt"
|
||||
font-family="serif"
|
||||
padding-top="3pt"
|
||||
>
|
||||
8. A multiline text (text-align='start', space-before.optimum=6pt, font-family=serif, padding-top="3pt"). The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable <fo:basic-link external-destination="normal.pdf">generic</fo:basic-link> SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML. For further information
|
||||
go to <fo:basic-link external-destination="normal.pdf">normal.pdf</fo:basic-link>
|
||||
</fo:block>
|
||||
-->
|
||||
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
2690
apache_fop/fop/examples/fo/basic/list.fo
Normal file
148
apache_fop/fop/examples/fo/basic/newlinktest.fo
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- layout for the first page -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
margin-top="1in"
|
||||
margin-bottom="1in"
|
||||
margin-left="1in"
|
||||
margin-right="1in">
|
||||
<fo:region-body margin-top="2.5cm" margin-bottom="1.5cm"/>
|
||||
<fo:region-before extent="2.5cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="first">
|
||||
|
||||
<!-- header -->
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block text-align="end"
|
||||
font-size="8pt"
|
||||
font-family="serif"
|
||||
line-height="14pt" >
|
||||
<fo:basic-link external-destination="http://xmlgraphics.apache.org/fop"
|
||||
color="rgb(150,150,150)" font-style="italic">
|
||||
http://xmlgraphics.apache.org/fop
|
||||
</fo:basic-link>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<fo:block space-after.optimum="3pt" font-family="serif" id="block1">
|
||||
FOP is the world's first print formatter driven by XSL formatting
|
||||
objects. It is a Java 1.1 application that reads a formatting object
|
||||
tree and then turns it into a PDF document. The formatting object
|
||||
tree, can be in the form of an XML document (output by an XSLT engine
|
||||
like XT or Xalan) or can be passed in memory as a DOM Document or (in
|
||||
the case of XT) SAX events.
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="12pt" font-family="serif">FOP is part of Apache's XML project. The homepage of FOP is
|
||||
<fo:inline font-style="italic" font-family="serif"><fo:basic-link color="blue" external-destination="http://xmlgraphics.apache.org/fop">http://xmlgraphics.apache.org/fop</fo:basic-link></fo:inline>
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="12pt" font-family="serif" font-weight="bold" text-align="center">
|
||||
align="start"
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="12pt" font-family="serif" text-align="start">
|
||||
Apache FOP is the world's first print formatter driven by XSL formatting
|
||||
objects. It is a Java 1.1 application that reads a <fo:basic-link internal-destination="block1" color="blue">formatting object</fo:basic-link>
|
||||
tree and then turns it into a <fo:basic-link internal-destination="block1" color="blue">PDF document</fo:basic-link>. The formatting object
|
||||
tree, can be in the form of an XML <fo:basic-link internal-destination="block1" color="blue">document</fo:basic-link> (output by an XSLT engine
|
||||
like XT or Xalan) or can be passed in memory as a DOM Document or (in
|
||||
the case of XT) SAX events.
|
||||
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="12pt" font-family="serif" font-weight="bold" text-align="center">
|
||||
align="center"
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="12pt" font-family="serif" text-align="center">
|
||||
Apache FOP is the world's first print formatter driven by XSL formatting
|
||||
objects. It is a Java 1.1 application that reads a <fo:basic-link internal-destination="block1" color="blue">formatting object</fo:basic-link>
|
||||
tree and then turns it into a <fo:basic-link internal-destination="block1" color="blue">PDF document</fo:basic-link>. The formatting object
|
||||
tree, can be in the form of an XML <fo:basic-link internal-destination="block1" color="blue">document</fo:basic-link> (output by an XSLT engine
|
||||
like XT or Xalan) or can be passed in memory as a DOM Document or (in
|
||||
the case of XT) SAX events.
|
||||
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="12pt" font-family="serif" font-weight="bold" text-align="center">
|
||||
align="justify"
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="12pt" font-family="serif" text-align="justify">
|
||||
Apache FOP is the world's first print formatter driven by XSL formatting
|
||||
objects. It is a Java 1.1 application that reads a <fo:basic-link internal-destination="block1" color="blue">formatting object</fo:basic-link>
|
||||
tree and then turns it into a <fo:basic-link internal-destination="block1" color="blue">PDF document</fo:basic-link>. The formatting object
|
||||
tree, can be in the form of an XML <fo:basic-link internal-destination="block1" color="blue">document</fo:basic-link> (output by an XSLT engine
|
||||
like XT or Xalan) or can be passed in memory as a DOM Document or (in
|
||||
the case of XT) SAX events.
|
||||
|
||||
</fo:block>
|
||||
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>good</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>bad</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block><fo:basic-link internal-destination="block1" color="blue">ugly</fo:basic-link></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>nice</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block><fo:basic-link internal-destination="block1" color="blue">dice</fo:basic-link></fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>vice</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>literature</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>music</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block><fo:basic-link internal-destination="block1" color="blue">art</fo:basic-link></fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block><fo:basic-link internal-destination="block1" color="blue">java</fo:basic-link></fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>perl</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>python</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<!-- table end -->
|
||||
|
||||
<fo:block break-before="page" space-after.optimum="12pt" font-family="serif" text-align="start" font-weight="bold">
|
||||
Links in different orientations
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
This block container has a different reference orientation.
|
||||
<fo:block-container reference-orientation="90" inline-progression-dimension="150pt">
|
||||
<fo:block>
|
||||
A link applies to the inline parent area that is created
|
||||
by the basic-link. This inline area has a trait specifying
|
||||
the link.
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<fo:basic-link external-destination="http://xmlgraphics.apache.org/fop"
|
||||
color="blue" text-decoration="underline">
|
||||
http://xmlgraphics.apache.org/fop
|
||||
</fo:basic-link>
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:block>
|
||||
|
||||
|
||||
</fo:flow>
|
||||
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
140
apache_fop/fop/examples/fo/basic/normal.fo
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<!-- example for a simple fo file. At the beginning the page layout is set.
|
||||
Below fo:root there is always
|
||||
- a single fo:layout-master-set which defines one or more page layouts
|
||||
- an optional fo:declarations,
|
||||
- and a sequence of one or more fo:page-sequences containing the text and formatting instructions -->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- layout for the first page -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="21cm"
|
||||
page-width="29.7cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<!-- layout for the other pages -->
|
||||
<fo:simple-page-master master-name="rest"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="2.5cm"/>
|
||||
<fo:region-before extent="2.5cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="basicPSM" >
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="first"
|
||||
page-position="first" />
|
||||
<fo:conditional-page-master-reference master-reference="rest"
|
||||
page-position="rest" />
|
||||
<!-- recommended fallback procedure -->
|
||||
<fo:conditional-page-master-reference master-reference="rest" />
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="basicPSM">
|
||||
|
||||
<!-- header -->
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block text-align="end"
|
||||
font-size="10pt"
|
||||
font-family="serif"
|
||||
line-height="14pt" >
|
||||
XML Recommendation - p. <fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- defines text title level 1-->
|
||||
<fo:block font-size="18pt"
|
||||
font-family="sans-serif"
|
||||
line-height="24pt"
|
||||
space-after.optimum="15pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="center"
|
||||
padding-top="3pt"
|
||||
font-variant="small-caps">
|
||||
Extensible Markup Language (XML) 1.0
|
||||
</fo:block>
|
||||
|
||||
<!-- defines text title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
line-height="20pt"
|
||||
space-before.optimum="10pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start"
|
||||
padding-top="3pt">
|
||||
Abstract
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
The <fo:inline font-variant="small-caps">Extensible Markup Language (XML)</fo:inline> is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML.
|
||||
</fo:block>
|
||||
|
||||
<!-- defines text title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
line-height="20pt"
|
||||
space-before.optimum="10pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start"
|
||||
padding-top="3pt">
|
||||
Status of this document
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a
|
||||
W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from
|
||||
another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its
|
||||
widespread deployment. This enhances the functionality and interoperability of the Web.
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
This document specifies a syntax created by subsetting an existing, widely used international text processing standard
|
||||
(Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It
|
||||
is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. A list of current W3C
|
||||
Recommendations and other technical documents can be found at http://www.w3.org/TR.
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
140
apache_fop/fop/examples/fo/basic/normalex.fo
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<!-- example for a simple fo file. At the beginning the page layout is set.
|
||||
Below fo:root there is always
|
||||
- a single fo:layout-master-set which defines one or more page layouts
|
||||
- an optional fo:declarations,
|
||||
- and a sequence of one or more fo:page-sequences containing the text and formatting instructions -->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- layout for the first page -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="21cm"
|
||||
page-width="29.7cm"
|
||||
margin-top="6.3cm - 3.8cm - 1.5cm"
|
||||
margin-bottom="3cm - (.25cm * 4)"
|
||||
margin-left="2.0cm + 0.5cm"
|
||||
margin-right="(5cm * 1cm) div 2cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="1cm + 3cm - 1cm"/>
|
||||
<fo:region-after extent="2 * .5cm + .5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<!-- layout for the other pages -->
|
||||
<fo:simple-page-master master-name="rest"
|
||||
page-height="abs(-30cm + .3cm)"
|
||||
page-width="(10cm * 2) + 1cm"
|
||||
margin-top="round(.5) * 1cm"
|
||||
margin-bottom="round(2.4) * 1cm"
|
||||
margin-left="2.5 * 1cm"
|
||||
margin-right="5.5cm - 3cm">
|
||||
<fo:region-body margin-top="2.5cm"/>
|
||||
<fo:region-before extent="2.5cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="basicPSM" >
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="first"
|
||||
page-position="first" />
|
||||
<fo:conditional-page-master-reference master-reference="rest"
|
||||
page-position="rest" />
|
||||
<!-- recommended fallback procedure -->
|
||||
<fo:conditional-page-master-reference master-reference="rest" />
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="basicPSM">
|
||||
|
||||
<!-- header -->
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block text-align="end"
|
||||
font-size="10pt"
|
||||
font-family="serif"
|
||||
line-height="1em + 4pt" >
|
||||
XML Recommendation - p. <fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- defines text title level 1-->
|
||||
<fo:block font-size="min(18pt,20pt)"
|
||||
font-family="sans-serif"
|
||||
line-height="max(24pt,18pt)"
|
||||
space-after.optimum="5 mod 3 * 7.5pt"
|
||||
background-color="rgb(0,0,255)"
|
||||
color="rgb(100%,100%,100%)"
|
||||
text-align="center"
|
||||
padding-top="3pt">
|
||||
Extensible Markup Language (XML) 1.0
|
||||
</fo:block>
|
||||
|
||||
<!-- defines text title level 2-->
|
||||
<fo:block font-size="floor(16.3) * 1pt"
|
||||
font-family="sans-serif"
|
||||
line-height="2pt * ceiling(9.3)"
|
||||
space-before.optimum="10pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start"
|
||||
padding-top="3pt">
|
||||
Abstract
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="2 * (.5em + 1.5pt)"
|
||||
space-after.optimum=".25 * 1em"
|
||||
text-align="start">
|
||||
The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML.
|
||||
</fo:block>
|
||||
|
||||
<!-- defines text title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25"
|
||||
space-before.optimum="10pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start"
|
||||
padding-top="3pt">
|
||||
Status of this document
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="start">
|
||||
This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a
|
||||
W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from
|
||||
another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its
|
||||
widespread deployment. This enhances the functionality and interoperability of the Web.
|
||||
</fo:block>
|
||||
|
||||
<!-- Normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="1.25em"
|
||||
space-after.optimum="1pc div 4"
|
||||
text-align="start">
|
||||
This document specifies a syntax created by subsetting an existing, widely used international text processing standard
|
||||
(Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It
|
||||
is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. A list of current W3C
|
||||
Recommendations and other technical documents can be found at http://www.w3.org/TR.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
1402
apache_fop/fop/examples/fo/basic/pdfoutline.fo
Normal file
1341
apache_fop/fop/examples/fo/basic/readme.fo
Normal file
99
apache_fop/fop/examples/fo/basic/simple.fo
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- example for a simple fo file. At the beginning the page layout is set.
|
||||
Below fo:root there is always
|
||||
- a single fo:layout-master-set which defines one or more page layouts
|
||||
- an optional fo:declarations
|
||||
- and a sequence of one or more fo:page-sequences containing the text and formatting instructions
|
||||
-->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
<!-- fo:layout-master-set defines in its children the page layout:
|
||||
the pagination and layout specifications
|
||||
- page-masters: have the role of describing the intended subdivisions
|
||||
of a page and the geometry of these subdivisions
|
||||
In this case there is only a simple-page-master which defines the
|
||||
layout for all pages of the text
|
||||
-->
|
||||
<!-- layout information -->
|
||||
<fo:simple-page-master master-name="simple"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
|
||||
<!-- start page-sequence
|
||||
here comes the text (contained in flow objects)
|
||||
the page-sequence can contain different fo:flows
|
||||
the attribute value of master-name refers to the page layout
|
||||
which is to be used to layout the text contained in this
|
||||
page-sequence-->
|
||||
<fo:page-sequence master-reference="simple">
|
||||
|
||||
<!-- start fo:flow
|
||||
each flow is targeted
|
||||
at one (and only one) of the following:
|
||||
xsl-region-body (usually: normal text)
|
||||
xsl-region-before (usually: header)
|
||||
xsl-region-after (usually: footer)
|
||||
xsl-region-start (usually: left margin)
|
||||
xsl-region-end (usually: right margin)
|
||||
['usually' applies here to languages with left-right and top-down
|
||||
writing direction like English]
|
||||
in this case there is only one target: xsl-region-body
|
||||
-->
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- each paragraph is encapsulated in a block element
|
||||
the attributes of the block define
|
||||
font-family and size, line-heigth etc. -->
|
||||
|
||||
<!-- this defines a title -->
|
||||
<fo:block font-size="18pt"
|
||||
font-family="sans-serif"
|
||||
line-height="24pt"
|
||||
space-after.optimum="15pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="center"
|
||||
padding-top="3pt">
|
||||
Extensible Markup Language (XML) 1.0
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- this defines normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="justify">
|
||||
The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML.
|
||||
</fo:block>
|
||||
|
||||
<!-- this defines normal text -->
|
||||
<fo:block font-size="12pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="justify">
|
||||
The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
|
||||
enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
|
||||
has been designed for ease of implementation and for interoperability with both SGML and HTML.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow> <!-- closes the flow element-->
|
||||
</fo:page-sequence> <!-- closes the page-sequence -->
|
||||
</fo:root>
|
||||
504
apache_fop/fop/examples/fo/basic/table.fo
Normal file
|
|
@ -0,0 +1,504 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
|
||||
<!-- defines the layout master -->
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<!-- starts actual layout -->
|
||||
<fo:page-sequence master-reference="first">
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<!-- this defines a title level 1-->
|
||||
<fo:block font-size="18pt"
|
||||
font-family="sans-serif"
|
||||
line-height="24pt"
|
||||
space-after.optimum="15pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="center"
|
||||
padding-top="3pt">
|
||||
How to use table elements
|
||||
</fo:block>
|
||||
|
||||
<!-- this defines a title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
space-after.optimum="15pt"
|
||||
text-align="center">
|
||||
A simple table, 3 columns, 4 rows
|
||||
</fo:block>
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>good</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>bad</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>ugly</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>nice</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>dice</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>vice</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>literature</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>music</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>art</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>java</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>perl</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>python</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<!-- table end -->
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
<!-- **************************** NEW PAGE ************************************* -->
|
||||
|
||||
<!-- this defines a title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
space-after.optimum="15pt"
|
||||
text-align="center"
|
||||
break-before="page">
|
||||
A table with borders
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- table start -->
|
||||
<fo:table border-width="0.5mm" border-style="solid" background-color="yellow" table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>good</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>bad</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>ugly</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>nice</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>dice</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>vice</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>literature</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>music</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>art</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>java</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>perl</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>python</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<!-- table end -->
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- **************************** NEW PAGE ************************************* -->
|
||||
|
||||
<!-- this defines a title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
space-after.optimum="15pt"
|
||||
text-align="center"
|
||||
break-before="page">
|
||||
A table with thick borders
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- table start -->
|
||||
<fo:table border-width="3mm" border-style="solid" background-color="yellow" table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>good</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>bad</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>ugly</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>nice</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>dice</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>vice</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>literature</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>music</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>art</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell ><fo:block>java</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>perl</fo:block></fo:table-cell>
|
||||
<fo:table-cell ><fo:block>python</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<!-- table end -->
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start" start-indent="-3mm">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- **************************** NEW PAGE ************************************* -->
|
||||
|
||||
<!-- this defines a title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
space-after.optimum="15pt"
|
||||
text-align="center"
|
||||
break-before="page">
|
||||
A table with borders around the cells
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>good</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>bad</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>ugly</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>nice</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>dice</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>vice</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>literature</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>music</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>art</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>java</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>perl</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow"><fo:block>python</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<!-- table end -->
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
<!-- **************************** NEW PAGE ************************************* -->
|
||||
|
||||
<!-- this defines a title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
space-after.optimum="15pt"
|
||||
text-align="center"
|
||||
break-before="page">
|
||||
2 tables with thick borders around the cells
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>good</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>bad</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>ugly</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>nice</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>dice</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>vice</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>literature</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>music</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>art</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>java</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>perl</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>python</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<!-- table end -->
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-column column-width="50mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>good</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>bad</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>ugly</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>nice</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>dice</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>vice</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>literature</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>music</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>art</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>java</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>perl</fo:block></fo:table-cell>
|
||||
<fo:table-cell border-width="2mm" border-style="solid" background-color="yellow"><fo:block>python</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
<!-- table end -->
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
<!-- **************************** NEW PAGE ************************************* -->
|
||||
|
||||
<!-- this defines a title level 2-->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
space-after.optimum="15pt"
|
||||
text-align="center"
|
||||
break-before="page">
|
||||
5 tables with borders
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:table border-width="1.5mm" border-style="solid" background-color="rgb(100,210,250)" table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="150mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell><fo:block>bad</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
|
||||
<fo:table border-width="1.5mm" border-style="solid" background-color="rgb(100,210,250)" table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="150mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell><fo:block>bad</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
|
||||
<fo:table border-width="1.5mm" border-style="solid" background-color="rgb(100,210,250)" table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="150mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell><fo:block>bad</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:table border-width="1.5mm" border-style="solid" background-color="rgb(100,210,250)" table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="150mm"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell><fo:block>bad</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<!-- normal text -->
|
||||
<fo:block text-align="start">this is normal text. this is normal text. this is normal text.
|
||||
this is normal text. this is normal text. this is normal text.
|
||||
</fo:block>
|
||||
|
||||
|
||||
<!-- **************************** NEW PAGE ************************************* -->
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
line-height="20pt"
|
||||
space-after.optimum="3pt"
|
||||
break-before="page"
|
||||
text-align="justify">
|
||||
A Contents table
|
||||
</fo:block>
|
||||
|
||||
<!-- Here starts the table -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="1cm"/>
|
||||
<fo:table-column column-width="15cm"/>
|
||||
<fo:table-body font-size="10pt" font-family="sans-serif">
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">A) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">What is FOP?</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">B) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">Downloading FOP</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">C) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">Running FOP</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">D) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">Embedding FOP </fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">E) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">What's Implemented?</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">F) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">Limitations</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">G) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">Bugs</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">H) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">Compiling FOP</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">I) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">Getting involved</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">J) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">FOP Relevant Specifications</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end">K) </fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start">Licence</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
220
apache_fop/fop/examples/fo/basic/tableunits.fo
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
|
||||
<!-- defines the layout master -->
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm" margin-bottom="1.5cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<!-- starts actual layout -->
|
||||
<fo:page-sequence master-reference="first">
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<fo:block space-after="1cm" text-align="start" padding="0.4in" border="thick solid red">Table unit tests</fo:block>
|
||||
|
||||
<fo:table border-collapse="separate" table-layout="fixed" width="6in">
|
||||
<fo:table-column column-width="(4.5in - 2cm) div 3 +1in" background-color="yellow"/>
|
||||
<fo:table-column column-width="(4.5in - 2cm) div 3 + 0.5in" background-color="blue"/>
|
||||
<fo:table-column column-width="(4.5in - 2cm) div 3 + 2.0cm" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>fixed width columns</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:table border-collapse="separate" table-layout="fixed" width="6in">
|
||||
<fo:table-column column-width="1in + proportional-column-width(1)" background-color="yellow"/>
|
||||
<fo:table-column column-width="2 * (proportional-column-width(1) + .5in) div 2" background-color="blue"/>
|
||||
<fo:table-column column-width="proportional-column-width(1) + 2.0cm" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell background-color="blue"><fo:block>default alignment
|
||||
</fo:block></fo:table-cell>
|
||||
<fo:table-cell height="3cm" background-color="green" display-align="center"><fo:block>Centered with height=3cm</fo:block></fo:table-cell>
|
||||
<fo:table-cell background-color="yellow" display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row height="3cm">
|
||||
<fo:table-cell><fo:block>default alignment but with a height
|
||||
of 3cm on the row </fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block space-before="12pt" space-after="6pt">The next table has width=100% on the table no column widths specified on the table-column element.</fo:block>
|
||||
<!-- table start -->
|
||||
<fo:table border-collapse="separate" table-layout="fixed" width="100%">
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="blue"/>
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block space-before="12pt" space-after="6pt">The next table has fixed column widths=13cm, ipd.optimum=12cm and ipd.max = 100%.</fo:block>
|
||||
<!-- table start -->
|
||||
<fo:table border-collapse="separate"
|
||||
table-layout="fixed" width="100%"
|
||||
inline-progression-dimension="12cm"
|
||||
inline-progression-dimension.maximum="100%"
|
||||
>
|
||||
<fo:table-column column-width="8cm" background-color="yellow"/>
|
||||
<fo:table-column column-width="proportional-column-width(2)" background-color="blue"/>
|
||||
<fo:table-column column-width="5cm" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block space-before="12pt" space-after="6pt">The next table has fixed column widths=16.5cm, ipd.optimum=14cm and ipd.max = 100% (16cm).</fo:block>
|
||||
<!-- table start -->
|
||||
<fo:table border-collapse="separate" table-layout="fixed"
|
||||
inline-progression-dimension="14cm"
|
||||
inline-progression-dimension.maximum="100%">
|
||||
<fo:table-column column-width="8.5cm" background-color="yellow"/>
|
||||
<fo:table-column column-width="proportional-column-width(2)" background-color="blue"/>
|
||||
<fo:table-column column-width="8cm" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block space-before="12pt" space-after="6pt">The next table has width="70% + 1cm" and fixed lengths and the first table-column has column-width="from-parent('width') div 3".</fo:block>
|
||||
<!-- table start -->
|
||||
<fo:table border-collapse="separate" table-layout="fixed" width="70% + 1cm">
|
||||
<fo:table-column column-width="from-parent('width') div 3" background-color="yellow"/>
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="blue"/>
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block space-before="12pt" space-after="6pt">
|
||||
The next table specifies inline-progression-dimension="15cm" instead of width. The
|
||||
middle column has a fixed width; the other two have default width.
|
||||
</fo:block>
|
||||
<!-- table start -->
|
||||
<fo:table border-collapse="separate"
|
||||
table-layout="fixed" width="100%"
|
||||
inline-progression-dimension="15cm">
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
|
||||
<fo:table-column column-width="3cm" background-color="blue"/>
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block space-before="12pt" space-after="6pt">
|
||||
The next table specifies neither width nor inline-progression-dimension.
|
||||
</fo:block>
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
|
||||
<fo:table-column column-width="3cm" background-color="blue"/>
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block space-before="12pt" space-after="6pt">
|
||||
The next table specifies inline-progression-dimension.minimum="10cm" and
|
||||
specifies a column width of 5cm on the middle column only.
|
||||
</fo:block>
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate"
|
||||
inline-progression-dimension.minimum="10cm">
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
|
||||
<fo:table-column column-width="5cm" background-color="blue"/>
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block space-before="12pt" space-after="6pt">
|
||||
The next table specifies inline-progression-dimension.minimum="10cm",
|
||||
inline-progression-dimension.maximum="17cm and
|
||||
specifies a column width of 5cm on the middle column only.
|
||||
</fo:block>
|
||||
<!-- table start -->
|
||||
<fo:table table-layout="fixed" width="100%" border-collapse="separate"
|
||||
inline-progression-dimension.minimum="10cm"
|
||||
inline-progression-dimension.maximum="17cm">
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
|
||||
<fo:table-column column-width="5cm" background-color="blue"/>
|
||||
<fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
|
||||
deeper than the others to check out the alignment properties.</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="center"><fo:block>Centered</fo:block></fo:table-cell>
|
||||
<fo:table-cell display-align="after"><fo:block>Bottom aligned</fo:block></fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
254
apache_fop/fop/examples/fo/basic/textdeko.fo
Normal file
|
|
@ -0,0 +1,254 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- simple example for text-decoration -->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- layout for the first page -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<!-- layout for the other pages -->
|
||||
<fo:simple-page-master master-name="rest"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="2.5cm"/>
|
||||
<fo:region-before extent="2.5cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="basicPSM" >
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference master-reference="first"
|
||||
page-position="first" />
|
||||
<fo:conditional-page-master-reference master-reference="rest"
|
||||
page-position="rest" />
|
||||
<!-- recommended fallback procedure -->
|
||||
<fo:conditional-page-master-reference master-reference="rest" />
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
<!-- end: defines page layout -->
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="basicPSM">
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<fo:block font-size="18pt" font-family="sans-serif" line-height="24pt" space-after.optimum="15pt"
|
||||
background-color="blue" color="white" text-align="center" padding-top="3pt">
|
||||
Simple example for text-decoration
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="10pt">
|
||||
The "text-decoration"-property describes decorations that are added to the text of an element.
|
||||
If the property is specified for a block-level element, it should affect all inline-level descendants
|
||||
of the element .
|
||||
If it is specified for (or affects) an inline-level
|
||||
element, it affects all boxes generated by the element.
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="13pt">
|
||||
Example: <fo:inline text-decoration="underline">underline</fo:inline>
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="13pt" text-decoration="underline">
|
||||
Block level example: underline
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="10pt">
|
||||
<fo:inline font-family="monospace"><![CDATA[<fo:inline text-decoration="underline">underline</fo:inline>]]></fo:inline>
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt"
|
||||
font-family="serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start">
|
||||
This is simple test of the text-decoration <fo:inline text-decoration="underline">underline</fo:inline>.
|
||||
</fo:block>
|
||||
<fo:block font-size="22pt"
|
||||
font-family="sans-serif"
|
||||
line-height="15pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start">
|
||||
This is simple test with a <fo:inline text-decoration="underline">bigger</fo:inline> font-size.
|
||||
</fo:block>
|
||||
<fo:block font-size="12pt"
|
||||
font-family="monospace"
|
||||
line-height="15pt"
|
||||
space-after.optimum="20pt"
|
||||
text-align="start">
|
||||
This is simple test with a <fo:inline text-decoration="underline">monospaced</fo:inline> font.
|
||||
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="3pt">
|
||||
The following text decorations are defined in the CR:
|
||||
</fo:block>
|
||||
|
||||
<fo:list-block space-after.optimum="13pt">
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="none">none</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="underline">underline</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="overline">overline</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="line-through">line-through</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="blink">blink</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="no-underline">no-underline</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="no-overline">no-overline</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="no-line-through">no-line-through</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="label-end()">
|
||||
<fo:block>•</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<fo:inline text-decoration="no-blink">no-blink</fo:inline>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
|
||||
</fo:list-block>
|
||||
|
||||
<fo:block font-size="12pt" space-after.optimum="3pt">
|
||||
<fo:inline text-decoration="underline overline">Combination</fo:inline> of property
|
||||
values should also be possible.
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="12pt" space-after.optimum="13pt">
|
||||
<fo:inline font-family="monospace"><![CDATA[<fo:inline text-decoration="underline overline">
|
||||
Combination</fo:inline>]]></fo:inline>
|
||||
</fo:block>
|
||||
|
||||
|
||||
<fo:block space-after.optimum="13pt">
|
||||
And now <fo:inline text-decoration="underline">more than a word ...</fo:inline>
|
||||
</fo:block>
|
||||
|
||||
<fo:block space-after.optimum="13pt" font-size="14pt" text-decoration="underline">
|
||||
This is a whole block with the property text-decoration="underline".
|
||||
Some more Text to get at least two lines.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-family="sans-serif"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start"
|
||||
text-decoration="underline">
|
||||
This is a whole block with the property text-decoration="underline" and an inline with text-decoration="overline" <fo:inline font-size="22pt" text-decoration="overline">bigger font-size</fo:inline>.
|
||||
</fo:block>
|
||||
<fo:block font-size="15pt"
|
||||
font-family="monospace"
|
||||
line-height="15pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start">
|
||||
This is simple test with a <fo:inline text-decoration="line-through">monospaced font</fo:inline>.
|
||||
</fo:block>
|
||||
|
||||
<fo:block font-size="15pt"
|
||||
line-height="15pt"
|
||||
space-after.optimum="10pt"
|
||||
text-align="start">
|
||||
What about underlining of whitespace only<fo:inline text-decoration="underline"> </fo:inline>?
|
||||
</fo:block>
|
||||
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
164
apache_fop/fop/examples/fo/build.xml
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
<?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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
-->
|
||||
<!-- =========================================================================== -->
|
||||
<project default="newPDF" basedir=".">
|
||||
<!-- =================================================================== -->
|
||||
<!-- Initialization target -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="init">
|
||||
<tstamp/>
|
||||
<mkdir dir="tests"/>
|
||||
<property name="referenceDir" value="reference"/>
|
||||
<property name="testDir" value="tests"/>
|
||||
<property name="foDir" value="fo"/>
|
||||
<path id="run-classpath">
|
||||
<fileset dir="../../lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<pathelement location="../../build/fop.jar"/>
|
||||
</path>
|
||||
<taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop" classpathref="run-classpath"/>
|
||||
<taskdef name="compare" classname="org.apache.fop.tools.anttasks.FileCompare" classpathref="run-classpath"/>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Help on usage -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="usage">
|
||||
<echo message="Use '-projecthelp' instead"/>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Produces new test files (function) -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="newTestFiles">
|
||||
<fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" relativebase="true" throwexceptions="false">
|
||||
<fileset dir="basic">
|
||||
<include name="**/*.fo"/>
|
||||
</fileset>
|
||||
<fileset dir="footnotes">
|
||||
<include name="**/*.fo"/>
|
||||
</fileset>
|
||||
<fileset dir="pagination">
|
||||
<include name="**/*.fo"/>
|
||||
</fileset>
|
||||
<fileset dir="keeps_and_breaks">
|
||||
<include name="**/*.fo"/>
|
||||
</fileset>
|
||||
<fileset dir="markers">
|
||||
<include name="**/*.fo"/>
|
||||
</fileset>
|
||||
<fileset dir="region_body">
|
||||
<include name="**/*.fo"/>
|
||||
</fileset>
|
||||
<fileset dir="tables">
|
||||
<include name="**/*.fo"/>
|
||||
</fileset>
|
||||
<fileset dir="svg">
|
||||
<include name="**/*.fo"/>
|
||||
</fileset>
|
||||
<fileset dir="advanced">
|
||||
<include name="**/giro.fo"/>
|
||||
</fileset>
|
||||
</fop>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Produces new test PDF files -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="newPDF" depends="init" description="Creates a new set of PDF test files">
|
||||
<antcall target="newTestFiles">
|
||||
<param name="mimetype" value="application/pdf"/>
|
||||
<param name="msglevel" value="warn"/>
|
||||
<param name="outDir" value="${testDir}"/>
|
||||
</antcall>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Produces new test RTF files -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="newRTF" depends="init" description="Creates a new set of RTF test files">
|
||||
<antcall target="newTestFiles">
|
||||
<param name="mimetype" value="application/rtf"/>
|
||||
<param name="msglevel" value="warn"/>
|
||||
<param name="outDir" value="${testDir}"/>
|
||||
</antcall>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Produces new test PS files -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="newPS" depends="init" description="Creates a new set of PostScript test files">
|
||||
<antcall target="newTestFiles">
|
||||
<param name="mimetype" value="application/postscript"/>
|
||||
<param name="msglevel" value="warn"/>
|
||||
<param name="outDir" value="${testDir}"/>
|
||||
</antcall>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Produces new test AFP files -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="newAFP" depends="init" description="Creates a new set of AFP test files">
|
||||
<antcall target="newTestFiles">
|
||||
<param name="mimetype" value="application/x-afp"/>
|
||||
<param name="msglevel" value="warn"/>
|
||||
<param name="outDir" value="${testDir}"/>
|
||||
</antcall>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Produces new test areatree files -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="newAT" depends="init" description="Creates a new set of AreaTree XML test files">
|
||||
<antcall target="newTestFiles">
|
||||
<param name="mimetype" value="text/xml"/>
|
||||
<param name="msglevel" value="warn"/>
|
||||
<param name="outDir" value="${testDir}"/>
|
||||
</antcall>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Compares new test pdf files to reference pdf files -->
|
||||
<!-- N.B. All comparisons fail due to differences in /CreationDate -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="comparePDF" depends="newPDF">
|
||||
<compare referenceDirectory="${referenceDir}" testDirectory="${testDir}" filenames="normal.pdf,table.pdf,list.pdf,link.pdf,border.pdf,images.pdf,extensive.pdf,readme.pdf,fonts.pdf,bordershorthand.pdf,character.pdf,corresprop.pdf,hyphen.pdf,inhprop.pdf,instream.pdf,leader.pdf,newlinktest.pdf,normalex.pdf,pdfoutline.pdf,simple.pdf,textdeko.pdf,tableunits.pdf"/>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Produces new reference pdf files -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="referencePDF" depends="init">
|
||||
<antcall target="newTestFiles">
|
||||
<param name="mimetype" value="application/pdf"/>
|
||||
<param name="msglevel" value="warn"/>
|
||||
<param name="outDir" value="${referenceDir}"/>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<!-- =================================================================== -->
|
||||
<!-- Starts the test -->
|
||||
<!-- N.B. All tests fail due to differences in /CreationDate -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="runtest" depends="comparePDF">
|
||||
<echo message="Running Fop tests"/>
|
||||
</target>
|
||||
<!-- =================================================================== -->
|
||||
<!-- Clean targets -->
|
||||
<!-- =================================================================== -->
|
||||
<target name="clean" depends="init">
|
||||
<delete dir="${testDir}"/>
|
||||
</target>
|
||||
<target name="cleantest" depends="init">
|
||||
<delete dir="${referenceDir}"/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
<!-- End of file -->
|
||||
217
apache_fop/fop/examples/fo/fo-reference/xml2pdf.xsl
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
<!--
|
||||
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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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$ -->
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<xsl:template match ="root">
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<!-- defines page layout -->
|
||||
<fo:layout-master-set>
|
||||
|
||||
<fo:simple-page-master master-name="simple"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1.5cm"
|
||||
margin-bottom="1.5cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="1.5cm"/>
|
||||
<fo:region-before extent="1.5cm"/>
|
||||
<fo:region-after extent="1.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="simple">
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block text-align="end"
|
||||
font-size="10pt"
|
||||
font-family="serif"
|
||||
line-height="14pt" >
|
||||
xsl:fo short reference - p. <fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
|
||||
<fo:block font-size="18pt"
|
||||
font-family="sans-serif"
|
||||
line-height="24pt"
|
||||
space-after.optimum="15pt"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
text-align="center">
|
||||
xsl:fo short reference
|
||||
</fo:block>
|
||||
|
||||
<!-- generates table of contents and puts it into a table -->
|
||||
|
||||
<fo:block font-size="10pt"
|
||||
font-family="sans-serif"
|
||||
line-height="10pt"
|
||||
space-after.optimum="3pt"
|
||||
font-weight="bold"
|
||||
start-indent="15pt">
|
||||
Content
|
||||
</fo:block>
|
||||
|
||||
<fo:table space-after.optimum="15pt">
|
||||
<fo:table-column column-width="1cm"/>
|
||||
<fo:table-column column-width="15cm"/>
|
||||
<fo:table-body font-size="10pt"
|
||||
font-family="sans-serif">
|
||||
|
||||
<xsl:for-each select="div0/head">
|
||||
<fo:table-row line-height="12pt">
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="end" >
|
||||
<xsl:number value="position()" format="1"/>)
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="start" >
|
||||
<xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</xsl:for-each>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<xsl:apply-templates/>
|
||||
<fo:block font-size="10pt"
|
||||
font-family="sans-serif"
|
||||
line-height="11pt"
|
||||
space-before.optimum="2cm">
|
||||
The explanation of the flow objects is based (mostly verbatim) on the section
|
||||
6.2 of the XSL W3C Candidate Recommendation 21 November 2000. More info at the beginning
|
||||
of the file xslfoRef.xml.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match ="div">
|
||||
<fo:block font-size="14pt"
|
||||
font-family="sans-serif"
|
||||
space-before.optimum="3pt"
|
||||
space-after.optimum="3pt"
|
||||
text-align="center"
|
||||
padding-top="3pt"
|
||||
>
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match ="div0/head">
|
||||
<fo:block font-size="16pt"
|
||||
line-height="18pt"
|
||||
text-align="center"
|
||||
padding-top="3pt"
|
||||
start-indent="2cm"
|
||||
end-indent="2cm"
|
||||
background-color="blue"
|
||||
color="white"
|
||||
space-before.optimum="5pt"
|
||||
space-after.optimum="5pt"
|
||||
>
|
||||
<xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match ="div/fo">
|
||||
<fo:block font-size="13pt"
|
||||
line-height="14pt"
|
||||
text-align="start"
|
||||
>
|
||||
<xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match ="explanation">
|
||||
<fo:block font-size="11pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
text-align="start"
|
||||
start-indent="0.5cm"
|
||||
>
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match ="div/content">
|
||||
<fo:block font-size="10pt"
|
||||
font-family="Courier"
|
||||
start-indent="0.5cm"
|
||||
line-height="11pt"
|
||||
text-align="start"
|
||||
wrap-option="wrap">
|
||||
Content: <xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match ="div/properties">
|
||||
<fo:block font-size="10pt"
|
||||
font-family="Courier"
|
||||
line-height="11pt"
|
||||
text-align="start"
|
||||
start-indent="0.5cm">
|
||||
Properties:
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="3pt">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match ="properties/property">
|
||||
<fo:block font-size="9pt"
|
||||
font-family="sans-serif"
|
||||
line-height="10pt"
|
||||
text-align="start"
|
||||
start-indent="1cm">
|
||||
<xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match ="div/property-def">
|
||||
<fo:block font-size="13pt"
|
||||
line-height="14pt"
|
||||
text-align="start"
|
||||
>
|
||||
<xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match ="div/values">
|
||||
<fo:block font-size="11pt"
|
||||
text-align="start"
|
||||
line-height="12pt">Values: <xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
1809
apache_fop/fop/examples/fo/fo-reference/xslfoRef.xml
Normal file
249
apache_fop/fop/examples/fo/footnotes/columns.fo
Normal file
|
|
@ -0,0 +1,249 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<!-- defines page layout -->
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- layout for the first page -->
|
||||
<fo:simple-page-master master-name="first"
|
||||
page-height="11in"
|
||||
page-width="8.5in"
|
||||
margin-top="1in"
|
||||
margin-bottom="1in"
|
||||
margin-left="0.75in"
|
||||
margin-right="0.75in">
|
||||
<fo:region-body
|
||||
margin-top="1in" margin-bottom="1in"
|
||||
column-count="2" column-gap="0.25in"/>
|
||||
<fo:region-before extent="1in"/>
|
||||
<fo:region-after extent="1in"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:simple-page-master master-name="next"
|
||||
page-height="11in"
|
||||
page-width="8.5in"
|
||||
margin-top="1in"
|
||||
margin-bottom="1in"
|
||||
margin-left="0.75in"
|
||||
margin-right="0.75in">
|
||||
<fo:region-body
|
||||
margin-top="1in" margin-bottom="1in"
|
||||
column-count="4" column-gap="0.25in"/>
|
||||
<fo:region-before extent="1in"/>
|
||||
<fo:region-after extent="1in"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
|
||||
<!-- actual layout -->
|
||||
<fo:page-sequence master-reference="first">
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
line-height="normal"
|
||||
text-align="start"
|
||||
color="blue">Footnotes in Columns</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="10pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
space-before.optimum="6pt"
|
||||
text-align="end"
|
||||
color="blue">Page #</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block color="grey">
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
</fo:block>
|
||||
<fo:block color="red">
|
||||
The <fo:footnote>
|
||||
<fo:inline font-weight="bold">footnote<fo:inline font-size="6pt" vertical-align="super">1</fo:inline></fo:inline>
|
||||
<fo:footnote-body>
|
||||
<fo:block color="maroon">
|
||||
1. A footnote is text placed at the bottom of the current page.
|
||||
</fo:block>
|
||||
</fo:footnote-body>
|
||||
</fo:footnote>
|
||||
at the bottom of the page.
|
||||
</fo:block>
|
||||
<fo:block color="grey">
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
</fo:block>
|
||||
<fo:block color="green">
|
||||
The <fo:footnote>
|
||||
<fo:inline font-weight="bold">second footnote<fo:inline font-size="6pt" vertical-align="super">2</fo:inline></fo:inline>
|
||||
<fo:footnote-body>
|
||||
<fo:block color="darkgreen">
|
||||
2. Another footnote with a bit more text.
|
||||
</fo:block>
|
||||
</fo:footnote-body>
|
||||
</fo:footnote>
|
||||
at the bottom of the page after the other footnote.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
|
||||
<fo:page-sequence master-reference="next">
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block font-size="16pt"
|
||||
font-family="sans-serif"
|
||||
line-height="normal"
|
||||
text-align="start"
|
||||
color="blue">Footnotes in Columns</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="10pt"
|
||||
font-family="sans-serif"
|
||||
line-height="12pt"
|
||||
space-before.optimum="6pt"
|
||||
text-align="end"
|
||||
color="blue">Page #</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block color="grey">
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
</fo:block>
|
||||
<fo:block color="red">
|
||||
The <fo:footnote>
|
||||
<fo:inline font-weight="bold">footnote<fo:inline font-size="6pt" vertical-align="super">1</fo:inline></fo:inline>
|
||||
<fo:footnote-body>
|
||||
<fo:block color="maroon">
|
||||
1. A footnote is text placed at the bottom of the current page.
|
||||
</fo:block>
|
||||
</fo:footnote-body>
|
||||
</fo:footnote>
|
||||
at the bottom of the page.
|
||||
</fo:block>
|
||||
<fo:block color="grey">
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
What shall we use to fill the empty spaces,
|
||||
Where we used to talk?
|
||||
How shall I fill the final places?
|
||||
How shall I complete the wall?
|
||||
</fo:block>
|
||||
<fo:block color="green">
|
||||
The <fo:footnote>
|
||||
<fo:inline font-weight="bold">second footnote<fo:inline font-size="6pt" vertical-align="super">2</fo:inline></fo:inline>
|
||||
<fo:footnote-body>
|
||||
<fo:block color="darkgreen">
|
||||
2. Another footnote with a bit more text.
|
||||
</fo:block>
|
||||
</fo:footnote-body>
|
||||
</fo:footnote>
|
||||
at the bottom of the page after the other footnote.
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
122
apache_fop/fop/examples/fo/footnotes/simple.fo
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
<?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 master-name="one"
|
||||
margin-right="0.5cm"
|
||||
margin-left="1.5cm"
|
||||
margin-bottom="2cm"
|
||||
margin-top="0cm"
|
||||
page-width="21cm"
|
||||
page-height="20cm">
|
||||
<fo:region-body margin-bottom="2cm" margin-top="2cm"/>
|
||||
<fo:region-before extent="0.5cm"/>
|
||||
<fo:region-after extent="0.5cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="one">
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<fo:block space-after.optimum="10pt" font-weight="bold" font-size="16pt" text-align="center">
|
||||
Footnotes
|
||||
</fo:block>
|
||||
|
||||
<fo:block color="red">
|
||||
The <fo:footnote>
|
||||
<fo:inline font-weight="bold">footnote<fo:inline font-size="6pt" vertical-align="super">1</fo:inline></fo:inline>
|
||||
<fo:footnote-body>
|
||||
<fo:block color="maroon">
|
||||
1. A footnote is text placed at the bottom of the current or the next page.
|
||||
</fo:block>
|
||||
</fo:footnote-body>
|
||||
</fo:footnote>
|
||||
at the bottom of the page.
|
||||
</fo:block>
|
||||
<fo:block color="green">
|
||||
The <fo:footnote>
|
||||
<fo:inline font-weight="bold">second footnote<fo:inline font-size="6pt" vertical-align="super">2</fo:inline></fo:inline>
|
||||
<fo:footnote-body>
|
||||
<fo:block color="darkgreen">
|
||||
2. Another footnote with a bit more text.
|
||||
</fo:block>
|
||||
</fo:footnote-body>
|
||||
</fo:footnote>
|
||||
at the bottom of the page after the other footnote.
|
||||
</fo:block>
|
||||
<fo:block space-before.optimum="200pt" color="grey">
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
This text is used to show the body region area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block break-before="page">
|
||||
This is for testing if a footnote cannot fit with the footnote
|
||||
reference text.
|
||||
</fo:block>
|
||||
<fo:block color="grey" space-before.optimum="300pt">
|
||||
Some filler text with no other purpose.
|
||||
Some filler text with no other purpose.
|
||||
Some filler text with no other purpose.
|
||||
Some filler text with no other purpose.
|
||||
Some filler text with no other purpose.
|
||||
Some filler text with no other purpose.
|
||||
Some filler text with no other purpose.
|
||||
Some filler text with no other purpose.
|
||||
</fo:block>
|
||||
<fo:block color="blue">
|
||||
This <fo:footnote>
|
||||
<fo:inline font-weight="bold">footnote</fo:inline>
|
||||
<fo:footnote-body>
|
||||
<fo:block color="darkblue">
|
||||
A footnote with too much text to fit on the same page as the reference. Also the
|
||||
reference is in the same place as the conditional footnote reference text.
|
||||
</fo:block>
|
||||
</fo:footnote-body>
|
||||
</fo:footnote>
|
||||
is at the bottom of the page where the conditional footnote reference area is.
|
||||
|
||||
</fo:block>
|
||||
|
||||
<fo:block break-before="page">
|
||||
This page also has a footnote and should have the footnote from the last page.
|
||||
</fo:block>
|
||||
<fo:block color="grey" space-before.optimum="150pt">
|
||||
More boring filler text.
|
||||
More boring filler text.
|
||||
More boring filler text.
|
||||
</fo:block>
|
||||
<fo:block color="fuchsia">
|
||||
This <fo:footnote>
|
||||
<fo:inline font-weight="bold">footnote</fo:inline>
|
||||
<fo:footnote-body>
|
||||
<fo:block color="purple">
|
||||
Another footnote.
|
||||
</fo:block>
|
||||
</fo:footnote-body>
|
||||
</fo:footnote>
|
||||
is at the bottom of the page after the footnote from the previous page.
|
||||
|
||||
</fo:block>
|
||||
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
BIN
apache_fop/fop/examples/fo/graphics/asf-logo-nt.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
apache_fop/fop/examples/fo/graphics/asf-logo.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
apache_fop/fop/examples/fo/graphics/asf-logo.tif
Normal file
BIN
apache_fop/fop/examples/fo/graphics/fop.jpg
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
apache_fop/fop/examples/fo/graphics/linux.bmp
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
apache_fop/fop/examples/fo/graphics/listgeometry.gif
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
apache_fop/fop/examples/fo/graphics/page.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
apache_fop/fop/examples/fo/graphics/xml_fax.tif
Normal file
BIN
apache_fop/fop/examples/fo/graphics/xml_feather.gif
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
apache_fop/fop/examples/fo/graphics/xml_feather_transparent.gif
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
289
apache_fop/fop/examples/fo/keeps_and_breaks/columnlevel1.fo
Normal file
|
|
@ -0,0 +1,289 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
This file addresses breaks in column context.
|
||||
-->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<!-- layout for all pages -->
|
||||
<fo:simple-page-master master-name="all"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body
|
||||
margin-top="3cm" margin-bottom="2cm"
|
||||
column-count="2" column-gap="0.25in"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="2cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="all">
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="10pt" text-align="start"
|
||||
border-style="solid" border-color="blue" border-width="0.5pt"
|
||||
space-before.optimum="6pt">
|
||||
Text excerpt from XSL Candidate Recommendation, 21 Nov 2000.
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are either break-before or break-before conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-before condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="column">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="column"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in a column context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-before
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-before trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="column">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="column"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in a column context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
<fo:block span="all">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="2.0pt"
|
||||
leader-length="14cm"
|
||||
space-before.optimum="0pt"
|
||||
space-after.optimum="12pt"
|
||||
start-indent="1cm"
|
||||
end-indent="1cm"
|
||||
background-color="blue"
|
||||
color="yellow"/>
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-after="column">
|
||||
This is a block with a <fo:inline font-style="italic">break-after="column"
|
||||
</fo:inline> break condition. This condition is satisfied if there is
|
||||
no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the
|
||||
first normal area generated by the next FO is leading in a column
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are either break-before or break-before conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-before condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-before
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-before trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-after="column">
|
||||
This is a block with a <fo:inline font-style="italic">break-after="column"
|
||||
</fo:inline> break condition. This condition is satisfied if there is
|
||||
no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the
|
||||
first normal area generated by the next FO is leading in a column context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
|
||||
137
apache_fop/fop/examples/fo/keeps_and_breaks/pagelevel1.fo
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
This file addresses breaks in page context.
|
||||
-->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<!-- layout for all pages -->
|
||||
<fo:simple-page-master master-name="all"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm" margin-bottom="2cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="2cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="all">
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="10pt" text-align="start"
|
||||
border-style="solid" border-color="blue" border-width="0.5pt">
|
||||
Text excerpt from XSL Candidate Recommendation, 21 Nov 2000.
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
break-after="page">
|
||||
<fo:inline color="red">break-after="page"</fo:inline>
|
||||
Break conditions are either break-before or break-after conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-after condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-after
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-after trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
break-before="page">
|
||||
<fo:inline color="red">break-before="page"</fo:inline>
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
|
||||
292
apache_fop/fop/examples/fo/keeps_and_breaks/pagelevel2.fo
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
This file addresses break-after's in page context.
|
||||
-->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<!-- layout for all pages -->
|
||||
<fo:simple-page-master master-name="all"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm" margin-bottom="2cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="2cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="all">
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="10pt" text-align="start"
|
||||
border-style="solid" border-color="blue" border-width="0.5pt"
|
||||
space-before.optimum="6pt">
|
||||
Text excerpt from XSL Candidate Recommendation, 21 Nov 2000.
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are either break-before or break-after conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-after condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-after="even-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-after="even-page"
|
||||
</fo:inline> break condition. This condition is satisfied if there is
|
||||
no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the
|
||||
first normal area generated by the next FO is leading in an even-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-after
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-after trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-after="even-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-after="even-page"
|
||||
</fo:inline> break condition. This condition is satisfied if there is
|
||||
no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the
|
||||
first normal area generated by the next FO is leading in an even-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="2.0pt"
|
||||
leader-length="14cm"
|
||||
space-before.optimum="0pt"
|
||||
space-after.optimum="12pt"
|
||||
start-indent="1cm"
|
||||
end-indent="1cm"
|
||||
background-color="blue"
|
||||
color="yellow"/>
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-after="odd-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-after="odd-page"
|
||||
</fo:inline> break condition. This condition is satisfied if there is
|
||||
no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the
|
||||
first normal area generated by the next FO is leading in an odd-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are either break-before or break-after conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-after condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-after
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-after trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-after="odd-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-after="odd-page"
|
||||
</fo:inline> break condition. This condition is satisfied if there is
|
||||
no next formatting object, <fo:inline font-weight="bold">or</fo:inline> the
|
||||
first normal area generated by the next FO is leading in an odd-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
|
||||
288
apache_fop/fop/examples/fo/keeps_and_breaks/pagelevel3.fo
Normal file
|
|
@ -0,0 +1,288 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
This file addresses break-before's in page context.
|
||||
-->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<!-- layout for all pages -->
|
||||
<fo:simple-page-master master-name="all"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body margin-top="3cm" margin-bottom="2cm"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="2cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="all">
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="10pt" text-align="start"
|
||||
border-style="solid" border-color="blue" border-width="0.5pt"
|
||||
space-before.optimum="6pt">
|
||||
Text excerpt from XSL Candidate Recommendation, 21 Nov 2000.
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are either break-before or break-before conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-before condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="even-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="even-page"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in an even-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-before
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-before trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="even-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="even-page"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in an even-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
<fo:block>
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="2.0pt"
|
||||
leader-length="14cm"
|
||||
space-before.optimum="0pt"
|
||||
space-after.optimum="12pt"
|
||||
start-indent="1cm"
|
||||
end-indent="1cm"
|
||||
background-color="blue"
|
||||
color="yellow"/>
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="odd-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="odd-page"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in an odd-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are either break-before or break-before conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-before condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-before
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-before trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="odd-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="odd-page"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in an odd-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
|
||||
291
apache_fop/fop/examples/fo/keeps_and_breaks/pagelevel4.fo
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
This file addresses breaks in page context, with a
|
||||
2-column layout.
|
||||
-->
|
||||
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<!-- layout for all pages -->
|
||||
<fo:simple-page-master master-name="all"
|
||||
page-height="29.7cm"
|
||||
page-width="21cm"
|
||||
margin-top="1cm"
|
||||
margin-bottom="2cm"
|
||||
margin-left="2.5cm"
|
||||
margin-right="2.5cm">
|
||||
<fo:region-body
|
||||
margin-top="3cm" margin-bottom="2cm"
|
||||
column-count="2" column-gap="0.25in"/>
|
||||
<fo:region-before extent="3cm"/>
|
||||
<fo:region-after extent="2cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="all">
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="10pt" text-align="start"
|
||||
border-style="solid" border-color="blue" border-width="0.5pt"
|
||||
space-before.optimum="6pt">
|
||||
Text excerpt from XSL Candidate Recommendation, 21 Nov 2000.
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are either break-before or break-before conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-before condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="even-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="even-page"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in an even-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-before
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-before trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="even-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="even-page"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in an even-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
<fo:block span="all">
|
||||
<fo:leader leader-pattern="rule"
|
||||
rule-thickness="2.0pt"
|
||||
leader-length="14cm"
|
||||
space-before.optimum="0pt"
|
||||
space-after.optimum="12pt"
|
||||
start-indent="1cm"
|
||||
end-indent="1cm"
|
||||
background-color="blue"
|
||||
color="yellow"/>
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep and break conditions apply to a class of areas, which are typically
|
||||
page-reference-areas, column-areas, and line-areas. The appropriate class
|
||||
for a given condition is referred to as a context and an area in this
|
||||
class is a context-area. As defined in Section 6.4.1, page-reference-areas
|
||||
are areas generated by an fo:page-sequence using the specifications in a
|
||||
fo:page-master, and column-areas are normal-flow-reference-areas generated
|
||||
from a region-body, or region-reference-areas generated from other types
|
||||
of region-master.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
A keep or break condition is an open statement about a formatting object
|
||||
and the tree relationships of the areas it generates with the relevant
|
||||
context-areas. These tree relationships are defined mainly in terms of
|
||||
leading or trailing areas. If A is a descendant of P, then A is defined
|
||||
to be leading in P if A has no preceding sibling which is a normal area,
|
||||
nor does any of its ancestor areas up to but not including P. Similarly,
|
||||
A is defined to be trailing in P if A has no following sibling which is
|
||||
a normal area, nor does any of its ancestor areas up to but not including P.
|
||||
For any given formatting object, the next formatting object in the flow is
|
||||
the first formatting object following (in the pre-order traversal order)
|
||||
which generates and returns normal areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="odd-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="odd-page"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in an odd-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are either break-before or break-before conditions.
|
||||
A break-before condition is satisfied if the first area generated and
|
||||
returned by the formatting object is leading within a context-area. A
|
||||
break-before condition depends on the next formatting object in the flow;
|
||||
it is satisfied if either there is no such next formatting object, or
|
||||
if the first normal area generated and returned by that formatting
|
||||
object is leading in a context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Break conditions are imposed by the break-before and break-before
|
||||
properties. A refined value of page for these traits imposes a break
|
||||
condition with a context consisting of the page-reference-areas; a
|
||||
value of even-page or odd-page imposes a break condition with a
|
||||
context of even-numbered page-reference-areas or odd-numbered page
|
||||
reference-areas, respectively; a value of column imposes a break
|
||||
condition with a context of column-areas. A value of auto in a
|
||||
break-before or break-before trait imposes no break condition.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are either keep-with-previous, keep-with-next, or
|
||||
keep-together conditions. A keep-with-previous condition on an
|
||||
object is satisfied if the first area generated and returned by
|
||||
the formatting object is not leading within a context-area, or
|
||||
if there are no preceding areas in a post-order traversal of the
|
||||
area tree. A keep-with-next condition is satisfied if the last
|
||||
area generated and returned by the formatting object is not
|
||||
trailing within a context-area, or if there are no following
|
||||
areas in a pre-order traversal of the area tree. A keep-together
|
||||
condition is satisfied if all areas generated and returned by
|
||||
the formatting object are descendants of a single context-area.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
Keep conditions are imposed by the "within-page", "within-column",
|
||||
and "within-line" components of the "keep-with-previous",
|
||||
"keep-with-next", and "keep-together" properties. The refined value
|
||||
of each component specifies the strength of the keep condition
|
||||
imposed, with higher numbers being stronger than lower numbers and
|
||||
the value always being stronger than all numeric values. A component
|
||||
with value auto does not impose a keep condition. A "within-page"
|
||||
component imposes a keep-condition with context consisting of the
|
||||
page-reference-areas; "within-column", with context consisting of
|
||||
the column-areas; and "within-line" with context consisting of the
|
||||
line-areas.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt"
|
||||
color="blue"
|
||||
break-before="odd-page">
|
||||
This is a block with a <fo:inline font-style="italic">break-before="odd-page"
|
||||
</fo:inline> break condition. This condition is satisfied if the
|
||||
first normal area generated by this FO is leading in an odd-page
|
||||
context.
|
||||
</fo:block>
|
||||
|
||||
<fo:block
|
||||
font-size="14pt" font-family="sans-serif"
|
||||
line-height="18pt" space-after.optimum="15pt">
|
||||
The area tree is constrained to satisfy all break conditions imposed.
|
||||
Each keep condition must also be satisfied, except when this would
|
||||
cause a break condition or a stronger keep condition to fail to be
|
||||
satisfied. If not all of a set of keep conditions of equal strength
|
||||
can be satisfied, then some maximal satisfiable subset of conditions
|
||||
of that strength must be satisfied (together with all break conditions
|
||||
and maximal subsets of stronger keep conditions, if any).
|
||||
</fo:block>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
|
||||