User Tools

Site Tools


merkalt:label_image_render

Render label requests are coming from the next sources

  1. Customer rendering of preview (saved in temporary file as it is impossible to identify customer berofe order issued. Temporary files are cleared by system)
  2. When order is processed, customer and webmaster emails image attachements are used. Additionally each order label could be retrieved as URL with a special unique label marker

Background actions for rendering

Rendering of image is based on 'layers' abstraction. There are several type of layers - some applied to the whole picture, some render small object like text inside container, or image.

  1. color or backgroundColor layers fill either background or all label objects with certain color
  2. backgroundImage layer sets certain image as background
  3. size layer allows to setup canvas size used
  4. motif layer allows to setup an image inside the label. Specific top margin could be setup for motif layer
  5. text layers allows to add different text blocks to label. The algorythm includes the such steps as:
    1. definition of font type
    2. setting up an initial free area of the text container
    3. definition of font size to be used (based on available free space)
    4. re-calculation of text container sizes (if there are several lines)
    5. definition of horizontal offset for the certain block (if there are several lines)
    6. setup correct vertical gaps (if there are several lines)
merkalt/label_image_render.txt · Last modified: by ramil