Create multi-page pdf from one svg file
<p>Is there a way to create a multi-page pdf from just one svg file? I am currently loading an svg file that I have broken up into two panels. I then hide one panel so the user can only see one. Then by means of tabs listed as Panel 1 and Panel 2 which the user can click to see one panel at a time with css display. The user is able to add text to the panels. The user then can print to a pdf. The svg is sent via form data to a script that calls some java classes such as Batik to create the pdf. All the above works fine except creating a multi-page pdf. I am not sure how to accomplish this. I am very new to this.</p>

<p>SVG File:</p>

<pre><code>&lt;svg id="svgroot" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" height="100%" width="100%" viewBox="0 0 1638 1029.6" baseProfile="full" xmlns:space="preserve"&gt;    
&lt;svg id="panel_1" width="1600" height="1024" overflow="visible"&gt;
    &lt;g id="menupanel_1" style="display:inline"&gt;                 

        &lt;image enable-background="new" width="1600" height="1024" xlink:href="images/Panel1.jpg" transform="matrix(1.0239 0 0 1.0021 -4.882813e-004 0)"&gt;&lt;/image&gt;

        &lt;a xlink:href="#" id="sec_" class="a-map" alt="Salads &amp;amp; Soups"&gt;&lt;rect x="8" y="259" fill-opacity="0" width="305.001" height="348"/&gt;&lt;/a&gt;
        &lt;a xlink:href="#" id="sec_" class="a-map" alt="Desserts"&gt;&lt;rect x="333" y="486" fill-opacity="0" width="297" height="169"/&gt;&lt;/a&gt;
        &lt;a xlink:href="#" id="sec_" class="a-map" alt="Sandwiches"&gt;&lt;rect x="6" y="673" fill-opacity="0" width="306.001" height="247"/&gt;&lt;/a&gt;              
        &lt;a xlink:href="#" id="imgsec_1" class="a-map" alt="Menu Panel Images"&gt;
            &lt;rect  x="333.667" y="202.333" fill-opacity="0" width="294.911" height="273.911"/&gt;
            &lt;image id="image_1" enable-background="new" style="display:none" width="285" height="262" xlink:href="images/image1.png" transform="matrix(1.0057 0 0 1.0082 337.4297 207.7466)"&gt;&lt;/image&gt;                               
            &lt;image id="image_2" enable-background="new" style="display:none" width="285" height="262" xlink:href="images/image2.png" transform="matrix(1.0057 0 0 1.0082 337.4297 207.7466)"&gt;&lt;/image&gt;
        &lt;/a&gt;
        &lt;g&gt;
            &lt;g&gt;&lt;rect x="271.244" y="299.911" fill="#FFFFFF" width="34" height="12"/&gt;&lt;/g&gt;
            &lt;text id="price1" transform="matrix(0.9964 0 0 1 274 309.5898)" fill="#231F20" font-family="TradeGothicLTStd-Light" font-size="11"&gt;00.00&lt;/text&gt;
        &lt;/g&gt;
        &lt;g&gt;
            &lt;g&gt;&lt;rect x="271.244" y="343.244" fill="#FFFFFF" width="34" height="12"/&gt;&lt;/g&gt;
            &lt;text id="price2" transform="matrix(0.9964 0 0 1 274 352.9233)" fill="#231F20" font-family="TradeGothicLTStd-Light" font-size="11"&gt;00.00&lt;/text&gt;
        &lt;/g&gt;
        &lt;g&gt;
            &lt;g&gt;&lt;rect x="270.91" y="410.577" fill="#FFFFFF" width="34" height="12"/&gt;&lt;/g&gt;
            &lt;text id="price3" transform="matrix(0.9964 0 0 1 274 420.2563)" fill="#231F20" font-family="TradeGothicLTStd-Light" font-size="11"&gt;00.00&lt;/text&gt;
        &lt;/g&gt;
    &lt;/g&gt;
&lt;/svg&gt;

&lt;svg id="panel_2" width="1638" height="1029.6" overflow="visible"&gt;
    &lt;g id="menupanel_2" style="display:none"&gt;

        &lt;image enable-background="new" width="1638" height="988" xlink:href="images/Panel2.jpg" transform="matrix(1 0 0 1.0421 0 0.002)"&gt;&lt;/image&gt;

        &lt;a xlink:href="#" id="sec_" class="a-map" alt="White Wine"&gt;&lt;rect x="27" y="404" fill-opacity="0" width="302" height="246"/&gt;&lt;/a&gt;
        &lt;a xlink:href="#" id="sec_" class="a-map" alt="Red Wine"&gt;&lt;rect x="28" y="658" fill-opacity="0" width="300" height="342"/&gt;&lt;/a&gt;
        &lt;a xlink:href="#" id="sec_" class="a-map" alt="Appetizers"&gt;&lt;rect x="661" y="419" fill-opacity="0" width="312" height="563"/&gt;&lt;/a&gt;
        &lt;a xlink:href="#" id="sec_" class="a-map" alt="Burgers"&gt;&lt;rect x="986" y="718" fill-opacity="0" width="628" height="253"/&gt;&lt;/a&gt;
        &lt;a xlink:href="#" id="sec_" class="a-map" alt="Mains"&gt;&lt;rect x="985.5" y="17.3" fill-opacity="0" width="627" height="693"/&gt;&lt;/a&gt;
        &lt;a xlink:href="#" id="sec_" class="a-map" alt="Beers"&gt;&lt;rect x="27.5" y="19.3" fill-opacity="0" width="303" height="343"/&gt;&lt;/a&gt;
    &lt;/g&gt;            
&lt;/svg&gt;
</code></pre>

<p></p>

<p>Script:</p>

<pre><code>&lt;cfscript&gt;
svgformdata = form.data;
fname = form.filename;

transcoder = createObject("java", "org.apache.fop.svg.PDFTranscoder").init();

// load text into a reader and create the source input
svgText = '#svgformdata#';

reader = createObject("java", "java.io.StringReader").init(svgText);
input = createObject("java", "org.apache.batik.transcoder.TranscoderInput").init(reader);

// create a unique file name
outPath = ExpandPath("./pdf/" &amp; fname);

fos = createObject("java", "java.io.FileOutputStream").init(outPath); 
output = createObject("java", "org.apache.batik.transcoder.TranscoderOutput").init(fos);

transcoder.transcode(input, output);

fos.close();
&lt;/cfscript&gt;
</code></pre>