AntennaHouse / pdf5-ml

Antenna House PDF5-ML DITA-OT Plug-in
23 stars 9 forks source link

If a fig includes an imagemap the figNumber is counted twice #134

Closed steinbacher01 closed 4 years ago

steinbacher01 commented 4 years ago

We've extended PDF5.ml to support imagemap links. But I've just discovered that the figure title is counting a fig with an imagemap twice.

I'm getting this in the output.

Figure 4-1 Figure 4-3 Figure 4-5

I tried to modify the value of the figCurrentAmount variable in dita2fo_bodyelements.xsl, but it doesn't change anything.

I added: [not(contains(@class,' topic/imagemap '))]

`

</xsl:variable>`

Any suggestions?

I can provide sample source files if needed.

Example fig with imagemap:

`

BIOPSY HORIZONTAL APPROACH
        <p>
            <imagemap>
                <image width="625" href="c_FruComponentLocation_img3.png"/>
                <area>
                    <shape>rect</shape>
                    <coords>65, 12, 177, 37</coords>
                    <xref format="dita"
                        href="r_FruInformationForTheBiopsyPositionerBp.dita#id_40002918/tEntry_FRU-Biopsy-Left-Frame"
                        >Biopsy left frame</xref>
                </area>
                <area>
                    <shape>rect</shape>
                    <coords>47, 97, 178, 123</coords>
                    <xref format="dita"
                        href="r_FruInformationForTheBiopsyPositionerBp.dita#id_40002918/tEntry_FRU-Plate-without-window"
                        >Plate without window</xref>
                </area>
                <area>
                    <shape>rect</shape>
                    <coords>2, 245, 258, 360</coords>
                    <xref format="dita"
                        href="r_FruInformationForTheBiopsyPositionerBp.dita#id_40002918/tEntry_FRU-Set-of-Core-Horizontal-Needle-Guide-Supports"
                        >Set of Core Horizontal Needle Guide Supports</xref>
                </area>
            </imagemap>
        </p>
    </fig>`
ToshihikoMakita commented 4 years ago

I'm getting this in the output. Figure 4-1 Figure 4-3 Figure 4-5

Not sure why you got this result because counting figure does not take into account whether fig contain imagemap or not.

Could you send me your sample source files?

steinbacher01 commented 4 years ago

Here are my sample source files. I've included both the GE and default PDF5.ml outputs.

ImageMap.zip

My guess is that imagemap is specialized from fig, so it is counting it twice. I'm thinking about changing the not(contains) to check for a nested fig. Maybe something like topic\fig\fig.

What do you suggest?

Thanks,

Leroy

ToshihikoMakita commented 4 years ago

My guess is that imagemap is specialized from fig

I missed this! Please confirm the updated result.

ImageMapTest-after.pdf

By the way how do you use imagemap in PDF output? I think it is useful for HTML but not for PDF.

Regards,

steinbacher01 commented 4 years ago

The result looks good. Thanks!

We use imagemaps for identifying replaceable parts on a device. The callouts in the fig link to a row in a table that contains the part number and information on how to replace the part.

FRU

This allows us to publish the same bookmap to PDF or webhelp with the same functional links.

Thanks again,

Leroy

ToshihikoMakita commented 4 years ago

This allows us to publish the same bookmap to PDF or webhelp with the same functional links.

Thank you! I understand your usage.