Following pseudo code seems ideal, but the object is to send printmerge data to laser engraver w/o operator understanding (or having the chance to screw up) CorelDRAW, file format, etc.
1. Operator selects template from a list of ~10.2. Operator scans barcode which is the name of a datafile (probably, CSV w/.txt extension)3. macro, behind the scenes, uses printmerge functionality to Merge to New Document
Optionally:4. Allows user to select from a list of 8-10 Imposition Layouts5. Sends to a print driver.
If no "takers," Any/All of that "doable" with VBA? I don't see any way to record or access Print Merge functions(?).
Roy Brewer
Without digging deeper into the 'Imposition layout': With what I understood until now, you don't need this to achieve the result. Maybe you can use this layout (if it's a readable XML or something else file) to initialize an array, but this is something which you need to convert in VBA.With that what I know until now I would do the following:I create an array with a record for all finally on the output-form needed values. Each record contains some information where I get the information from (maybe it's the 6th column in the CSV-File or the content of the column with the caption 'SerialNo' in an Excel sheet) and the coordinates where I have to put it finally to. I initialize this array with a parameter, so I can use it later also for other needs (layouts / 'Imposition layout', input files, ….)The second step will be, to read from the source the values needed for this particular output and store it as an attribute for each record.Then you should do a check, if all needed attributes are available and makes sense. Here you are also able to translate certain values, maybe you decode the 6th character in the serial number and say: If this is a '1' the variant name is 'Heavy load pump', if 2 it's 'Standard pump'. You can do this in the VBA, but you also can read it from a file / Excel sheet / database.Next step is then to use the ID I used to initialize the data array. With this I can either create a new CDR-Document with a particular size or open an existing one and check how many pages this document have and if there is a free gap on one page I can use now for my output. This depends finally on the needs for the project.If I have defined somehow a location in the CDR-Document where I can print my information, I run through my array and print each information to the location I have defined in the Init for the array.Then – depending on the ID for the array init – I select a print queue and put either my entire document in the queue or I have to convert it before to a bitmap and send this to the printer.If this is done I can repeat the steps after the Init of the array with the next record.If the steps are done carefully, this routine should be robust against different layouts of the input file (If the CSV / XML / … will contain in future more information not (yet) needed for this purpose), should be able to serve different printer / layouts / methods to initialize the print process.If you prefer the Corel server method, you can scan different directories for new jobs. You can say: Scan 'C:\PrintIt\TypeShields\*.Csv' and process the new files with setting 1 to initialize the array and the print queue. Then you can go to the next folder and scan there for new jobs and the setting 2. A little more effort would be to do first a pre analysis of the input file that you can say: If Column 'type' is available, read out first the value of the type and decide then with this value which setting are needed.After you processed a file you should rename / delete / move it, that you see, that this job had been done already.If you do it via an Excel sheet, this sheet may have such a column or it may depend on the sheet where you start the Corel actions from.There are many possibilities to make such a process 'idiot prove', if you have a 'Corel Server' (a computer which is waiting only for new jobs like that) and your scanner is able to save after each click this input file somewhere to the network, you can setup the process that way, that after a scan the type shield drops out of the printer. But I don't think, that this make sense, if you have to do this job once a week, if you have to do this 10 times per hour, you can think about it.As you see, there are many ways to reach that what I understood until now from Roy's request, how to solve it finally best depends on a lot of details, not (yet) offered here.
Maybe I am wrong, but I am afraid you missed the point. Just because it looks you do not understand very well how imposition process really works, I think...
The program/macro has to be as simple as possible in order tu USE EXISTING SUCH IMPOSITION LAYOUTS created by people knowing what they are doing. And it has to work for ANY SUCH NEW LAYOUT...
I know that each job can be done in a specific way using VBA but I understood that they need a program able to deal also with the future such imposition layouts... I understood that they just want to automate their existing way to work.
But maybe my understanding is the wrong one and it's time for RoyBrewer to clarify the issue...
I mean that "imposition layout" is the standard one offered by Corel imposition tool, or just an expression to define something to be printed?
Probably easiest to simply bypass CorelDRAW's imposition engine/presets and have the macro tile the output onto a fresh page. We have several macros that do this. e-cut, variablestool2, monstermerge. Sancho did it with Cardgen also.
Can you better explain your need?
1. What that templates have to be? A Corel `cdt` file? Will they be contained on a printed list? If not, how else?
2. Why barcode scan is needed if the real specific need is to access a datafile? Why not the application will acces a specific folder and the name of the datafile will be on the list and selected by operator? It is easy to add all the files name in a ComboBox...
3. OK. But if the need will be well described maybe other approach can be taken in consideration too. Sometimes Print Merge is not good enough in case of big words/numbers which may exceed the layout boundaries and a size check/adapt should be necessary.
4. Do you mean the standard ”Corel Imposition Layout`? Or a page arranged in a way to be printed directly
5. No problem...
Can you imagine such a project and put here a link to a transfer site in order to acces that samples in order to better understand your need?
FaneDuru (& others in this thread),
I'll start gathering some files to illustrate what the ideal solution might look like {.CDR, .CLY, .CSV.}. and make them available to anyone interested. However I'm certainly open to other solutions that would not include PrintMerge & Imposition layout. It would just be so neat if those could be used since they are well understood and accomplish exactly what I need. I seriously doubt that either can be accessed or the three programs Jeff mentioned in MacroMonster would have used them.
Scanned bar code is requested to eliminate possibility of operator typo. It could scan either the CSV file path (which might have the .CDR filename included in an otherwise unused column) or a .CDR file (that might have the CSV path in an unprtinted layer)
The "template" to which I referred could be a .CDT, or a standard .CDR which would identity where fields from the .CSV would go.