Page 1 of 1

Redirect from clickable image to a topic in PDF

Posted: Thu Feb 18, 2021 7:39 pm
by shantanu93
Hi,

I am trying to hyperlink an image to a topic in PDF output format, so that when anyone clicks on the image in the PDF output, it redirects to a specific topic somewhere else in the PDF.

I found some documentation around using an imagemap to accomplish this. But creating an imagemap only adds a link to the topic before the image.

How can I make the image itself clickable. Here's what I have tried:

Code: Select all

                <imagemap id="imagemap_ayc_455_r4b">
                    <image href="images/xyz.png" height="900"
                        id="image_tx1_xrd_7812"/>
                    <area>
                        <shape>rect</shape>
                        <coords>3, 8, 508, 343</coords>
                        <xref href="topic.dita"/>
                    </area>
                </imagemap>

Re: Redirect from clickable image to a topic in PDF

Posted: Fri Feb 19, 2021 9:13 am
by Radu
Hi,

If you are publishing to PDF using the classic XSL-FO based publishing, you need to install this extra plugin which should add clickable hotspots to images:

https://github.com/Amplexor/com.amplexor.imagemap-pdf

If you are publishing to PDF using our Oxygen CSS-based PDF processor, we made this work out of the box in Oxygen 23.0.

Regards,
Radu

Re: Redirect from clickable image to a topic in PDF

Posted: Thu Feb 25, 2021 1:04 pm
by shantanu93
Hello,

Thank you for the pointer. I am using the XSL-FO based publishing.
After I install the plugin using the command,

Code: Select all

dita --install <zip of plugin from github>
then change the imagemap.hotspot.enabled to 'yes' and build a pdf.

Now using below code in my dita file:

Code: Select all

<p>
            <imagemap id="imagemap_wxq_4wb_t4b" >
                <image href="../images/image.png" id="image_gfl_tws_qnb"/>
                <area>
                    <shape>rect</shape>
                    <coords>488, 218, 679, 360</coords>
                    <xref href="target.dita#detxxx"  format="dita" scope="local"/>
                </area>
            </imagemap>
        </p>
I get a popup saying "The document is trying to connect to ..." and opens the dita file on my local system outside.

How can I get it to scroll to the target dita within the pdf? Can it even be done?

Thanks in advance

Re: Redirect from clickable image to a topic in PDF

Posted: Thu Feb 25, 2021 3:38 pm
by Radu
Hi,

I'm not the owner of the plugin, I see there is an issue there for making it work with Apache FOP (which is the default PDF processor bundled with Oxygen):
https://github.com/Amplexor/com.amplexo ... f/issues/2

maybe you can add a comment there, maybe also upload a sample DITA project.
So it's possible this plugin only works when publishing DITA content using the Antenna House PDF processor to produce the final PDF.
In Oxygen 23.1 (which we'll release in about 2 weeks) our CSS-based DITA to PDF publishing will have out of the box support for this. Unfortunately the classic XSL-FO based PDF processor is not our main future improvement direction.

Regards,
Radu