OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] mediaobject with base64 encoded image data


Hi Bob,

thanks for the feedback. I looked into 4 alternatives:

1) IBEX
    At the moment our choice because it's relatively cheap, fast and even
    though it produces quite large PDF files (double size in respect to 
    the Antenna House implementation) it is not a KO criteria for IBEX.
2) Antenna House
    This is the most expensive option. We won't spend that much unless we 
    run into serious trouble with IBEX (bugs, etc..).
3) FO.NET
    Did not pass all tests and is poorly supported - well - it is free. :-)
4) FOP
    This would be my favourite, but unfortunately we cannot depend
    on a java application.

Going back to the customization, you wouldn't do the previously mentioned
customization differently, would you?

I'm asking because I also thought about integrating base64-encoded imagedata
better into docbook by:

1) either creating a fresh new attribute like "src" on the <imagedata /> tag
that could be passed on to the respective FO attribute "src" in the tag
<fo:external-graphic />.

2) or parsing the "fileref" attribute and don't wrap it in "url()" if it
starts with "imagedata".

Both 1) and 2) feel much more like the "right" solution that could also
become a patch that could be applied on the next release of the docbook
stylesheets. What do you think about that?

Cheers,
Dominik

>-----Original Message-----
>From: Bob Stayton [mailto:bobs@sagehill.net]
>Sent: Monday, April 02, 2012 6:39 PM
>To: Dominik Psenner; docbook-apps@lists.oasis-open.org
>Subject: Re: [docbook-apps] mediaobject with base64 encoded image data
>
>Hi,
>That customization looks fine to me.  What XSL-FO processor are you using?
>
>Bob Stayton
>Sagehill Enterprises
>bobs@sagehill.net
>
>
>----- Original Message -----
>From: "Dominik Psenner" <dpsenner@gmail.com>
>To: <docbook-apps@lists.oasis-open.org>
>Sent: Monday, April 02, 2012 12:30 AM
>Subject: [docbook-apps] mediaobject with base64 encoded image data
>
>
>> Good morning,
>>
>> We plan to XSL transform a dynamically generated docbook including images
>to
>> FO and subsequently process that to PDF. Therefore I'm digging only in
>the
>> docbook to FO stylesheets. While investigating that we had the idea to
>> base64 encode images and include them in the docbook because it enables
>us
>> to bypass image caching while generating PDF on the fly. To include a
>base64
>> image I had the idea to write it as:
>>
>> -- quote --
>>        <docbook:figure>
>>          <docbook:title>Sample</docbook:title>
>>          <docbook:mediaobject>
>>            <docbook:imageobject>
>>              <fo:external-graphic src="data:image/jpeg;base64,XYZ"
>> width="auto" height="auto" content-width="auto" content-height="auto"
>> content-type="content-type:image/jpeg" />
>>            </docbook:imageobject>
>>          </docbook:mediaobject>
>>        </docbook:figure>
>> -- /quote --
>>
>> But unfortunately the stylesheet (1.75.2 release) would wrap that within
>a
>> <fo:instream-foreign-object /> and that causes the FO processor to fail
>> including the base64 encoded image.
>>
>> Therefore I changed the docbook xsl stylesheet (based on the 1.75.2
>release)
>> in the file fo/graphics.xsl slightly:
>>
>> -- diffquote --
>> <xsl:template match="imageobject">
>>  <xsl:choose>
>>    <xsl:when test="imagedata">
>>      <xsl:apply-templates select="imagedata"/>
>>    </xsl:when>
>> +    <xsl:when test="fo:external-graphic">
>> +      <xsl:apply-templates mode="copy-all" />
>> +    </xsl:when>
>>    <xsl:otherwise>
>>      <fo:instream-foreign-object>
>>        <xsl:apply-templates mode="copy-all"/>
>>      </fo:instream-foreign-object>
>>    </xsl:otherwise>
>>  </xsl:choose>
>> </xsl:template>
>> -- /diffquote --
>>
>> This patch drops the <fo:instream-foreign-object /> tag when encountering
>> <fo:external-graphic />.
>>
>> Does this patch break other things? Would you guys do it somehow
>different?
>>
>> Cheers,
>> Dominik
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
>> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>>
>>
>>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]