• I want to thank all the members that have upgraded your accounts. I truly appreciate your support of the site monetarily. Supporting the site keeps this site up and running as a lot of work daily goes on behind the scenes. Click to Support Signs101 ...

Summa + Manual barcodes

jerry369

New Member
When I manually grabbed files I always wondered why the last digit was missing... I'm guessing the last digit is the way onyx dictates if its mirrored or not.
GoProduce automatically rotates by 180° the file depending on whether the barcode ends with the number 5 or 0
 

ikarasu

Active Member
Alrighty... Took a lot longer than I thought, and I'm only "mostly" done the bones of it. My javascript skills are almost completely non existent now, guess that happens when you never use them! I've had to chatgtp probably 1/2 of the code, then manually go in and tweak it to get it to work. used to be able to write this stuff from scratch... the good ol' days.

Right now it'll generate the postnet barcode using a random 11 digit code (ending with 0 on the front of the sheet), then generate the top barcode with a 5 instead of a zero... I havent got around to having it generate the text for the top yet as I haven't even checked if the summa will read the barcode or not. It'll auto size based on how wide the artboard is... And place itself .2" from the top and bottom, so you currently manually have to re-size the artboard.




Going to do a test print tomorrow to see if it'll read the barcode...and if it will, if I can get it to pull the barcode file as a pdf, or if I have to mess with winplot.

If that works... I'll finish it, clean the code up a bit more.... Then maybe get it to also generate the opos marks while auto resizing the artboard, so the summa script becomes redundant.... since all it really does is place fiducials somewhat evenly on the screen, not even on the artboard... just a set distance from the artwork.


If all goes well and it works I'll upload it... Im sure not many people have use for it, but better than paying $200 for it on etsy! The etsy one seems to be manual... itll generate the barcode then they show themselves manually moving it to position... seems weird. Also seems weird how low-budget the summa plugin is now that Ive had time to play with it / write an script for illy! It's something a real Java programmer could write up in 15 minutes, its very basic compared to their normal software. hopefully somewhere down the line they put more effort into it.
 

ikarasu

Active Member
If you could get the OPOS XY Extra to work I would really love it.. I am very interested in this..
I should have it working by end of next week.

For some reason all the postnet barcodes I'm generating don't match perfectly with the ones onyx generates... 99% of the chars are fine but it looks like there's an additional char at the beginning, so summa is saying there aren't enough letters.

I manually fixed the barcode and the summa reads it fine... Even imports it as pdf and works perfectly! I was dreading having to use winplot like people said was nreded. So I just need to print a few barcodes and figure out what the beginning few lines so it generates them properly. I'll probably play with it a lot over the weekend! But happy to say the proof of concept worked... Unless something extreme happens it should be more than possible.
 

Saturn

Your Ad Here!
That's awesome ikarasu. Love seeing this sort of thing, especially since it always opens the door for other tinkerers to the possibilities of doing something similar themselves.

I could be wrong, but it looks like the summa barcodes are bracketed by a tall bar that's not part of the name or number value at either end. Not sure if it's a postnet standard or summa thing.
 

ikarasu

Active Member
Hmm, could be. Haven't had time to play with it. I did generate a regular barcode and the hand scanner picks it up perfectly.... So I know it works for sure at least, just need to figure out the format of the postnet barcode.


If it's just the guard rail it'll be easy enough to fix as I imagine I can have it generate one.... There's also a postnet font I can use and have it generate it that way too, trying to make it so people don't have to install a font for it though.


If all goes well I may turn it into a fully featured addon.. summa add-ons seem easy because their softwares pretty robust and handles most of the backendz it's just placing fiducials / barcodes in specific spots, etc. would be nice to have an option to generate the fiducials inside of the image area instead of outside of it for stuff that has a tight fit.

Would also be nice to have an option to have it generate the layers inside of your current window instead of open a new one.. and maybe auto grab cutcontour and perf and throw it on the right layer... Etc.

Small project turned into a big one!
 

Christian @ 2CT Media

Active Member
Here are the SDKs I used to build my automation Javascript to add marks and barcodes. I also wrote an algorithm to generate a barcode with the current date midday and 4 random digits to allow for 10000 daily files and then I place a 0 or a 5 for top and bottom or a 6 and 9 for left and right.

The Postnet requires a start and end character for alignment. The biggest thing is the spacing and the xy bar.
 

Attachments

  • Programmers Guide F-series flatbed cutters.pdf
    872.1 KB · Views: 21
  • programmers guide Summa Cutters_dec_2020.pdf
    885.5 KB · Views: 23
  • SDK_Summa GoProduce.pdf
    649.6 KB · Views: 24

Christian @ 2CT Media

Active Member
I had access on my phone, here is some of my code hopefully it helps you:

var moduleMain=function(ticket) {
for each(var inputFile in ticket.getInputFiles()) {
const fileWidth = inputFile.getProperty('MetaDataExtractor/NormalizedPageFormat/Width', PropertyType.FLOAT).value;
const fileHeight = inputFile.getProperty('MetaDataExtractor/NormalizedPageFormat/Height', PropertyType.FLOAT).value;

ticket.job.setFloatProperty('SUMMA', 'barWidth', fileWidth); // Set to the Width of the File
ticket.job.setFloatProperty('SUMMA', 'barHeight', 8.50394); // Force to 3mm
ticket.job.setFloatProperty('SUMMA', 'barHeightPlus', 35.4375); // Force to 3mm
ticket.job.setFloatProperty('SUMMA', 'pageWidth', fileWidth + 72); // Set to the Width of the File + Mark Spacing
ticket.job.setFloatProperty('SUMMA', 'pageHeight', fileHeight + 99.225); // Set the Height of the File + Barcode Spacing

const barcodes = generateUniqueCodes();
const stdCode = barcodes[0];
const rotCode = barcodes[1];
const cutFilename = `${barcodes[2]}.pdf`;

const markPositions = calculatePrintMarks(fileWidth);
const railMarkSpacing = calculateRailMarkPositions(fileHeight);

let markFile = ticket.storage.rootResourceFolder.createSub('PrintMark/SUMMA_Bar.pdf');
var outMarkFile = ticket.getOutputRunList('BAR').copyFile(markFile, FileState.OK);
outMarkFile.setIntegerProperty('SUMMA', 'stdCode', stdCode);
outMarkFile.setIntegerProperty('SUMMA', 'rotCode', rotCode);
outMarkFile.setStringProperty('SUMMA', 'cutFilename', cutFilename);

ticket.job.setIntegerProperty('SUMMA', 'stdCode', stdCode);
ticket.job.setIntegerProperty('SUMMA', 'rotCode', rotCode);
ticket.job.setStringProperty('SUMMA', 'cutFilename', cutFilename);
ticket.job.setStringProperty('SUMMA', 'summaMark1', markPositions[0]);
ticket.job.setFloatProperty('SUMMA', 'summaMark1Position', markPositions[1]);
ticket.job.setStringProperty('SUMMA', 'summaMark2', markPositions[2]);
ticket.job.setFloatProperty('SUMMA', 'summaMark2Position', markPositions[3]);
ticket.job.setFloatProperty('SUMMA', 'railMarkSpacing', railMarkSpacing);

ticket.OKOutputRunList.addFile(inputFile);
}
};

function generateUniqueCodes() {
// Get the current date
const now = new Date();

// Format month, day, and year to be 2 digits each using leftPad
const month = leftPad(now.getMonth() + 1, 2); // +1 because months are 0-indexed
const day = leftPad(now.getDate(), 2);
const year = leftPad(now.getFullYear(), 4).slice(-2); // Get last 2 digits of year

// Generate 4 random digits
const randomDigits = Math.floor(1000 + Math.random() * 9000); // Ensures a 4-digit number

// Concatenate everything and add the final digits
const baseCode = month + day + year + randomDigits;
const codeWithZero = baseCode + '0';
const codeWithFive = baseCode + '5';
//ticket.log.info(`STD Code: ${codeWithZero}, ROT Code: ${codeWithFive}`);

return [codeWithZero, codeWithFive, baseCode];
}

function leftPad(number, targetLength) {
/*
* Adds leading zeros to a number until it reaches the specified length.
* @param {number|string} number - The number to pad.
* @param {number} targetLength - The desired length of the output string.
* @returns {string} The padded number as a string.
*/

// Convert the number to a string
var output = number + '';

// Add zeros to the front of the string until the desired length is reached
while (output.length < targetLength) {
output = '0' + output;
}

// Return the padded string
return output;
}

/**
* Calculates the center position(s) based on the width following the specified rules.
* @param {number} width - The width in millimeters.
* @returns {Array} An array of center position(s).
*/
function calculatePrintMarks(width) {
let summaMark1 = 'DrillHole None.pdf';
let summaMark2 = 'DrillHole None.pdf';
let summaMark1Position = 0;
let summaMark2Position = 0;

if (width <= 1417.5) {
// Do nothing for widths of 500mm or less
return [summaMark1, summaMark1Position, summaMark2, summaMark2Position];
} else if (width <= 2126.25) {
// Find center for widths between 500mm and 750mm
summaMark1 = 'MC_Regmarks.pdf';
summaMark1Position = (width / 2) - 18;
return [summaMark1, summaMark1Position, summaMark2, summaMark2Position];
} else {
// For widths greater than 750mm, divide into three segments
// and find the two division points
var segmentLength = width / 3;
summaMark1 = 'MC_Regmarks.pdf';
summaMark1Position = segmentLength - 18;
summaMark2 = 'MC_Regmarks.pdf';
summaMark2Position = (segmentLength * 2) - 36;
return [summaMark1, summaMark1Position, summaMark2, summaMark2Position];
}
}

