17.2.1機能説明
ページレベルで透かしを定義します。
透かしを出力する領域を定義し、領域内に文字、イメージ、図形などを配置します。
定義した領域を、ページサイズとの比率で大きさを変え出力することも可能です。
透かしには以下の出力方法があります。
出力方法 | 指定内容 | 説明 |
座標指定 | position | 左下からの相対座標で出力位置を指定します |
ページ幅との比率指定 | horizon | ページの幅との比率で透かしの大きさを指定します |
ページ高さとの比率指定 | vertical | ページの高さとの比率で透かしの大きさを指定します |
ページ幅・高さのうち短いほうとの比率指定 | shorter | ページの幅と高さのどちらか小さいほうとの比率で透かしの大きさを指定します |
ページ幅・高さのうち長いほうとの比率指定 | longer | ページの幅と高さのどちらか大きいほうとの比率で透かしの大きさを指定します |
ページ面積との比率指定 | area | ページの面積との比率で透かしの大きさを指定します |
17.2.3記述例
watermarkサンプル1
fit属性をpositionに設定したサンプルです。
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Width="300pt" Height="400pt" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:bs="http://www.brainsellers.com/schema" xmlns:svg="http://www.brainsellers.com/schema" xmlns:form="http://www.brainsellers.com/schema" xmlns:pdf="http://www.brainsellers.com/schema" version="5.0.0">
<watermark x="10px" y="10px" dx="-0.833" dy="-0.943" width="180px" height="50px" text-align="center" line-align="center" align="vertical" print="true" view="true" fit="position">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">Copyright(c) 2017</watermark-text>
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">BrainSellers.com Corporation</watermark-text>
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">All rights reserved.</watermark-text>
</watermark>
</Layout>
透かしの大きさは変わらず、指定した座標(10px,10px)に
出力されます。
watermarkサンプル2
fit属性をhorizonに設定したサンプルです。
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Width="300pt" Height="400pt" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:bs="http://www.brainsellers.com/schema" xmlns:svg="http://www.brainsellers.com/schema" xmlns:form="http://www.brainsellers.com/schema" xmlns:pdf="http://www.brainsellers.com/schema" version="5.0.0">
<watermark x="22.931" y="63.5" dx="0" dy="0" width="170px" height="40px" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="50" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">Copyright(c) 2017</watermark-text>
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">BrainSellers.com Corporation</watermark-text>
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">All rights reserved.</watermark-text>
</watermark>
</Layout>
ページの幅に対して50%の大きさで透かしを出力します。
透かし自体の領域の大きさと比率により、透かしの大きさは増減します。
watermarkサンプル3
align属性をverticalに設定したサンプルです。
)
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Width="200pt" Height="200pt" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:bs="http://www.brainsellers.com/schema" xmlns:svg="http://www.brainsellers.com/schema" xmlns:form="http://www.brainsellers.com/schema" xmlns:pdf="http://www.brainsellers.com/schema" version="5.0.0">
<watermark x="31.044" y="32.456" dx="0" dy="0" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">中央</watermark-text>
</watermark>
<watermark x="0" y="64.911" dx="-1" dy="1" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">左上</watermark-text>
</watermark>
<watermark x="0" y="0" dx="-1" dy="-1" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">左下</watermark-text>
</watermark>
<watermark x="62.089" y="64.911" dx="1" dy="1" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">右上</watermark-text>
</watermark>
<watermark x="62.089" y="0" dx="1" dy="-1" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">右下</watermark-text>
</watermark>
</Layout>
watermarkサンプル4
dx,dy 属性による表示位置を設定したサンプルです。
fit 属性がposition 以外の場合、初期値で中央揃えになります。
dx,dy 属性で相対的な座標を指定することが可能です。
水平方向(dx 属性)は中心を0 として右端が1、左端が-1 となります。
垂直方向(dy 属性)は中心を0 として上端が1、下端が-1 となります。
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Width="200pt" Height="200pt" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:bs="http://www.brainsellers.com/schema" xmlns:svg="http://www.brainsellers.com/schema" xmlns:form="http://www.brainsellers.com/schema" xmlns:pdf="http://www.brainsellers.com/schema" version="5.0.0">
<watermark x="31.044" y="32.456" dx="0" dy="0" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">中央</watermark-text>
</watermark>
<watermark x="0" y="64.911" dx="-1" dy="1" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">左上</watermark-text>
</watermark>
<watermark x="0" y="0" dx="-1" dy="-1" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">左下</watermark-text>
</watermark>
<watermark x="62.089" y="64.911" dx="1" dy="1" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">右上</watermark-text>
</watermark>
<watermark x="62.089" y="0" dx="1" dy="-1" width="" height="" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="30" fit="horizon">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="0,0,255" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">右下</watermark-text>
</watermark>
</Layout>
①中央 dx="0" dy="0"
②左上 dx="-1" dy="1"
③左下 dx="-1" dy="-1"
④右上 dx="1" dy="1"
⑤右下 dx="1" dy="-1"
watermarkサンプル5
mode属性をfrontに設定したサンプルです。
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Width="300pt" Height="400pt" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:bs="http://www.brainsellers.com/schema" xmlns:svg="http://www.brainsellers.com/schema" xmlns:form="http://www.brainsellers.com/schema" xmlns:pdf="http://www.brainsellers.com/schema" version="5.0.0">
<Square Width="10" Height="10" X="35" Y="65" LineColor="0,255,0" LineWidth="5" LineStyle="Solid"/>
<watermark x="22.931" y="63.5" dx="0" dy="0" width="170px" height="40px" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="50" fit="horizon" mode="front">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">Copyright(c) 2017</watermark-text>
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">BrainSellers.com Corporation</watermark-text>
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">All rights reserved.</watermark-text>
</watermark>
<Square Width="10" Height="10" X="65" Y="65" LineColor="0,255,0" LineWidth="5" LineStyle="Solid"/>
</Layout>
watermarkサンプル6
mode属性をbackに設定したサンプルです。
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Width="300pt" Height="400pt" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:bs="http://www.brainsellers.com/schema" xmlns:svg="http://www.brainsellers.com/schema" xmlns:form="http://www.brainsellers.com/schema" xmlns:pdf="http://www.brainsellers.com/schema" version="5.0.0">
<Square Width="10" Height="10" X="35" Y="65" LineColor="0,255,0" LineWidth="5" LineStyle="Solid"/>
<watermark x="22.931" y="63.5" dx="0" dy="0" width="170px" height="40px" text-align="left" line-align="top" align="vertical" print="true" view="true" rate="50" fit="horizon" mode="back">
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">Copyright(c) 2017</watermark-text>
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">BrainSellers.com Corporation</watermark-text>
<watermark-text text-align="left" line-align="top" font-family="MSGothic" font-color="255,0,0" font-size="12" font-style="PLAIN" narrow="horizon" text-rendering="stroke">All rights reserved.</watermark-text>
</watermark>
<Square Width="10" Height="10" X="65" Y="65" LineColor="0,255,0" LineWidth="5" LineStyle="Solid"/>
</Layout>