You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Jeremias Maerki <de...@jeremias-maerki.ch> on 2008/02/19 14:32:35 UTC

Produce multiple PDF pages (was: Re: The URI can't be opened error: when generating PDF with embedded image)

The PDFTranscoder currently doesn't offer anything to produce multiple
PDF pages. However, the underlying PDFDocumentGraphics2D class does (but
it might not help you). Would you just want to convert a series of SVG
files to a single PDF?

If that's the case, I can give you an alternative: FOP Trunk (i.e.
unreleased code from our SVN repo) can do exactly that using a
properietary extension to XSL-FO. You'd call FOP, not Batik, but Batik
is still used to process the SVG graphics. The FO file to glue all this
together would look like this:

    <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="dummy" page-width="5in" page-height="5in">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fox:external-document id="img1" src="mysvgimage1.svg"/>
      <fox:external-document id="img2" src="mysvgimage2.svg"/>
      <fox:external-document id="img3" src="mysvgimage3.svg"/>
    </fo:root>

Maybe that helps.

On 18.02.2008 20:39:00 Lea Thurman wrote:
<snip/>
> Now all I need to do is get the PDF to produce pages? I know I am  
> hijacking the thread the any pointers there given your other post?
<snip/>


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Produce multiple PDF pages (was: Re: The URI can't be opened error: when generating PDF with embedded image)

Posted by The Web Maestro <th...@gmail.com>.
Hi Lea,

I believe Jeremias just went offline for 10 days,  but Fop0.95beta was
released on March 26, 2008, so it may have what you need:

http://xmlgraphics.apache.org/fop/download.html

I'd recommend you give it a shot with the FO Jeremias posted. Once you
know it works, you should be able to come up with a way to auotmate
the process via XML+XSLT. If not, ask for more help here or on the XSL
Mulberry List...

Clay



On 5/18/08, Lea Thurman <le...@onesoon.co.uk> wrote:
>
> Sorry Jeremias,
>
> I know its been a while since you responded to this but I am now back on the
> case. - after an unwelcome diversion.
>
> Yes this is exactly what I need. I need the ability to render several SVG
> images to a multiple page PDF document.
>
> You spoke about a FOP trunk which could achieve this. Is this still needed
> given the delay in me responding?
>
> Also is there a way to dynamically generate the FOP document in code as I
> would not really want to generate an XML structure and then in turn
> transform this.
>
> As always any help is much appreciated.
>
> Regards
> Lea.
>
>
>
> Jeremias Maerki-2 wrote:
>>
>> The PDFTranscoder currently doesn't offer anything to produce multiple
>> PDF pages. However, the underlying PDFDocumentGraphics2D class does (but
>> it might not help you). Would you just want to convert a series of SVG
>> files to a single PDF?
>>
>> If that's the case, I can give you an alternative: FOP Trunk (i.e.
>> unreleased code from our SVN repo) can do exactly that using a
>> properietary extension to XSL-FO. You'd call FOP, not Batik, but Batik
>> is still used to process the SVG graphics. The FO file to glue all this
>> together would look like this:
>>
>>     <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="dummy" page-width="5in"
>> page-height="5in">
>>           <fo:region-body/>
>>         </fo:simple-page-master>
>>       </fo:layout-master-set>
>>       <fox:external-document id="img1" src="mysvgimage1.svg"/>
>>       <fox:external-document id="img2" src="mysvgimage2.svg"/>
>>       <fox:external-document id="img3" src="mysvgimage3.svg"/>
>>     </fo:root>
>>
>> Maybe that helps.
>>
>> On 18.02.2008 20:39:00 Lea Thurman wrote:
>> <snip/>
>>> Now all I need to do is get the PDF to produce pages? I know I am
>>> hijacking the thread the any pointers there given your other post?
>> <snip/>
>>
>>
>> Jeremias Maerki
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/The-URI-can%27t-be-opened-error%3A-when-generating-PDF-with-embedded-image-tp15488838p17307423.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>

-- 
Sent from Gmail for mobile | mobile.google.com

Regards,

The Web Maestro
-- 
<th...@gmail.com> - <http://ourlil.com/>
My religion is simple. My religion is kindness.
- HH The 14th Dalai Lama of Tibet

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Produce multiple PDF pages (was: Re: The URI can't be opened error: when generating PDF with embedded image)

Posted by Lea Thurman <le...@onesoon.co.uk>.
Sorry Jeremias,

I know its been a while since you responded to this but I am now back on the
case. - after an unwelcome diversion.

Yes this is exactly what I need. I need the ability to render several SVG
images to a multiple page PDF document.

You spoke about a FOP trunk which could achieve this. Is this still needed
given the delay in me responding?

Also is there a way to dynamically generate the FOP document in code as I
would not really want to generate an XML structure and then in turn
transform this.

As always any help is much appreciated.

Regards
Lea.



Jeremias Maerki-2 wrote:
> 
> The PDFTranscoder currently doesn't offer anything to produce multiple
> PDF pages. However, the underlying PDFDocumentGraphics2D class does (but
> it might not help you). Would you just want to convert a series of SVG
> files to a single PDF?
> 
> If that's the case, I can give you an alternative: FOP Trunk (i.e.
> unreleased code from our SVN repo) can do exactly that using a
> properietary extension to XSL-FO. You'd call FOP, not Batik, but Batik
> is still used to process the SVG graphics. The FO file to glue all this
> together would look like this:
> 
>     <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="dummy" page-width="5in"
> page-height="5in">
>           <fo:region-body/>
>         </fo:simple-page-master>
>       </fo:layout-master-set>
>       <fox:external-document id="img1" src="mysvgimage1.svg"/>
>       <fox:external-document id="img2" src="mysvgimage2.svg"/>
>       <fox:external-document id="img3" src="mysvgimage3.svg"/>
>     </fo:root>
> 
> Maybe that helps.
> 
> On 18.02.2008 20:39:00 Lea Thurman wrote:
> <snip/>
>> Now all I need to do is get the PDF to produce pages? I know I am  
>> hijacking the thread the any pointers there given your other post?
> <snip/>
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/The-URI-can%27t-be-opened-error%3A-when-generating-PDF-with-embedded-image-tp15488838p17307423.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org