rsheldon Posted June 10, 2015 Share Posted June 10, 2015 Good Afternoon All, I am trying to create a full service IMB using the font USPSIMBCompact. My original attempt to create this barcode was: var trackingStr = "00" + Field("MAILERID") + Field("SRVTYPEID") + Field("IMBSEQ"); return MakeOneCodeBarcode(trackingStr, Field("Z4, ZIP-4D"), 14); But my result used the font IDAutomationState. I know this is part of the coding in the return MakeOneCodeBarcode. I then tried to format the font by converting to javascript, as seen in the amended code below: var Var1 = "00" + Field("MAILERID") + Field("SRVTYPEID") + Field("IMBSEQ"); var Var2 = "Z4, ZIP-4D"; var Var3 = ""; var v_tracking = "5"; var v_font = "USPSIMBCompact.ttf"; var fontTag = false; var Var4 = ""; if (Var1.length != 20) ReportWarning("The tracking number is not the correct length of 20 characters in record number " + CurrentRecordNumber() + "."); if (Var2 != "") { if ((Field(Var2).length != 0) && (Field(Var2).length != 5) && (Field(Var2).length != 9) && (Field(Var2).length != 11)) ReportWarning("The routing number is not the correct length of 0, 5, 9, or 11 characters in record number " + CurrentRecordNumber() + "."); RoutingNum=Field(Var2); } else RoutingNum=""; return '<tracking newsize="' + v_tracking + '">' + MakeIntelligentMailBarcode(Var1, RoutingNum, Var3, fontTag, v_font, Var4) + "</tracking>"; This code works except the font is 10pt and I need it to be 14pt. I do not see where I can change the font size in the code. Also the font USPSIMBCompact does not preview or compose. Any help would be greatly appreciated! Thanks, Rob Sheldon Quote Link to comment Share on other sites More sharing options...
rsheldon Posted June 10, 2015 Author Share Posted June 10, 2015 I apologize, I forgot to mention that I am using a Mac 10.8.5 running Acrobat 10.1.14 with FusionPro 9.1.0 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 10, 2015 Share Posted June 10, 2015 Good Afternoon All, I am trying to create a full service IMB using the font USPSIMBCompact. My original attempt to create this barcode was: var trackingStr = "00" + Field("MAILERID") + Field("SRVTYPEID") + Field("IMBSEQ"); return MakeOneCodeBarcode(trackingStr, Field("Z4, ZIP-4D"), 14); But my result used the font IDAutomationState. I know this is part of the coding in the return MakeOneCodeBarcode. Yes. You can call EncodeOneCodeBarcode instead if you want to set the font and point size yourself. I then tried to format the font by converting to javascript, as seen in the amended code below: You converted what exactly? The "Intelligent Mail Barcode Rule" XML Template rule? var Var1 = "00" + Field("MAILERID") + Field("SRVTYPEID") + Field("IMBSEQ"); var Var2 = "Z4, ZIP-4D"; var Var3 = ""; var v_tracking = "5"; var v_font = "USPSIMBCompact.ttf"; var fontTag = false; var Var4 = ""; if (Var1.length != 20) ReportWarning("The tracking number is not the correct length of 20 characters in record number " + CurrentRecordNumber() + "."); if (Var2 != "") { if ((Field(Var2).length != 0) && (Field(Var2).length != 5) && (Field(Var2).length != 9) && (Field(Var2).length != 11)) ReportWarning("The routing number is not the correct length of 0, 5, 9, or 11 characters in record number " + CurrentRecordNumber() + "."); RoutingNum=Field(Var2); } else RoutingNum=""; return '<tracking newsize="' + v_tracking + '">' + MakeIntelligentMailBarcode(Var1, RoutingNum, Var3, fontTag, v_font, Var4) + "</tracking>"; This code works except the font is 10pt and I need it to be 14pt. I do not see where I can change the font size in the code. It's Var3 in your code (the third box in the original XML Template rule). Also the font USPSIMBCompact does not preview or compose. You need to specify the font by its family name, not by its TTF file name. So instead of "USPSIMBCompact.ttf", I think you want just "USPSIMBCompact". But all of that is way more complicated than what you need. I think all you really need to do is to have a very simple rule like so: var trackingStr = "00" + Field("MAILERID") + Field("SRVTYPEID") + Field("IMBSEQ"); return EncodeOneCodeBarcode(trackingStr, Field("Z4, ZIP-4D"), 14); And then apply the desired font and point size in the Text Editor. Quote Link to comment Share on other sites More sharing options...
dreimer Posted June 10, 2015 Share Posted June 10, 2015 If you have control of the data, I use the alpha characters for my IMB and then I can just apply the font to that field in a regular text box. No rule needed. Quote Link to comment Share on other sites More sharing options...
rsheldon Posted June 10, 2015 Author Share Posted June 10, 2015 Thanks Dan, This works...sometimes you can't see the forest through the trees. Thanks as always for getting me out of a tough spot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.