Menu

#14 Option to embed font (or skip reference)for pdf/a generation

closed
nobody
None
5
2009-02-23
2009-02-23
Anonymous
No

I cannot create PDF/A with FOP containing a barcode4j-barcode, because barcode4j creates a font-reference in the PDF. Fonts have to be embedded for pdf/a-standard.

Discussion

  • Jeremias Märki

    Jeremias Märki - 2009-02-23
    • status: open --> closed
     
  • Jeremias Märki

    Jeremias Märki - 2009-02-23

    Please note that, by default, Barcode4J uses "Helvetica" as default font for the human-readable part. This is documented as such in the Barcode XML documentation. For PDF/A you must use font that are configured to be embedded. So with the default, you'd have to explicitely configure Helvetica as an embeddable font. But you can also just tell Barcode4J to use another font that you have already set up. For example, if you use "Verdana" in your document, you can do this:

    <bc:barcode xmlns:bc="http://barcode4j.krysalis.org/ns" message="4194586705506+07">
    <bc:ean-13>
    <bc:human-readable>
    <bc:font-name>Verdana</bc:font-name>
    </bc:human-readable>
    </bc:ean-13>
    </bc:barcode>

    I've just verified that producing a valid PDF/A document is possible that way. HTH

     
  • Nobody/Anonymous

    Thanks for your answer. But I don't get it to work:

    This is part of my fop.xml fop-configuration:

    <fonts>
    <font kerning="yes" embed-url="xml/fonts/DejaVuSans.ttf">
    <font-triplet name="sans-serif" style="normal" weight="normal"/>
    </font>
    ..
    ..
    </fonts>

    Then I embed the following xsl-fo code:
    <barcode:barcode message="12345">
    <barcode:intl2of5>
    <barcode:height>12mm</barcode:height>
    <barcode:human-readable>
    <barcode:font-name>sans-serif</barcode:font-name>
    </barcode:human-readable>
    </barcode:intl2of5>
    </barcode:barcode>

    Then I get the fop-error:

    org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Helvetica

    If I remove the human-readable part of the barcode, no errors occur.

    What am I doing wrong?

     
  • Nobody/Anonymous

    I found the solution by myself, I had to write:

    <barcode:font-name>DejaVuSans</barcode:font-name>

    instead of

    <barcode:font-name>sans-serif</barcode:font-name>

     

Log in to post a comment.