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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: Re: [docbook] Can't open a figure in section of pdf using olink from other pdf.


Hi,

In the mail chain, i needed to access figure, table, para of other pdf from the current pdf. So, i added the template as mentioned to my customization layer. And i could access these tags using olink tag and generated PDFs looked correct.

<xsl:template match="d:figure|d:table|d:example|d:para"

              mode="fop1.foxdest">

  <xsl:variable name="id">

    <xsl:call-template name="object.id"/>

  </xsl:variable>

  <xsl:variable name="bookmark-label">

    <xsl:apply-templates select="." mode="object.title.markup"/>

  </xsl:variable>

  <xsl:if test="$id != ''">

    <fox:destination internal-destination="{$id}"/>

  </xsl:if>


  <!-- Put the root element bookmark at the same level as its children -->

  <!-- If the object is a set or book, generate a bookmark for the toc -->


  <xsl:choose>

    <xsl:when test="self::d:index and $generate.index = 0"/>

    <xsl:when test="parent::*">

      <fox:destination internal-destination="{$id}"/>

        <xsl:apply-templates select="*" mode="fop1.foxdest"/>

    </xsl:when>

    <xsl:otherwise>

      <fox:destination internal-destination="{$id}"/>

      <xsl:apply-templates select="*" mode="fop1.foxdest"/>

    </xsl:otherwise>

  </xsl:choose>

</xsl:template>


But, because of this template i am getting the following warning messages while generating these documents using xsltproc and FOP:


WARNING: Destination: Unresolved ID reference "id2846293" found.

May 12, 2014 12:01:54 PM org.apache.fop.events.LoggingEventListener processEvent

WARNING: Destination: Unresolved ID reference "id3105986" found.

May 12, 2014 12:01:54 PM org.apache.fop.events.LoggingEventListener processEvent

WARNING: Destination: Unresolved ID reference "id3105990" found


These occur only when i added para tag option to the template above in my customization layer of stylesheet. These messages appear for the para tags in which i haven't explicitly mentioned IDs. The Default id is being created in .fo file in as <fox:destination xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" internal-destination="id2846293"/> 


Could you please help me in fixing these warning messages?


Thanks and Regards,

Anmol



On Fri, Jan 17, 2014 at 1:54 PM, anmol gupta <anmolgupta11090@gmail.com> wrote:
Hi Bob,

Its working now. Thanks a lot for helping me out. :)

Regards,
Anmol


On Fri, Jan 17, 2014 at 11:57 AM, Bob Stayton <bobs@sagehill.net> wrote:
Hi Amnol,
I think I found the problem.  For FOP output to have all targets in the PDF, each id must have an FOP-specific element output to the .fo file:

 <fox:destination internal-destination="{$id}"/>

These are generated with templates in mode="fop1.foxdest", which reside in fo/fop1.xsl.  The problem is that there is no such template for figure or other formal elements, only structural elements.  I can add that for the next release.  Until then, you can copy the template from that file that starts like this to you customization layer:

<xsl:template match="set|book|part|reference|
                     preface|chapter|appendix|article|topic
                     |glossary|bibliography|index|setindex
                     |refentry
                     |sect1|sect2|sect3|sect4|sect5|section"
              mode="fop1.foxdest">

and change the match attribute to

  match="figure | example | table" [and any other elements you need]

Then it will generate that fox:destination element for those elements as well.

Let me know if that does not work.


--
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

On 1/16/2014 9:30 PM, anmol gupta wrote:
Hi,

I am using Apache FOP version 1.1 and Docbook stylesheet version 1.78.1.

Yes, i could access the section through olink tag.

In the example mentioned above when i changed the targetptr to section
id. i.e. targetptr="abc_gui_9". Then i correctly opens this section of
the abc.pf <http://abc.pf> from 123.pdf.


I checked target.db file for this and the section comes under <div
element> tag and figure comes under <obj element> tag of this section.

Thanks and Regards,
Anmol


On Thu, Jan 16, 2014 at 10:49 PM, Bob Stayton <bobs@sagehill.net
<mailto:bobs@sagehill.net>> wrote:

    Hi,
    It should work.  What XSL-FO processor are you using, and what
    version of the stylesheets?

    Also, do other olinks to sections work?
    --
    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net <mailto:bobs@sagehill.net>




    On 1/15/2014 10:39 PM, anmol gupta wrote:

        Hi,

        I used the following syntax:

        (abc.pdf)

              <section id='abc_gui_9'>

        <title>The GUI</title>

        <para>The following figure shows:

        </para>

        <figure id='abc_gui_fig_1'>

        <title>Main Window</title>

        <mediaobject>

        <imageobject>

        <imagedata valign="top" fileref="./images/Designer.__png"

        scalefit="1"

        width="100%" contentdepth="100%"/>

        </imageobject>

        </mediaobject>

        </figure>

            </section>

        (123.pdf)

              <para>Do one of the following in the <olink
        targetdoc="book-abc"

        targetptr=”abc_gui_fig_1">Main Window</olink> window: </para>

        It does not open abc.pdf at Figure directly. Instead it opens
        the first
        page of abc.pdf. Is there some way by which I can directly open
        at the
        figure of abc.pdf from the other pdf?

        Thanks and Regards,

        ..Anmol








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