biz-StreamマニュアルXMLページレイアウトタグ リファレンス第7章 インポート7.2 PDF ファイル・インポート<pdf:import>

7.2 PDF ファイル・インポート<pdf:import>


7.2.1機能説明

biz-Streamで生成したPDFファイルをページレイアウト内部に埋め込んで使用することができます。ただし、埋め込める部分は純粋なページの描画部分(文字列、図形、イメージ)のみで、リンクを除く注釈、しおりなどは埋め込めません。

なお、Microsoft WordやExcel、Adobe Illustratorなど、biz-Stream以外のツールを利用して作成したPDFは、正式サポート対象外となります。

本機能を使用する場合は、対象となるPDFファイルを実際に使用して埋め込み後の表示を確認し、ご希望の内容が埋め込まれることをご確認のうえご使用ください。埋め込み後の表示がご希望の内容と異なる場合、本機能ではインポートできないPDFファイルとなります。

ページレイアウトだけでPDFファイルを生成する場合、インポートするPDFはページ単位で指定になります。
ドキュメントレイアウトでPDFファイルを生成する場合、page属性に複数のページが指定可能です。

  • 暗号化されたPDFファイルを埋め込むことはできません。


7.2.2属性説明

属性名 指定 説明 指定内容 初期値
name 任意 名前 CDATA
width 任意 表示する領域の幅 CDATA 実サイズ
height 任意 表示する領域の高さ CDATA 実サイズ
x 任意 X座標 CDATA 0
y 任意 Y座標 CDATA 0
unit 任意 単位 (Choice) mm / cm / in / px / pt mm
href 必須 埋め込むPDFファイル名 CDATA
page 任意 埋め込むPDFファイルの該当ページ番号
4,5のようにカンマで指定するか1-4のように範囲で指定が可能です
allを指定すると全ページが対象になります
CDATA ページ番号 /
all:全ページ /
last:最終ページ
1
Rate 任意 拡大縮小率(%) CDATA 100
  • (注)初期値:出荷時のXML デフォルト情報(default_values.properties)値を表します。ユーザにより値の変更が行われた場合は内容が異なります。


7.2.3記述例

pdf:importサンプル1

pdf:importサンプル1(『<biz-Stream_home>/sample/xml/pdf-import/pdf-importSample1.xml』)

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="pdf-importSample1" Width="100" Height="100" 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">
    <Label Width="100" X="5" Y="85" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">PDFの埋め込みサンプル</Label>

    <pdf:import href="${base-dir}/sample/xml/pdf-import/sample.pdf" x="5" y="10" width="75" height="70" page="2"/>

</Layout>


生成されるPDF(『<biz-Stream_home>/sample/xml/pdf-import/pdf-importSample1.pdf』)


pdf-importサンプル1

XMLで直接指定を行っている部分です。

XMLでの指定とbiz-Streamで作成した既存のPDFファイルを混在して使用することが可能です。

既存のPDFファイル(${base-dir}/sample/xml/pdf-import/sample.pdf)を埋め込みます。

(『<biz-Stream_home>/sample/xml/pdf-import/sample.pdf』内容)


pdf-importサンプル2

複数ページにわたるPDFファイルから、ページ数を指定して埋め込むことが可能です。

  • サンプルでは2ページ目を埋め込んでいます。

pdf:importサンプル2

ドキュメントレイアウトを用いて複数のページを取り込むサンプルです。
複数のページ指定はドキュメントレイアウトとページレイアウトを組み合わせてご使用ください。

(『<biz-Stream_home>/sample/xml/pdf-import/pdf-importSample2.xml』)
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:pdf="http://www.brainsellers.com/schema" xmlns:svg="http://www.brainsellers.com/schema" xmlns:bs="http://www.brainsellers.com/schema" xmlns:form="http://www.brainsellers.com/schema" version="5.0.0">
    <fo:layout-master-set>
        <fo:simple-page-master master-name="A4" page-height="297mm" page-width="210mm">
            <fo:region-body/>
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="A4" bs:local-page-control="none">
        <fo:flow flow-name="xsl-region-body">
            <bs:block-container>
                <bs:include href="${base-dir}/sample/xml/pdf-import/pdf-importSample2-include1.xml"/>

            </bs:block-container>
        </fo:flow>
    </fo:page-sequence>
    <fo:page-sequence master-reference="A4" bs:local-page-control="none">
        <fo:flow flow-name="xsl-region-body">
            <bs:block-container>
                <bs:include href="${base-dir}/sample/xml/pdf-import/pdf-importSample2-include2.xml"/>

            </bs:block-container>
        </fo:flow>
    </fo:page-sequence>
</fo:root>


(『<biz-Stream_home>/sample/xml/pdf-import/pdf-importSample2-include1.xml』)
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="pdf-importSample2-include2" Width="21cm" Height="29.7cm" 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">
    <!-- 頁番号を指定するとそのページを取り込む -->

    <pdf:import href="${base-dir}/sample/xml/pdf-import/sample.pdf" page="2,4,5-8,10"/>

</Layout>

(『<biz-Stream_home>/sample/xml/pdf-import/pdf-importSample2-include2.xml』)
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="pdf-importSample2-include2" Width="21cm" Height="29.7cm" 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">
    <!-- 頁番号にallを指定すると全てのページを取り込む -->

    <pdf:import href="${base-dir}/sample/xml/pdf-import/sample2.pdf" page="all"/>

</Layout>

生成されるPDF(『<biz-Stream_home>/sample/xml/pdf-import/pdf-importSample2.pdf』)


取り込み元のPDF(sample2.pdf)は20ページです。
pdf-importSample2-1.xmlの指定では 2,4,5,6,7,8,10 の合計7ページが対象となります。
pdf-importSample2-2.xmlの指定はallなので20ページ全てが対象となります。
よって生成されるpdf-importSample2.pdfは合計27ページとなります。