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
Where I have a lack of KnowHow: What do you need to send to this printer? Will it work with a 'normal' Corel print job where the Corel document you send to the printer has exactly the size your final output needs? I haven't tested it before, but it should be possible to add a document to a certain print queue.
I also haven't practical experience with that, but it also should be possible to trigger Corel with a command button on an Excel sheet.But where I have tons of experiences is, that you can read in a CSV or Txt (XML, Json, …) file and update or append a row with needed data with one click.
What I also did a few times before is, that I triggered Word or PowerPoint from Excel where I submitted somehow information from the current Excel sheet or the currently visible rows. What I saw with a quick view, Corel can be used for that as well.Means: It should be theoretical possible to have a workbook with macros which has
- A command button you have to click when a scanner provided data to a file and this information is imported to the current sheet. If the information is for a single item, it's no problem to place the cursor to the added / updated line
- Then the user has to do either nothing or set the filter / cursor to a certain line or range. Maybe he needs to update some information not given in the input file in the Excel sheet (e.g. printer or layout)
- The next command button will cause then that the Corel application is started in Excel, creates out of the information from the current row(s) one or more images and send them to a printer.
If all information (with a hint for the layout and printer) is given in the CSV (or similar) file, it's also not a huge challenge to run Corel in a kind of server mode: It scans each 1/5/10/30 sec/min/hour one or more directories for new CSV-Files. If there is something new available, it reads the content, creates out of it a printable file, send it to the printer and renames/delete afterwards the CSV. Depending on the folder the Scanner save's the file, it's also no problem to define for this information printer and layout.
Maybe more detailed information will inspire me to even more possibilities, maybe some other details will force me to say: Mission impossible.
But: If you want me to do this, it will not happen within the next days, since I have to follow a regular job and need to take care about my old mother. If you think, you can do it as well with some hints from my side, maybe it's much faster.
This is obviously possible but are you able to select a specific Imposition layout (probably a custom one) from the existing imposition layouts? Ai mean programmaticaly (from VBA). It is not impossible using API to identify the prind window and then controls on it (FindWindowEX and SendMessage) but not so easy...
The PrintSettings.Layout does not offer this possibility.
My first paragraph started with ' Where I have a lack of KnowHow: …' and this might be exactly the issue you show up. I have no clue what an 'Imposition layout' is, but I know, that's no issue to create a document with exact the size of the sheet to print on. If you have a ruler you can measure the coordinates of certain fields you need to print on. If your information has the same unit as you set up your document, you can say e.g. Place the serial number to x=30 mm and y=150 mm (or inch etc.) Maybe you need to recreate a layout, but I don't consider this as a big problem. Somehow you have to read in the CSV file: If you know, that you are at the column containing the serial number, you can directly say, that this information shall be printed at x,y. If I look at the shown image and I have a file where all variables are in (directly or indirect, maybe you need to parse the e.g. 5 digit of the serial number to the description), I'm pretty sure, that I can create either an image with only the information afterwards printed in the cells or create the entire layout to print it on a nude sheet.
You can find/select the `Imposition layout` on the `Layer` tab of the print form.
You can create such custom layouts in order to save some work. For instance a Visit Card layout like I have is something very useful. But I do not know how to acces this setting using VBA. I am not sure it si possible without API...
Maybe neither using API, on a modal form like the Print one looks to be...
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.