jelovirt / dita-generator

DITA Generator is a Python program that generates DITA shell DTDs, DITA topic specialization stubs, and DITA-OT plug-in stubs.
http://dita-generator-hrd.appspot.com/
Apache License 2.0
18 stars 2 forks source link

Add option to treat PDF cover image as page background #24

Open infotexture opened 11 years ago

infotexture commented 11 years ago

The PDF style plug-in allows a cover image to be specified for inclusion on the title page, but the current implementation renders the image as part of the page content below <mainbooktitle> & <booktitlealt>, so the image only appears if it fits within the available space.

In cases where cover images require exact placement, it is often better to define them as page backgrounds so they are consistently rendered in the same position, independent of title page content.

It would be helpful if the GUI included an option to enable this behavior and specify background position (perhaps Use as background and Offset from [top|left]?).

The result could modify front-matter.xsl by adding an fo:block-container at the beginning of xsl-region-body like this:

<fo:flow flow-name="xsl-region-body">

    <!-- Add per http://tech.groups.yahoo.com/group/dita-users/message/31887 -->
    <fo:block-container absolute-position="absolute"
        background-image="Customization/OpenTopic/common/artwork/cover-background.pdf"
        background-repeat="no-repeat" background-position="0,0"
        height="280mm" width="210mm" top="-20mm" left="-20mm">
    <!-- (end cover page background customization) -->

        <fo:block xsl:use-attribute-sets="__frontmatter">

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/970136-add-option-to-treat-pdf-cover-image-as-page-background?utm_campaign=plugin&utm_content=tracker%2F180251&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F180251&utm_medium=issues&utm_source=github).