We need a Macro for CorelDraw X8 (or X6) that will export to an XML file defining 2 lines of text and the coordinates of each character on the page. The page is 4" x 2" and the text will be located in the lower third of the page. The Fonts are (Arial and Arial Narrow 18 point). This is for iStamp software that drives a foil letter stamping machine.
iStamp sent us the attached PDF file to use as a guide.
This is a paid project.
PDF
I must confess I do not understand very well what exactly needed, even looking at pdf file...
So, can you post a corel file containing a sample text (with more lines, if this is the case) and xml necessary file to be the output? Even if it is created manually by somebody knowing the real need of the stamping machine... Can you ask that to iStamp?
Is that 'specification' made based on the machine written requirements or by somebody really knowing the machine needs, knowing also something about Corel?
In addition to that:
The text may contain only one row? And for each so named 'line' there is an Artistic Text? Or Artistic Text may contain many lines?
All the text of an Artistic Text will contain the same font and size for all characters? If the text is bold or italic it doesn't matter? If matters, in which tag and how to fill this piece of information?
Where from the information regarding the 'foil' color parameter will be taken? Should the application ask and somebody will fill it? Directly or selecting a text from a ComboBox?
If the jpg/png/bmp file containing the picture of the text to be stamped will have an element containing its path, where in the XML file to be that element and how to be named?
Which is the meaning of the next request?: "In addition, any control information that would be helpful to the operator (account number, order number, number of tags, due date, tag type code, etc.) could be included and displayed to the operator." Al this pieces of information should be contained in the XML file? If yes from where the application should take the information (except due date)? If not, in which phase and how to be they filled?
Should this application be used in Order Entry having an interface where the operator will manually introduce 'account number', 'order number'? That ''numbers of tags' does refer to line numbers? If not what does it mean? What does 'tag type code' mean?
If the two linked files cannot be provided, at least clarification about the rest of the issues should be necessary before starting such a project... And you will test the code and resulted file according to your needs and give feedback.
If I will understand all that I will maybe take it like a challenge and I will do it for free...
Attached is the CorelDraw X8 file with the text and the positioning. It's just 2 lines of text. The fonts will always be either Arial or Arial Narrow, Centered, and positioned as they are in this file. Thanks for all the help.
XML Test 1.zip
OK. The idea was to send a cdr file (sent) accompanied by the wished XML. In order to compare what I understood from your specification with reality on the battle field... If not possible let's try to better define the project them:
All x, y references depends on the page size. Will the foil be stamped on a shape having exactly the corel page dimensions? At least does it have the same left and bottom references? If Yes, this part of the solution is clear and not so complicate. If not, is it a scale to be taken in consideration when XML is issued? I just suppose that the material to be stamped should be somehow aligned to the bottom of the machine and the left (or right) size. This is very important to be settled... For instance I work on a cutting machine without OPOS and I am aligning the curve to be cut in the file at 6 mm above the bottom and at 9 mm to the right side, for defining its starting position.
Is it mandatory the both text lines belonging to the same Artistic Text?
I mean if each line would be a separate Artistic Text the code sample posted by NudeFan returns a XML similar to the one in your pdf...
Please try to answer the rest of my questions. Only knowing what is it about I can start working...
The Corel file the same size as the leather tag that will have the foil stamped on it.
The text can be 2 separate lines of artistic text.
The text in the Corel file is positioned where it needs to be stamped on the tag
Thanks again.
So, I suppose that you do not know too much about VBA in order to receive hints to develop your own application and you need a project as professional as possible. If I understood well I have in mind a project as following:
A Corel Docker made in C# having a graphic interface able to initially set the next parameters:
TextBoxes used to input 'account number', 'order number' and the path to a folder where files will be created using a Button and a Browse window. If 'order number' is something created during XML file preparation by increment of the last order, it can be automatically filled based on the last order number kept in a specific file and saved like the last one. If it is done by sales it should be filled manually. If 'account number' is something connected to the client and it is unique, if you are able to export from your ERP a list of client account numbers, it can be searched in that list and chosen by the Order Entry operator. Please confirm if this approach is useful and you are able to provide it. If not, please specify how do you wish to proceed on that issue.
You must define what 'number of tags, tag type code' means and according to that definitions we must settle if they can be defined by code during execution or in a different way. 'Due date' I suppose represents the XML creation date. If not, please specify its meaning. Also if you need also the creation time.
Operator prepares the layout in CorelDRAW page and press a button which basically does the next:
Prepare the XML file and save it in the folder previously selected using the browse window/button. This path will be saved in Registry and next time the docker will be opened it will be filled in the 'Saving Folder Path' text box. The name of the XML file can be created according to a settled algorithm. Maybe the order number. Maybe each month a new folder will be created named like 'current month_current year' and all orders processed in that month will be saved in that directory...
A jpg file (or png/bmp) for the text being processed will also be created (in a sub-folder of the main folder) named according to what we will settle. The same name of the XML file for instance. If this will be good enough in order to rapidly find it, this is OK. Otherwise a new element in XML file will keep the path to that file. We must define how to be named and where in the file to be placed in order not to bother the software processing the file.
If 'number of tags, due date, tag type code' mean something determined during XML processing and also XML file will keep in some places this information, such a way will be followed. If not, you must decide what they mean and how to deliver this information an a convenient way.
This project will be delivered with an installer able to move the necessary files in the appropriate place in order to make Corel opening the docker. During testing period I can deliver files necessary to manually be saved in a specific folder and you will give me the necessary feedback regarding how it works against your needs or you need something else even if it had not been settled from the beginning.
Is that OK with you?
Do you just need some hints and code samples in order to make on your own the necessary application and my initial assumption was wrong?
FanDuru, My responses are in Blue.
So, I suppose that you do not know too much about VBA in order to receive hints to develop your own application and you need a project as professional as possible. You are correct. I am a high-end designer that knows nothing about coding. If I understood well I have in mind a project as following:
TextBoxes used to input 'account number' Don't need this, 'order number Don't need this' and the path to a folder where files will be created using a Button and a Browse window We need this. If 'order number' is something created during XML file preparation by increment of the last order, it can be automatically filled based on the last order number kept in a specific file and saved like the last one Don't need this. If it is done by sales it should be filled manually. If 'account number' is something connected to the client and it is unique, if you are able to export from your ERP a list of client account numbers Don't need this, it can be searched in that list and chosen by the Order Entry operator. Please confirm if this approach is useful and you are able to provide it. If not, please specify how do you wish to proceed on that issue.
You must define what 'number of tags, tag type code' means and according to that definitions we must settle if they can be defined by code during execution or in a different way Don't need this. 'Due date' Don't need this. I suppose represents the XML creation date. If not, please specify its meaning. Also if you need also the creation time Don't need this.
Prepare the XML file and save it in the folder We need this previously selected using the browse window/button. This path will be saved in Registry and next time the docker will be opened it will be filled in the 'Saving Folder Path' text box Don't need this. The name of the XML file can be created according to a settled algorithm Don't need this. Maybe the order number. Maybe each month a new folder will be created named like 'current month_current year' and all orders processed in that month will be saved in that directory Don't need this...
A jpg file (or png/bmp) for the text being processed will also be created (in a sub-folder of the main folder) named according to what we will settle Don't need this. The same name of the XML file for instance. If this will be good enough in order to rapidly find it, this is OK. Otherwise a new element in XML file will keep the path to that file Don't need this. We must define how to be named and where in the file to be placed in order not to bother the software processing the file.
If 'number of tags, due date, tag type code' mean something determined during XML processing and also XML file will keep in some places this information, such a way will be followed Don't need this. If not, you must decide what they mean and how to deliver this information an a convenient way.
Do you just need some hints and code samples in order to make on your own the necessary application and my initial assumption was wrong? I know nothing about coding.
Thanks again for everyone's help.
OK. I will proceed...
But I cannot stop myself to give you some (useful, I think) ideas:
- It is good to have a Order Name. At least for traceability... If the customer climes something wrong with the product isn't it good to still have the XML file, easy to identify in order to understand if it was wrong or some machine settings? Besides that if the customer wants to repeat that specific order isn't it easy just sending to machine already created files (XML and JPG)? Anyhow the file (files) must be named somehow and I will provide a text box to be filled with this name. In my opinion the best name should be the Order Number. But it will be your choice...
- It is also good to have the folder path filled when you start the macro. Otherwise you loose time. I just suppose that you will have most of the time the same folder to save the files. So, I will save it in Registry and the form will load it during loading. If you wont to each time select a different folder this will not bother you at all. Just I do not like people loosing time...
Anyhow before running the code some checks must be done: If only two Artistic Text lines will be on the layout. If each of them contain only a line, if not other shapes will be on the layout to be saved in the JPG preview file, folder text box to be filled and so on...
I think I will firstly make a GMS file, I will send it to you and it will be your choice regarding decision to make a professional nice looking corel docker...
I also think we risk to bother other developers loosing time trying to understand something else then coding. So please send me a message, using my personal mail from my profile and I will reply to it and send the GMS file in attachment. Is that OK with you?
OK. I will proceed... (Excellent!)
- It is good to have a Order Name (Okay as long as it is not part of the XML file). At least for traceability... If the customer climes something wrong with the product isn't it good to still have the XML file, easy to identify in order to understand if it was wrong or some machine settings? Besides that if the customer wants to repeat that specific order isn't it easy just sending to machine already created files (XML and JPG)? Anyhow the file (files) must be named somehow and I will provide a text box to be filled with this name (Yes, a text box for the file name is good). In my opinion the best name should be the Order Number. But it will be your choice...
- It is also good to have the folder path filled when you start the macro (The path will be the same every time). Otherwise you loose time. I just suppose that you will have most of the time the same folder to save the files. So, I will save it in Registry and the form will load it during loading. If you wont to each time select a different folder this will not bother you at all. Just I do not like people loosing time...
Anyhow before running the code some checks must be done: If only two Artistic Text lines will be on the layout. If each of them contain only a line (Correct...the Artistic Text will have only 1 line each, and will always be ALL CAPS), if not other shapes will be on the layout to be saved in the JPG preview file, folder text box to be filled and so on...
Thank you very kindly.