Item Label PDF in Circular Format

We can create circle item label, with the text inside. We cannot draw circle or adjust border radius in the netsuite pdf. Styles will not support. So we can upload a circle image in the filecabinet and can be set as background image.

Advanced pdf:

<?xml version=“1.0”?>

<!DOCTYPE pdf PUBLIC “-//big.faceless.org//report” “report-1.1.dtd”>

<pdf>

    <head>

        <link name=“TrajanPro” type=“font” subtype=“truetype” src=“https://833976.app.netsuite.com/core/media/media.nl?id=85363&amp;c=833976&amp;h=4gJKLbJrUW927fpAodcd53mL7O08l8bmenNBTCMvxYb7Hv-t&amp;_xt=.ttf” bytes=“2” />

        <style>

            * {

                font-family: TrajanPro;

            }

            td {

                padding-top: 0px;

                padding-bottom: 0px;

                padding-left: 0px;

                padding-right: 0px;

            }

            table {

                border-spacing: 0px;

                <!– background-image: url(‘https://833976.app.netsuite.com/core/media/media.nl?id=154513&amp;c=833976&amp;h=Vqo-ayw51WJ3Q0pRqipLx8dlnfFe-xf3IPbbEp95VwHyIbyf’);–>

                background-image: url(‘https://833976.app.netsuite.com/core/media/media.nl?id=154514&amp;c=833976&amp;h=3PTU7v2bYQJrga_JDHDfoH3X0yKrAIQ-NT4CaQZyWvzRp4xO’);

                background-size: cover;

                width: 1.25in;

                height: 1.25in;

            }

        </style>

    </head>

    <body style=“padding:1px;width:1.25in;height:1.28in;”>

        <#if itemData?has_content>

            <#list itemData as label>

                <#assign contentLength=(label.length)?number />

                <#if contentLength gt 220>

                    <#assign fontSize=4>

                        <#elseif contentLength gt 200>

                            <#assign fontSize=4>

                                <#elseif contentLength gt 170>

                                    <#assign fontSize=4.5>

                                        <#elseif contentLength gt 140>

                                            <#assign fontSize=5>

                                                <#elseif contentLength gt 120>

                                                    <#assign fontSize=5.5>

                                                        <#elseif contentLength gt 100>

                                                            <#assign fontSize=6>

                                                                <#elseif contentLength gt 90>

                                                                    <#assign fontSize=6>

                                                                        <#elseif contentLength gt 70>

                                                                            <#assign fontSize=6.5>

                                                                                <#elseif contentLength gt 67>

                                                                                    <#assign fontSize=6.5>

                                                                                        <#elseif contentLength gt 63>

                                                                                            <#assign fontSize=6.5>

                                                                                                <#elseif contentLength gt 59>

                                                                                                    <#assign fontSize=6.5>

                                                                                                        <#elseif contentLength gt 55>

                                                                                                            <#assign fontSize=7>

                                                                                                                <#elseif contentLength gt 53>

                                                                                                                    <#assign fontSize=7>

                                                                                                                        <#elseif contentLength gt 40>

                                                                                                                            <#assign fontSize=8>

                                                                                                                                <#elseif contentLength gt 31>

                                                                                                                                    <#assign fontSize=8>

                                                                                                                                        <#else>

                                                                                                                                            <#assign fontSize=8.5>

                </#if>

                <table class=“circle-label” width=“100%” vertical-align=“middle” align=“center”>

                    <tr>

                        <td align=“center” style=“font-size: ${fontSize}pt;”>

                            <p align=“center” vertical-align=“middle”>${label.nameLine1}

                                <br />${label.nameLine2}

                                <br />

                                ${label.authenticity}

                            </p>

                        </td>

                    </tr>

                </table>

            </#list>

        </#if>

    </body>

</pdf>

Leave a comment

Your email address will not be published. Required fields are marked *