A few question on barcode 128
2 posts • Page 1 of 1
A few question on barcode 128
G'day from the land of Oz.
Q 1. I want to be able to generate my own 128 barcode on Mac running El Capitan. What are the character id's of your Start (set B) and Stop characters? I can't find them anywhere on your site.
Q 2. I've tried to use your sample fonts in a piece of code that is below, in ACROBAT DC. Unfortunately the code generated defaults to the font 'Arial', and disregards my set font. After the Watermark is created, I can select the text in Edit mode, and manually set it's font to "MRV Code128bXSA". Do you have remedy for this? I'm supposed to use the Postscript name of the Font, but when I use 'MRVCode128bXSA', which is shown in the FontBook app, it still doesn't work.
tell application "Adobe Acrobat"
activate
set p to 1
tell document 1
tell page 1
set cbox to {}
if cbox = {} then set cbox to crop box
if cbox = {} then set cbox to bounds
if cbox = {} then set cbox to media box
if cbox = {} then set cbox to art box
if cbox = {} then set cbox to trim box
if cbox = {} then set cbox to bleed box
set p to 4
set pageTop to (item 2 of cbox) + 36
set p to 5
set item 2 of cbox to pageTop
set p to 6
set pageBottom to (item 4 of cbox)
set p to 7
set item 4 of cbox to pageBottom
set p to 8
set bounds to cbox
set p to 9
set media box to cbox
set p to 10
set crop box to cbox
set p to 11
set trim box to cbox
set p to 12
set bleed box to cbox
set p to 13
set art box to cbox
set p to 14
set theNewString to ((character id 209) & "this is a test" & (character id 211) as text)
#
# values are Text, Font, Font Size, Start Page, End Page, Text type?, Horizontal Alignment, Vertical Offset, Horizontal Offset, Vertical Height, Rotation, Current Page
set p to 15
set theResult1 to my Add_WaterMarkText(theNewString, "MRV Code128bXSA", 16, 1, 1, 1, 0, 3, 10, 0, 0, 1)
do script theResult1
end tell
end tell
end tell
# This handler uses Java Script
#
on Add_WaterMarkText(cText, cFont, nFontSize, nS, nE, nTA, nHorizontalAlignment, nVerticalAlignment, nHorizontalValue, nVerticalValue, nR, currentPage)
set Params to "cText: '" & cText & "'," & return
set Params to Params & "cTextFont: '" & cFont & "'," & return
set Params to Params & "nFontSize: '" & nFontSize & "'," & return
if class of nS is integer then set Params to Params & "nStart: " & (currentPage - 1) & "," & return
if class of nE is integer then set Params to Params & "nEnd: " & (currentPage - 1) & "," & return
-- 0 = left, 1 = centre, 2 = right
if class of nHorizontalAlignment is integer then set Params to Params & "nHorizAlign: " & nHorizontalAlignment & "," & return
-- 3 = top, 4 = bottom
if class of nVerticalAlignment is integer then set Params to Params & "nVertAlign: " & nVerticalAlignment & "," & return
-- offset in points
if class of nHorizontalValue is integer then set Params to Params & "nHorizValue: " & nHorizontalValue & "," & return
-- offset in points
if class of nVerticalValue is integer then set Params to Params & "nVertValue: " & nVerticalValue & "," & return
if class of nR is integer then set Params to Params & "nRotation: " & nR & "," & return
set Params to Params & "bOnScreen: true" & "," & return
set Params to Params & "bOnPrint: true" & "," & return
set Params to Params & "bOnTop: true" & "," & return
set Params to Params & "nOpacity: 1.0" & "," & return
set javascript to "this.addWatermarkFromText({" & Params & "});"
return javascript
end Add_WaterMarkText
Q 1. I want to be able to generate my own 128 barcode on Mac running El Capitan. What are the character id's of your Start (set B) and Stop characters? I can't find them anywhere on your site.
Q 2. I've tried to use your sample fonts in a piece of code that is below, in ACROBAT DC. Unfortunately the code generated defaults to the font 'Arial', and disregards my set font. After the Watermark is created, I can select the text in Edit mode, and manually set it's font to "MRV Code128bXSA". Do you have remedy for this? I'm supposed to use the Postscript name of the Font, but when I use 'MRVCode128bXSA', which is shown in the FontBook app, it still doesn't work.
tell application "Adobe Acrobat"
activate
set p to 1
tell document 1
tell page 1
set cbox to {}
if cbox = {} then set cbox to crop box
if cbox = {} then set cbox to bounds
if cbox = {} then set cbox to media box
if cbox = {} then set cbox to art box
if cbox = {} then set cbox to trim box
if cbox = {} then set cbox to bleed box
set p to 4
set pageTop to (item 2 of cbox) + 36
set p to 5
set item 2 of cbox to pageTop
set p to 6
set pageBottom to (item 4 of cbox)
set p to 7
set item 4 of cbox to pageBottom
set p to 8
set bounds to cbox
set p to 9
set media box to cbox
set p to 10
set crop box to cbox
set p to 11
set trim box to cbox
set p to 12
set bleed box to cbox
set p to 13
set art box to cbox
set p to 14
set theNewString to ((character id 209) & "this is a test" & (character id 211) as text)
#
# values are Text, Font, Font Size, Start Page, End Page, Text type?, Horizontal Alignment, Vertical Offset, Horizontal Offset, Vertical Height, Rotation, Current Page
set p to 15
set theResult1 to my Add_WaterMarkText(theNewString, "MRV Code128bXSA", 16, 1, 1, 1, 0, 3, 10, 0, 0, 1)
do script theResult1
end tell
end tell
end tell
# This handler uses Java Script
#
on Add_WaterMarkText(cText, cFont, nFontSize, nS, nE, nTA, nHorizontalAlignment, nVerticalAlignment, nHorizontalValue, nVerticalValue, nR, currentPage)
set Params to "cText: '" & cText & "'," & return
set Params to Params & "cTextFont: '" & cFont & "'," & return
set Params to Params & "nFontSize: '" & nFontSize & "'," & return
if class of nS is integer then set Params to Params & "nStart: " & (currentPage - 1) & "," & return
if class of nE is integer then set Params to Params & "nEnd: " & (currentPage - 1) & "," & return
-- 0 = left, 1 = centre, 2 = right
if class of nHorizontalAlignment is integer then set Params to Params & "nHorizAlign: " & nHorizontalAlignment & "," & return
-- 3 = top, 4 = bottom
if class of nVerticalAlignment is integer then set Params to Params & "nVertAlign: " & nVerticalAlignment & "," & return
-- offset in points
if class of nHorizontalValue is integer then set Params to Params & "nHorizValue: " & nHorizontalValue & "," & return
-- offset in points
if class of nVerticalValue is integer then set Params to Params & "nVertValue: " & nVerticalValue & "," & return
if class of nR is integer then set Params to Params & "nRotation: " & nR & "," & return
set Params to Params & "bOnScreen: true" & "," & return
set Params to Params & "bOnPrint: true" & "," & return
set Params to Params & "bOnTop: true" & "," & return
set Params to Params & "nOpacity: 1.0" & "," & return
set javascript to "this.addWatermarkFromText({" & Params & "});"
return javascript
end Add_WaterMarkText
- OzSanta
- Posts: 1
- Joined: Sat Feb 27, 2016 11:38 pm
Re: A few question on barcode 128
OzSanta,
Thank you for the interest in our software.
The Code128B string for ACROBAT DC is ÉACROBATÌDCÂËÍ
You can verify with our web utility - FontPal web http://www.morovia.com/fontpal-web/
Or read the source code at http://www.morovia.com/kb/Morovia-Font- ... 10011.html. Note that some functions may not work on Mac because the encoding used for extended ASCII is different from the one on windows. You need to translate these characters to Mac Roman encoding.
Thank you for the interest in our software.
The Code128B string for ACROBAT DC is ÉACROBATÌDCÂËÍ
- É Code128B start character
- ACROBATÌDC data encoded, Ì for space
- Â check character
- ËÍ stop character (note that it is actually two characters: stop character + termination bar)
You can verify with our web utility - FontPal web http://www.morovia.com/fontpal-web/
Or read the source code at http://www.morovia.com/kb/Morovia-Font- ... 10011.html. Note that some functions may not work on Mac because the encoding used for extended ASCII is different from the one on windows. You need to translate these characters to Mac Roman encoding.
The information above is provided "AS IS", with no warranties, and confers no rights.
-
glitch - Support Engineer
- Posts: 198
- Joined: Wed May 14, 2008 2:42 pm
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest