docbook-apps

  • 1.  Generating SVG in PDF

    Posted 11-01-2012 06:08
    Has anyone managed to produce PDFs with SVG files? I can only achieve
    this with fo:instream-foreign-object, even though it is apparently
    possible to use fo:external-graphicto refer to an external SVG (see "SVG
    Essentials", O'Reilly). Using fo:external-graphic (or even
    background-image in fo:block) just gives me a little box with red cross
    and the SVG is not generated.

    I'm using XEP 4.21, Saxon 6.5.5.

    The markup that works is:

    <fo:blockxmlns:ex="http://www.renderx.com/XSL/Extensions"
    xmlns:xi="http://www.w3.org/2001/XInclude"span="all"background-color="#cc9933"
    border-top="1pt solid #ff0000"border-bottom="1pt solid #ff0000"
    border-left="0pt none #000000"border-right="0pt none
    #000000"margin-top="0mm"
    margin-bottom="3mm"margin-left="0mm"margin-right="0mm"padding-top="3mm"
    padding-bottom="3mm"padding-left="3mm"padding-right="3mm"background-repeat="no-repeat"
    background-image="url(images/Figure5-4.gif)"ex:background-content-width="170mm"
    background-position="50%
    50%"><fo:instream-foreign-object><svgversion="1.1"id="Layer_1"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"
    width="193.26px"height="163.26px"viewBox="0 0 193.26
    163.26"enable-background="new 0 0 193.26
    163.26"xml:space="preserve"transform="translate(0,100)">
    <rectx="0.63"y="0.63"fill="#ffffff"fill-opacity="0.7"stroke="#000000"stroke-width="0.5"width="192"height="162"/>
    </fo:instream-foreign-object><fo:block ....

    --
    *Dave Gardiner*



  • 2.  Re: [docbook-apps] Generating SVG in PDF

    Posted 11-01-2012 10:44
    Hi Dave

    Sure, I use external SVG files all the time. The following code works
    for me:

    <fo:external-graphic src="url('images/external.svg')"
    content-height="1.72cm" content-width="3.92cm"
    content-type="content-type:image/svg+xml"/>

    Note the url('...') wrapper in src, I think xep requires this but fop
    doesn't.

    This works with fop 1.0 and xep 4.19 demo version.

    Simon Dew

    Technical Author | Stanley Security Solutions
    1 Park Gate Close, Bredbury, Stockport SK6 2SZ, U.K.

    Simon.Dew@SBDInc.com | +44 (0) 161 406 3405
    www.stanleysecuritysolutions.co.uk

    Registered Office: Stanley House, Bramble Road, Swindon
    Registered in England and Wales No. 181585 VAT No. 232 2446 95

    On 01/11/2012 06:07, Xmplar wrote:

    > Has anyone managed to produce PDFs with SVG files? I can only achieve
    > this with fo:instream-foreign-object, even though it is apparently
    > possible to use fo:external-graphicto refer to an external SVG (see “SVG
    > Essentials”, O’Reilly). Using fo:external-graphic (or even
    > background-image in fo:block) just gives me a little box with red cross
    > and the SVG is not generated.
    >
    > I’m using XEP 4.21, Saxon 6.5.5.
    >
    > The markup that works is:
    >
    > <fo:blockxmlns:ex="http://www.renderx.com/XSL/Extensions"
    > xmlns:xi="http://www.w3.org/2001/XInclude"span="all"background-color="#cc9933"
    > border-top="1pt solid #ff0000"border-bottom="1pt solid #ff0000"
    > border-left="0pt none #000000"border-right="0pt none
    > #000000"margin-top="0mm"
    > margin-bottom="3mm"margin-left="0mm"margin-right="0mm"padding-top="3mm"
    > padding-bottom="3mm"padding-left="3mm"padding-right="3mm"background-repeat="no-repeat"
    > background-image="url(images/Figure5-4.gif)"ex:background-content-width="170mm"
    > background-position="50%
    > 50%"><fo:instream-foreign-object><svgversion="1.1"id="Layer_1"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"
    > width="193.26px"height="163.26px"viewBox="0 0 193.26
    > 163.26"enable-background="new 0 0 193.26
    > 163.26"xml:space="preserve"transform="translate(0,100)">
    > <rectx="0.63"y="0.63"fill="#ffffff"fill-opacity="0.7"stroke="#000000"stroke-width="0.5"width="192"height="162"/>
    > </fo:instream-foreign-object><fo:block ….
    >
    > --
    > *Dave Gardiner*



  • 3.  Re: [docbook-apps] Generating SVG in PDF

    Posted 11-06-2012 12:25
    I found the issue - I had created the SVG from Adobe Illustrator, which
    adds a !DOCTYPE DTD declaration - that was not parsed when processed
    with RenderX XEP.

    On 01-11-12 9:44 PM, Dew, Simon wrote:
    > Hi Dave
    >
    > Sure, I use external SVG files all the time. The following code works
    > for me:
    >
    > <fo:external-graphic src="url('images/external.svg')"
    > content-height="1.72cm" content-width="3.92cm"
    > content-type="content-type:image/svg+xml"/>
    >
    > Note the url('...') wrapper in src, I think xep requires this but fop
    > doesn't.
    >
    > This works with fop 1.0 and xep 4.19 demo version.
    >
    > Simon Dew
    >
    > Technical Author | Stanley Security Solutions
    > 1 Park Gate Close, Bredbury, Stockport SK6 2SZ, U.K.
    >
    > Simon.Dew@SBDInc.com | +44 (0) 161 406 3405
    > www.stanleysecuritysolutions.co.uk
    >
    > Registered Office: Stanley House, Bramble Road, Swindon
    > Registered in England and Wales No. 181585 VAT No. 232 2446 95
    >
    > On 01/11/2012 06:07, Xmplar wrote:
    >
    >> Has anyone managed to produce PDFs with SVG files? I can only achieve
    >> this with fo:instream-foreign-object, even though it is apparently
    >> possible to use fo:external-graphicto refer to an external SVG (see “SVG
    >> Essentials”, O’Reilly). Using fo:external-graphic (or even
    >> background-image in fo:block) just gives me a little box with red cross
    >> and the SVG is not generated.
    >>
    >> I’m using XEP 4.21, Saxon 6.5.5.
    >>
    >> The markup that works is:
    >>
    >> <fo:blockxmlns:ex="http://www.renderx.com/XSL/Extensions"
    >> xmlns:xi="http://www.w3.org/2001/XInclude"span="all"background-color="#cc9933"
    >> border-top="1pt solid #ff0000"border-bottom="1pt solid #ff0000"
    >> border-left="0pt none #000000"border-right="0pt none
    >> #000000"margin-top="0mm"
    >> margin-bottom="3mm"margin-left="0mm"margin-right="0mm"padding-top="3mm"
    >> padding-bottom="3mm"padding-left="3mm"padding-right="3mm"background-repeat="no-repeat"
    >> background-image="url(images/Figure5-4.gif)"ex:background-content-width="170mm"
    >> background-position="50%
    >> 50%"><fo:instream-foreign-object><svgversion="1.1"id="Layer_1"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"
    >> width="193.26px"height="163.26px"viewBox="0 0 193.26
    >> 163.26"enable-background="new 0 0 193.26
    >> 163.26"xml:space="preserve"transform="translate(0,100)">
    >> <rectx="0.63"y="0.63"fill="#ffffff"fill-opacity="0.7"stroke="#000000"stroke-width="0.5"width="192"height="162"/>
    >> </fo:instream-foreign-object><fo:block ….
    >>
    >> --
    >> *Dave Gardiner*
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >




  • 4.  Re: [docbook-apps] Generating SVG in PDF

    Posted 11-06-2012 17:57
    HI Dave,
    You can configure XEP to use an XML catalog to resolve the SVG DTD DOCTYPE.
    See:

    http://www.sagehill.net/docbookxsl/SVGimages.html#SvgDtd

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    --------------------------------------------------
    From: "Xmplar" <info@xmplar.biz>
    Sent: Tuesday, November 06, 2012 4:24 AM
    To: <docbook-apps@lists.oasis-open.org>
    Subject: Re: [docbook-apps] Generating SVG in PDF

    > I found the issue - I had created the SVG from Adobe Illustrator, which
    > adds a !DOCTYPE DTD declaration - that was not parsed when processed with
    > RenderX XEP.
    >
    > On 01-11-12 9:44 PM, Dew, Simon wrote:
    >> Hi Dave
    >>
    >> Sure, I use external SVG files all the time. The following code works
    >> for me:
    >>
    >> <fo:external-graphic src="url('images/external.svg')"
    >> content-height="1.72cm" content-width="3.92cm"
    >> content-type="content-type:image/svg+xml"/>
    >>
    >> Note the url('...') wrapper in src, I think xep requires this but fop
    >> doesn't.
    >>
    >> This works with fop 1.0 and xep 4.19 demo version.
    >>
    >> Simon Dew
    >>
    >> Technical Author | Stanley Security Solutions
    >> 1 Park Gate Close, Bredbury, Stockport SK6 2SZ, U.K.
    >>
    >> Simon.Dew@SBDInc.com | +44 (0) 161 406 3405
    >> www.stanleysecuritysolutions.co.uk
    >>
    >> Registered Office: Stanley House, Bramble Road, Swindon
    >> Registered in England and Wales No. 181585 VAT No. 232 2446 95
    >>
    >> On 01/11/2012 06:07, Xmplar wrote:
    >>
    >>> Has anyone managed to produce PDFs with SVG files? I can only achieve
    >>> this with fo:instream-foreign-object, even though it is apparently
    >>> possible to use fo:external-graphicto refer to an external SVG (see “SVG
    >>> Essentials”, O’Reilly). Using fo:external-graphic (or even
    >>> background-image in fo:block) just gives me a little box with red cross
    >>> and the SVG is not generated.
    >>>
    >>> I’m using XEP 4.21, Saxon 6.5.5.
    >>>
    >>> The markup that works is:
    >>>
    >>> <fo:blockxmlns:ex="http://www.renderx.com/XSL/Extensions"
    >>> xmlns:xi="http://www.w3.org/2001/XInclude"span="all"background-color="#cc9933"
    >>> border-top="1pt solid #ff0000"border-bottom="1pt solid #ff0000"
    >>> border-left="0pt none #000000"border-right="0pt none
    >>> #000000"margin-top="0mm"
    >>> margin-bottom="3mm"margin-left="0mm"margin-right="0mm"padding-top="3mm"
    >>> padding-bottom="3mm"padding-left="3mm"padding-right="3mm"background-repeat="no-repeat"
    >>> background-image="url(images/Figure5-4.gif)"ex:background-content-width="170mm"
    >>> background-position="50%
    >>> 50%"><fo:instream-foreign-object><svgversion="1.1"id="Layer_1"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"
    >>> width="193.26px"height="163.26px"viewBox="0 0 193.26
    >>> 163.26"enable-background="new 0 0 193.26
    >>> 163.26"xml:space="preserve"transform="translate(0,100)">
    >>> <rectx="0.63"y="0.63"fill="#ffffff"fill-opacity="0.7"stroke="#000000"stroke-width="0.5"width="192"height="162"/>
    >>> </fo:instream-foreign-object><fo:block ….
    >>>
    >>> --
    >>> *Dave Gardiner*
    >> ---------------------------------------------------------------------
    >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >>
    >>
    >>
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >