Prabhakaran
Prabhakaran

Reputation: 4013

Internal links not working after processing the pdf that is generated using weasyprint

I have generated a PDF file with table of content and other internal links in this format

<div class="page headerconf" id="toc" style="page-break-before:avoid;page-break-after:avoid;margin-top:-30px;">
    <div>
        <h1>Table of Contents</h1>
        <ol>
            <li>
                <a href="#project">
                    <span>Project Details</span>
                </a>
            </li>
            <li>
                <a href="#others">
                    <span>Others </span>
                </a>
            </li>
...
...
...
        </ol>
    </div>
</div>

And this is how my content goes,

<div class="main" id="contents">
    <!DOCTYPE html>
    <html>
        <head lang="en">
            <meta charset="UTF-8">
            <title></title>
        </head>
        <body>
            <a name="project" />
            <div id="project" style="width:100%;page-break-before : always;page-break-after : always;font-size:13px;margin-top:-30px;">
                <h3 class="heading">Project Details</h3>
                <br>
                <div>
                </div>
            </div>
        </body>
    </html>
</div>

PDF has been generated and all internal links are working until here.

After the pdf generated we send this file to Java itext to download all attachments(image, pdf) and merge as a single pdf. After this process all the internal links are stopped working, but those links to be downloaded and attached files are working.

I had a conversation with Weasyprint contributor and it seems to be fixed through itext. Any one can help resolve this?

Upvotes: -3

Views: 38

Answers (0)

Related Questions