SANDEEP SANGOLE - 2017-02-16

Hi All, I am using Apache FOP and barcode4j to generate barcode.The number of letters in my barcode is 18 and page width is 5.5cm. When I reduce the width barcode fits into the page and barcode is still scannable from pdf.But when its printed on paper its not printing propertly, lines are to dark and doesnt look clear. Could you please help me if there is any workaround ?

Find below XSL template,

<xsl:param name="message" as="xs:string"/>
<xsl:param name="height" as="xs:double" select="10"/>
<xsl:param name="width" as="xs:double" select="0.15"/>

<xsl:param name="text-align" as="xs:string" select="$TEXT_ALIGN_CENTER"/>
<xsl:param name="inter-char-gap-width" as="xs:integer" select="1"/>
<xsl:param name="quiet-zone" as="xs:integer" select="10"/>

    <fo:block text-align="{$text-align}"
              padding-top="0.2cm"
              padding-left="0.5cm"
              padding-right="0.5cm">

        <fo:instream-foreign-object>
            <barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns"
                             orientation="0"
                             message="{$message}">
                <barcode:code39>
                    <barcode:height>
                        <xsl:value-of select="concat($height, 'mm')" />
                    </barcode:height>
                    <barcode:module-width>
                        <xsl:value-of select="concat($width, 'mm')" />
                    </barcode:module-width>

                    <barcode:human-readable>
                        <barcode:placement>none</barcode:placement>
                    </barcode:human-readable>
                </barcode:code39>
            </barcode:barcode>
        </fo:instream-foreign-object>
    </fo:block>

    Have tried different combinations of wide factor, interchangable gaps but doesnt help.