This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use barcode4j with custom messages???  RSS feed

 
Subhadip Chatterjee
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
I am using "barcode4j" with Apache FOP, to generate barcode and print in a PDF. Now, the barcode is taking only hard-coded messages. How can i pass, custom messages in that?

Below, is my custom xsl-code::
<fo:block>
<fo:instream-foreign-object>
<barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns"
message="1234567">
<barcode:Code39> <barcode:height>1.5cm</barcode:height></barcode:Code39>
</barcode:barcode>
</fo:instream-foreign-object>
</fo:block>

let m know, how to pass custom messages into 'message' section?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you just write some Java code that generates this piece of XML and inserts whatever message you like into the XML? And then pass the generated XML to Apache FOP.
 
Subhadip Chatterjee
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
That's a really good advice, which i've tried but failed. Thething is, whenever i am trying pass the generated xml from java to XSL-transformer, as a param, it's taking the xml, as a String(of course, it should). So, how do i append the xml from java into XSL file?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!