/**
* Calculates the ideal spacing of marks along the side of the page, trying to be as close to the standard spacing as possible.
* @param {number} fileHeight - Total length of the image in DTP points.
* @returns {number} Ideal spacing in DTP points.
*/
function calculateRailMarkPositions(fileHeight) {
var maxBedSize = 8640; // Maximum bed working size in DTP (120in)
var minSpacing = 432; // Minimum spacing in DTP (6in)
var standardSpacing = 1417.5; // Standard spacing in DTP (19.685in, 500mm)

// Calculate the number of full beds and the length of the final bed
var fullBeds = Math.floor(fileHeight / maxBedSize);
var finalBedLength = fileHeight % maxBedSize;

// If there is only one bed, use standard spacing
if (fullBeds === 0 || (fullBeds === 1 && finalBedLength === 0)) {
return standardSpacing;
}

// Start with the standard spacing
var idealSpacing = standardSpacing;

// Adjust the spacing for the final bed if necessary
if (finalBedLength > 0 && finalBedLength < standardSpacing * 2) {
while (idealSpacing > finalBedLength / 2 && idealSpacing > minSpacing) {
idealSpacing /= 2; // Halve the spacing until it fits within the final bed
}
}

// Ensure the spacing is within the acceptable range
return Math.min(Math.max(idealSpacing, minSpacing), standardSpacing);
}
 

Graphic Extremes

Knows To Little
It takes and puts a solid bar thru at the crop marks so the Summa can track better during jobs. Takes a little longer to cut, but the cuts are perfect.
 

Attachments

  • OPOS Cutting Marks.png
    1,015.8 KB · Views: 30

Christian @ 2CT Media

Active Member
It takes and puts a solid bar thru at the crop marks so the Summa can track better during jobs. Takes a little longer to cut, but the cuts are perfect.
I never quite understood the OPOS Xtra... I've always just built multiple files and used the barcode server. I assume it's a bit faster without scanning barcodes but it's also less recoverable if there is a mistake.
 

ikarasu

Active Member
I never quite understood the OPOS Xtra... I've always just built multiple files and used the barcode server. I assume it's a bit faster without scanning barcodes but it's also less recoverable if there is a mistake.
wont^ the extra be for printers that bow the print? It looks to me like it's there for compensation for when say a latex printer warps in the center.

Kind of does the same thing if you put producers in the center... But in those examples for some reason all of the producers are on the outside, so maybe Suma prefers a bar to detect the better
 
Last edited:

ikarasu

Active Member
I'm losing my mind.

I have it generating 11 digits, and the front and end bar... still the same issue saying invalid amount.

so I took one generated by onyx and used the postnet font... It has the beginning, 11 digits, then it ends in a 4... then it has the end large mark. wheres the 4 come from?!

The worst part is since I cant print to PDF, I manually type each #... then in my head im going small large small small... large small large large.... I've seen enough postnet barcodes to last me a lifetime, why not just use regular barcodes! :roflmao:

Printing a few random small items just to compare the codes.... everything else is setup and working great.... just need to figure out the barcode format.


think I figured it out...

"
The last five bars in the barcode make up the correction character. The sum of the 11 digits
and the correction character must equal to a multiple of 10."

So if the barcode is 12345678912, The total sum of the barcode is 48.... So it needs a 12th digit to be 2, so the barcode is divisable by 10.... And then the large bar... That seems stupid. going to manually put a barcode in my file and see if thats how it works. I'm sure theres a reason for it to be that way, and It's my fault for just glancing over it... but holy shit, I remember why I got out of programming and this simple, yet lets do this random shit thing that makes no sense is one of the reasons!


[edit] And it worked! But for some reason it's opening the PDF up sideways.... I have a feeling if I generate the code instead of use a PDF it would work fine. More playing and banging my head against the wall upcoming... least I got barcodes working!
 
Last edited:

Christian @ 2CT Media

Active Member
If it's opening up sideways it could be the file needs to be rotated 90 degrees in the pdf... i had that issue after the last goSign update. Now all my files need to be saved sideways for the barcode rotation to work
 

ikarasu

Active Member
If it's opening up sideways it could be the file needs to be rotated 90 degrees in the pdf... i had that issue after the last goSign update. Now all my files need to be saved sideways for the barcode rotation to work
Good to know it can do it, but it'd be annoying rotating the pdfs! Hopefully it's just a glitch that they can fix in the next gosign.

I can open the PDF normally with import and it opens fine - so its just when the barcode calls it for some reason. I did find I could open the PDF, hit save and save it is sjgp (Or whatever it is) in the barcode folder, with the barcode #, and then gosign would open it up fine - so its just an extra click until they fix it.
 

balstestrat

Problem Solver
Good to know it can do it, but it'd be annoying rotating the pdfs! Hopefully it's just a glitch that they can fix in the next gosign.

I can open the PDF normally with import and it opens fine - so its just when the barcode calls it for some reason. I did find I could open the PDF, hit save and save it is sjgp (Or whatever it is) in the barcode folder, with the barcode #, and then gosign would open it up fine - so its just an extra click until they fix it.
Can you not change your barcode macro to do the rotation correctly? Or am I missing something here.
 
Top