docbook-apps

  • 1.  PDF recto title page customization adds blank page before the verso title page

    Posted 01-11-2017 17:51
    Hi. I want the cover page of my book PDF to have a full-bleed color
    background so I added a fo:block-container that's the same size as the
    page and gave it the background-color attribute. This works well and
    the cover page looks great, but it also introduces a blank page
    between the recto title page and the verso title page.

    It seems that there's something about the recto title page that is
    spilling over into a new page but doesn't appear there at all.

    Has anyone else tried to do something like this? I found that I had to
    set negative margins of the block-container above and to the left of
    the page in order to center the colored background over the first
    page.

    I feel like I'm grasping at straws and really should understand what's
    going on much more clearly.

    Here's my customization for the book title page:

    <xsl:template name="book.titlepage.recto">
    <xsl:element name="fo:block-container">
    <xsl:attribute name="width">8.5in</xsl:attribute>
    <xsl:attribute name="height">11in</xsl:attribute>
    <xsl:attribute name="margin-left">-1.25in</xsl:attribute>
    <xsl:attribute name="margin-top">-0.75in</xsl:attribute>
    <xsl:attribute name="background-color">#ff4c00</xsl:attribute>
    <xsl:element name="fo:block">
    <xsl:attribute name="margin-top">6in</xsl:attribute>
    <xsl:attribute name="margin-left">2in</xsl:attribute>
    <xsl:element name ="fo:external-graphic">
    <xsl:attribute name="content-width">2in</xsl:attribute>
    <xsl:attribute name="src">
    <xsl:text>url(mylogo.svg)</xsl:text>
    </xsl:attribute>
    </xsl:element>
    </xsl:element>
    <xsl:element name="fo:block-container">
    <xsl:attribute name="margin-top">.2in</xsl:attribute>
    <xsl:attribute name="margin-left">.35in</xsl:attribute>
    <xsl:element name="fo:block">
    <xsl:attribute name="color">#ffffff</xsl:attribute>
    <xsl:attribute name="text-align">left</xsl:attribute>
    <xsl:attribute name="font-size">22pt</xsl:attribute>
    <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    <xsl:attribute name="font-weight">400</xsl:attribute>
    <xsl:value-of select="//d:book/d:info/d:title" />
    </xsl:element>
    </xsl:element>
    </xsl:element>
    </xsl:template>


    Thanks!

    Peter



  • 2.  Re: [docbook-apps] PDF recto title page customization adds blank page before the verso title page

    Posted 01-19-2017 09:11
    Hello Peter,
    I have what I think you describe, a background image stretching to the edges of the recto and a non-empty verso (I have a copyright entry there). I include a sanitized version below (pardon the namespace sloppiness, I have yet to clean that up). I'm not sure why exactly yours does not work, but mine may give some clues to things to try.

    <xsl:template name="book.titlepage.recto">
    <fo:block-container absolute-position="absolute"
    width="{$page.width}"
    height="{$page.height}"
    top="-({$page.margin.top} + {$body.margin.top})"
    left="-({$page.margin.inner})">
    <fo:block>
    <fo:table inline-progression-dimension="100%">
    <xsl:attribute name="background-image"><xsl:value-of select="$custom.image.path" />/images/cover_page_background.jpg</xsl:attribute>
    <fo:table-column column-width="30.5mm"/>
    <fo:table-column column-width="160mm"/>
    <fo:table-column/>
    <fo:table-body>
    <fo:table-row height="100mm">
    <fo:table-cell number-columns-spanned="3">
    <fo:block/>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell>
    <fo:block/>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block text-align="left" font-size="22pt">
    <xsl:apply-templates mode="book.titlepage.recto.mode" select="bookinfo/subtitle"/>
    </fo:block>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block/>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell>
    <fo:block/>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block text-align="left" font-family="sans-serif" font-size="26pt">
    <xsl:apply-templates mode="book.titlepage.recto.mode" select="bookinfo/title"/>
    </fo:block>
    <fo:block text-align="left" font-family="sans-serif" font-size="8pt">
    Revision: <xsl:apply-templates mode="book.titlepage.recto.mode" select="bookinfo/revhistory/revision[1]/revnumber"/>
    </fo:block>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block/>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row height="30mm">
    <fo:table-cell number-columns-spanned="3">
    <fo:block/>
    </fo:table-cell>
    </fo:table-row>
    </fo:table-body>
    </fo:table>
    </fo:block>
    </fo:block-container>
    </xsl:template>


    Best of luck,
    Best regards,
    --
    Erik Rask
    Technical Information Architect
    Procera Networks
    ________________________________________
    From: Peter Desjardins <peter.desjardins.us@gmail.com>
    Sent: Wednesday, January 11, 2017 6:50:52 PM
    To: DocBook Apps
    Subject: [docbook-apps] PDF recto title page customization adds blank page before the verso title page

    Hi. I want the cover page of my book PDF to have a full-bleed color
    background so I added a fo:block-container that's the same size as the
    page and gave it the background-color attribute. This works well and
    the cover page looks great, but it also introduces a blank page
    between the recto title page and the verso title page.

    It seems that there's something about the recto title page that is
    spilling over into a new page but doesn't appear there at all.

    Has anyone else tried to do something like this? I found that I had to
    set negative margins of the block-container above and to the left of
    the page in order to center the colored background over the first
    page.

    I feel like I'm grasping at straws and really should understand what's
    going on much more clearly.

    Here's my customization for the book title page:

    <xsl:template name="book.titlepage.recto">
    <xsl:element name="fo:block-container">
    <xsl:attribute name="width">8.5in</xsl:attribute>
    <xsl:attribute name="height">11in</xsl:attribute>
    <xsl:attribute name="margin-left">-1.25in</xsl:attribute>
    <xsl:attribute name="margin-top">-0.75in</xsl:attribute>
    <xsl:attribute name="background-color">#ff4c00</xsl:attribute>
    <xsl:element name="fo:block">
    <xsl:attribute name="margin-top">6in</xsl:attribute>
    <xsl:attribute name="margin-left">2in</xsl:attribute>
    <xsl:element name ="fo:external-graphic">
    <xsl:attribute name="content-width">2in</xsl:attribute>
    <xsl:attribute name="src">
    <xsl:text>url(mylogo.svg)</xsl:text>
    </xsl:attribute>
    </xsl:element>
    </xsl:element>
    <xsl:element name="fo:block-container">
    <xsl:attribute name="margin-top">.2in</xsl:attribute>
    <xsl:attribute name="margin-left">.35in</xsl:attribute>
    <xsl:element name="fo:block">
    <xsl:attribute name="color">#ffffff</xsl:attribute>
    <xsl:attribute name="text-align">left</xsl:attribute>
    <xsl:attribute name="font-size">22pt</xsl:attribute>
    <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    <xsl:attribute name="font-weight">400</xsl:attribute>
    <xsl:value-of select="//d:book/d:info/d:title" />
    </xsl:element>
    </xsl:element>
    </xsl:element>
    </xsl:template>


    Thanks!

    Peter

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org




  • 3.  Re: [docbook-apps] PDF recto title page customization adds blank page before the verso title page

    Posted 01-19-2017 09:39
    Peter,
    A few more things that I remember having to tweak when I set up the cover pages:
    You may need to look at the page margin values (there's an excellent illustration on
    http://www.sagehill.net/docbookxsl/PrintOutput.html).

    I have explicit settings for the following ones:

    region.before.extent
    header.table.height
    body.margin.top
    page.margin.top
    region.after.extent
    footer.table.height
    body.margin.bottom
    page.margin.bottom
    page.margin.inner
    page.margin.outer

    Also, in the title page XML (which is transformed into a titlepage XSL by
    processing it with the docbook titlepage.xsl and then included in the customization
    stylesheet) there are things to consider,
    e.g:

    <t:titlepage-separator>
    <fo:block break-after="page"/>
    </t:titlepage-separator>

    <t:titlepage-before t:side="verso">
    <fo:block break-after="page"/>
    </t:titlepage-before>

    Hope this helps,
    BR /Erik R.
    ________________________________________
    From: Peter Desjardins <peter.desjardins.us@gmail.com>
    Sent: Wednesday, January 11, 2017 6:50 PM
    To: DocBook Apps
    Subject: [docbook-apps] PDF recto title page customization adds blank page before the verso title page

    Hi. I want the cover page of my book PDF to have a full-bleed color
    background so I added a fo:block-container that's the same size as the
    page and gave it the background-color attribute. This works well and
    the cover page looks great, but it also introduces a blank page
    between the recto title page and the verso title page.

    It seems that there's something about the recto title page that is
    spilling over into a new page but doesn't appear there at all.

    Has anyone else tried to do something like this? I found that I had to
    set negative margins of the block-container above and to the left of
    the page in order to center the colored background over the first
    page.

    I feel like I'm grasping at straws and really should understand what's
    going on much more clearly.

    Here's my customization for the book title page:

    <xsl:template name="book.titlepage.recto">
    <xsl:element name="fo:block-container">
    <xsl:attribute name="width">8.5in</xsl:attribute>
    <xsl:attribute name="height">11in</xsl:attribute>
    <xsl:attribute name="margin-left">-1.25in</xsl:attribute>
    <xsl:attribute name="margin-top">-0.75in</xsl:attribute>
    <xsl:attribute name="background-color">#ff4c00</xsl:attribute>
    <xsl:element name="fo:block">
    <xsl:attribute name="margin-top">6in</xsl:attribute>
    <xsl:attribute name="margin-left">2in</xsl:attribute>
    <xsl:element name ="fo:external-graphic">
    <xsl:attribute name="content-width">2in</xsl:attribute>
    <xsl:attribute name="src">
    <xsl:text>url(mylogo.svg)</xsl:text>
    </xsl:attribute>
    </xsl:element>
    </xsl:element>
    <xsl:element name="fo:block-container">
    <xsl:attribute name="margin-top">.2in</xsl:attribute>
    <xsl:attribute name="margin-left">.35in</xsl:attribute>
    <xsl:element name="fo:block">
    <xsl:attribute name="color">#ffffff</xsl:attribute>
    <xsl:attribute name="text-align">left</xsl:attribute>
    <xsl:attribute name="font-size">22pt</xsl:attribute>
    <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    <xsl:attribute name="font-weight">400</xsl:attribute>
    <xsl:value-of select="//d:book/d:info/d:title" />
    </xsl:element>
    </xsl:element>
    </xsl:element>
    </xsl:template>


    Thanks!

    Peter

    ---------------------------------------------------------------------
    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] PDF recto title page customization adds blank page before the verso title page

    Posted 01-19-2017 16:34
    Thanks, Erik and Bob! Trying these solutions, really appreciate the advice.

    Peter

    On Thu, Jan 19, 2017 at 4:39 AM, Erik Rask
    <erik.rask@proceranetworks.com> wrote:
    > Peter,
    > A few more things that I remember having to tweak when I set up the cover pages:
    > You may need to look at the page margin values (there's an excellent illustration on
    > http://www.sagehill.net/docbookxsl/PrintOutput.html).
    >
    > I have explicit settings for the following ones:
    >
    > region.before.extent
    > header.table.height
    > body.margin.top
    > page.margin.top
    > region.after.extent
    > footer.table.height
    > body.margin.bottom
    > page.margin.bottom
    > page.margin.inner
    > page.margin.outer
    >
    > Also, in the title page XML (which is transformed into a titlepage XSL by
    > processing it with the docbook titlepage.xsl and then included in the customization
    > stylesheet) there are things to consider,
    > e.g:
    >
    > <t:titlepage-separator>
    > <fo:block break-after="page"/>
    > </t:titlepage-separator>
    >
    > <t:titlepage-before t:side="verso">
    > <fo:block break-after="page"/>
    > </t:titlepage-before>
    >
    > Hope this helps,
    > BR /Erik R.
    > ________________________________________
    > From: Peter Desjardins <peter.desjardins.us@gmail.com>
    > Sent: Wednesday, January 11, 2017 6:50 PM
    > To: DocBook Apps
    > Subject: [docbook-apps] PDF recto title page customization adds blank page before the verso title page
    >
    > Hi. I want the cover page of my book PDF to have a full-bleed color
    > background so I added a fo:block-container that's the same size as the
    > page and gave it the background-color attribute. This works well and
    > the cover page looks great, but it also introduces a blank page
    > between the recto title page and the verso title page.
    >
    > It seems that there's something about the recto title page that is
    > spilling over into a new page but doesn't appear there at all.
    >
    > Has anyone else tried to do something like this? I found that I had to
    > set negative margins of the block-container above and to the left of
    > the page in order to center the colored background over the first
    > page.
    >
    > I feel like I'm grasping at straws and really should understand what's
    > going on much more clearly.
    >
    > Here's my customization for the book title page:
    >
    > <xsl:template name="book.titlepage.recto">
    > <xsl:element name="fo:block-container">
    > <xsl:attribute name="width">8.5in</xsl:attribute>
    > <xsl:attribute name="height">11in</xsl:attribute>
    > <xsl:attribute name="margin-left">-1.25in</xsl:attribute>
    > <xsl:attribute name="margin-top">-0.75in</xsl:attribute>
    > <xsl:attribute name="background-color">#ff4c00</xsl:attribute>
    > <xsl:element name="fo:block">
    > <xsl:attribute name="margin-top">6in</xsl:attribute>
    > <xsl:attribute name="margin-left">2in</xsl:attribute>
    > <xsl:element name ="fo:external-graphic">
    > <xsl:attribute name="content-width">2in</xsl:attribute>
    > <xsl:attribute name="src">
    > <xsl:text>url(mylogo.svg)</xsl:text>
    > </xsl:attribute>
    > </xsl:element>
    > </xsl:element>
    > <xsl:element name="fo:block-container">
    > <xsl:attribute name="margin-top">.2in</xsl:attribute>
    > <xsl:attribute name="margin-left">.35in</xsl:attribute>
    > <xsl:element name="fo:block">
    > <xsl:attribute name="color">#ffffff</xsl:attribute>
    > <xsl:attribute name="text-align">left</xsl:attribute>
    > <xsl:attribute name="font-size">22pt</xsl:attribute>
    > <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    > <xsl:attribute name="font-weight">400</xsl:attribute>
    > <xsl:value-of select="//d:book/d:info/d:title" />
    > </xsl:element>
    > </xsl:element>
    > </xsl:element>
    > </xsl:template>
    >
    >
    > Thanks!
    >
    > Peter
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >



  • 5.  Re: [docbook-apps] PDF recto title page customization adds blank page before the verso title page

    Posted 01-20-2017 21:22
    I fixed that problem with the advice here, thanks! The attribute that
    positioned the block-container correctly was absolute-position=fixed.

    <xsl:template name="book.titlepage.recto">
    <xsl:element name="fo:block-container">
    <xsl:attribute name="absolute-position">fixed</xsl:attribute>
    <xsl:attribute name="width">8.5in</xsl:attribute>
    <xsl:attribute name="height">11in</xsl:attribute>
    <xsl:attribute name="background-color">#ff4c00</xsl:attribute>
    [page contents omittted]
    </xsl:element>
    </xsl:template>

    I removed the negative margin-left and margin-top attributes that I
    had been using. Those were compensating for the page.margin.top and
    page.margin.inner attributes.

    I appreciate the help, the cover's looking great!

    Peter


    On Thu, Jan 19, 2017 at 11:34 AM, Peter Desjardins
    <peter.desjardins.us@gmail.com> wrote:
    > Thanks, Erik and Bob! Trying these solutions, really appreciate the advice.
    >
    > Peter
    >
    > On Thu, Jan 19, 2017 at 4:39 AM, Erik Rask
    > <erik.rask@proceranetworks.com> wrote:
    >> Peter,
    >> A few more things that I remember having to tweak when I set up the cover pages:
    >> You may need to look at the page margin values (there's an excellent illustration on
    >> http://www.sagehill.net/docbookxsl/PrintOutput.html).
    >>
    >> I have explicit settings for the following ones:
    >>
    >> region.before.extent
    >> header.table.height
    >> body.margin.top
    >> page.margin.top
    >> region.after.extent
    >> footer.table.height
    >> body.margin.bottom
    >> page.margin.bottom
    >> page.margin.inner
    >> page.margin.outer
    >>
    >> Also, in the title page XML (which is transformed into a titlepage XSL by
    >> processing it with the docbook titlepage.xsl and then included in the customization
    >> stylesheet) there are things to consider,
    >> e.g:
    >>
    >> <t:titlepage-separator>
    >> <fo:block break-after="page"/>
    >> </t:titlepage-separator>
    >>
    >> <t:titlepage-before t:side="verso">
    >> <fo:block break-after="page"/>
    >> </t:titlepage-before>
    >>
    >> Hope this helps,
    >> BR /Erik R.
    >> ________________________________________
    >> From: Peter Desjardins <peter.desjardins.us@gmail.com>
    >> Sent: Wednesday, January 11, 2017 6:50 PM
    >> To: DocBook Apps
    >> Subject: [docbook-apps] PDF recto title page customization adds blank page before the verso title page
    >>
    >> Hi. I want the cover page of my book PDF to have a full-bleed color
    >> background so I added a fo:block-container that's the same size as the
    >> page and gave it the background-color attribute. This works well and
    >> the cover page looks great, but it also introduces a blank page
    >> between the recto title page and the verso title page.
    >>
    >> It seems that there's something about the recto title page that is
    >> spilling over into a new page but doesn't appear there at all.
    >>
    >> Has anyone else tried to do something like this? I found that I had to
    >> set negative margins of the block-container above and to the left of
    >> the page in order to center the colored background over the first
    >> page.
    >>
    >> I feel like I'm grasping at straws and really should understand what's
    >> going on much more clearly.
    >>
    >> Here's my customization for the book title page:
    >>
    >> <xsl:template name="book.titlepage.recto">
    >> <xsl:element name="fo:block-container">
    >> <xsl:attribute name="width">8.5in</xsl:attribute>
    >> <xsl:attribute name="height">11in</xsl:attribute>
    >> <xsl:attribute name="margin-left">-1.25in</xsl:attribute>
    >> <xsl:attribute name="margin-top">-0.75in</xsl:attribute>
    >> <xsl:attribute name="background-color">#ff4c00</xsl:attribute>
    >> <xsl:element name="fo:block">
    >> <xsl:attribute name="margin-top">6in</xsl:attribute>
    >> <xsl:attribute name="margin-left">2in</xsl:attribute>
    >> <xsl:element name ="fo:external-graphic">
    >> <xsl:attribute name="content-width">2in</xsl:attribute>
    >> <xsl:attribute name="src">
    >> <xsl:text>url(mylogo.svg)</xsl:text>
    >> </xsl:attribute>
    >> </xsl:element>
    >> </xsl:element>
    >> <xsl:element name="fo:block-container">
    >> <xsl:attribute name="margin-top">.2in</xsl:attribute>
    >> <xsl:attribute name="margin-left">.35in</xsl:attribute>
    >> <xsl:element name="fo:block">
    >> <xsl:attribute name="color">#ffffff</xsl:attribute>
    >> <xsl:attribute name="text-align">left</xsl:attribute>
    >> <xsl:attribute name="font-size">22pt</xsl:attribute>
    >> <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    >> <xsl:attribute name="font-weight">400</xsl:attribute>
    >> <xsl:value-of select="//d:book/d:info/d:title" />
    >> </xsl:element>
    >> </xsl:element>
    >> </xsl:element>
    >> </xsl:template>
    >>
    >>
    >> Thanks!
    >>
    >> Peter
    >>
    >> ---------------------------------------------------------------------
    >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >>