Import and use variable data from CSV files in CorelDraw

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ส.ค. 2024
  • The plug-in for working with variable data ReproScripts VDP allows not only loading data from an external csv file, but also selecting images by name and sequentially substituting them in the correct position.
    To see how this works, we prepared seven images and a test file with a list of employee data.
    The file has a simple structure and can be easily created in Excel and exported to csv format.
    As a template, we will use a CorelDraw file with a badge design for an employee.
    We have added three text objects, each of which needs to be filled with data from the file.
    Two rectangles reserve space for the barcode and employee image.
    Let's launch the plugin and create a new working project.
    At the first step, we need to go to the Template tab and set the active document as a source file by clicking on the button below.
    This is necessary for the project to form the required folder structure into which images and the CSV file could be loaded.
    After that, on the Data tab, click on the plus icon and add a new field with data of the 'Data from file' type.
    As you can see in the drop-down list there is no file from which the plugin should take data.
    To make it appear, you need to copy the CSV file to the files folder inside the project's working folder.
    Finding this folder is easy - just click on the icon with the folder and the magnifying glass.
    It will be opened in the explorer - there we will copy our CSV file with the list of employees.
    As soon as the file is in the folder, it will immediately appear in the list and will be preselected for work.
    Now you need to specify which elements to use from the file into the data field.
    The first field is the employee ID - which is located in the first column of the CSV file.
    Therefore, let's add an element and configure it to load all words from the first column.
    Duplicate the field and open it for editing.
    Now we need the full name of the employee, which is located in the second and third columns of the CSV file.
    The plugin allows you to form complex composite fields from data loaded from a file, which we are currently using.
    First, let's change the column number for the first element.
    As the second, add a text element with a space - which will separate the two parts of the name.
    And the third element is the text from the third column.
    Thus, we have merged two columns into one value.
    As well we take the position title of the employee for the last field from the fourth column.
    Now let's go to the Template tab and one by one choosing text objects in the template document we will bind them to data.
    Having selected an object, click on the plus icon in the plugin list and indicate from the drop-down list what data will be inserted into it.
    Since the identifier field in the data file contains only a number, in the plugin, you can set the ID as a static prefix - it will always be added before the data.
    Select the rectangle at the bottom and assign a CODE-128 barcode to it with the data from the identifier field.
    In the tab with data, the plugin estimates how many records are present in the data file.
    In our case, seven.
    This will be the number of records that the plugin will process and write to the finished file.
    Let's run the project and check that the ReproScripts VDP plugin created a file with seven pages, each of which contains the necessary data taken from the CSV file.
    Now let's try to substitute a photo for each employee.
    To do this, select a rectangle that serves as a placeholder and add it in the Template tab by specifying the Image type.
    Since the names of the photo files coincide with the employee identifier, you need to select 'Empl ID' as the data field.
    And the images themselves need to be copied to the images folder of the project, which opens by clicking on the link.
    Having launched the project, we see that the images were indeed detected and substituted in the right place.
    But they were not prepared in the correct size.
    To fix this, open the parameters of the photo object in the project and select 'Fit the frame proportionally' from the drop-down list instead of 'Do not resize'.
    Let's run the project again.
    The images have been scaled and positioned.
    In the Result tab, you can additionally customise the result of the generation.
    For example, there you can specify the need to perform automatic layout on paper of the desired size.
    Setting for the list of paper sizes and other parameters is called by the icon at the bottom right of the status bar of the plug-in window.
    Now the plug-in will not only form the data and substitute it into the template, but also calculate the optimal layout of the finished print run on the printed sheet, add a bleed and trim marks.
    In just a few seconds, you can get a completely print-ready file.

ความคิดเห็น •