Dear friends, our team operates under full capacity during these unprecedented times of COVID-19 outbreak. See full statement.

To apply for a special quarantine discount for services or an extended trial license without watermark, please write us.

LiveArt Blog

Best Tools for Working With LiveArt HTML5 Output Files

In LiveArt HTML5 Product Designer, we heavily rely on the SVG format that becomes an industry standard for web applications, including responsive apps for tablets and smartphones. SVG represents a clean vector format, which means it always looks crisp and nice regardless of your resolution, monitor, or device. Whether it’s Retina-based or plain old LCD, the vector would render without any artifacts.

However, in the back office of the decoration industry, there is always state-of-the-art software that requires a specific format the output should be. In some cases, this is 300 dpi PNG or TIFF, in other - EPS or PDF vector formats. Since these may not relate to the web, one needs to be able to produce proper production output out of the LiveArt HTML5 one.

If you are using LiveArt Shop solutions like Magento, Shopify, or WooCommerce, the proper output technology could be already built-in. If you are integrating LiveArt yourself, there are multiple tools you can use to convert the output LiveArt Design SVG into the appropriate format for your production purposes.

Read more

Inkscape
Inkscape is a tool that was developed originally for authoring and editing SVG files. Due to its open-source nature, it’s freely distributed and also included as a port for major server platforms, including Ubuntu. By using Inkscape from the command-line, you can convert the vector into EPS or rasterize with given DPI setting into hires PNG.
Pros: all-in-one application, easy to install;
Cons: requires lots of resources, slow on bulk converts;

PhantomJS
PhantomJS is an extension to NodeJS and can be used to accomplish PNG previews of the web pages. By utilizing this feature, one can also prepare screenshots out of the designs produced by users. PhantomJS might be the right choice if you are a NodeJS fan or need quick and straightforward conversion of SVG into PNG formats of various dimensions.
Pros: integrated into NodeJS platform, easy to run;
Cons: no implementations for other platforms, supports raster only;

CloudConvert
This is a new hosted service that also features API to upload and convert images in numerous formats. Among others, it can export SVG into several formats like EPS, PNG, TIFF, and so on.
Pros: no need to install server software, quick and robust;
Cons: requires API development, does not have font embedding option;

ImageMagick
Last but not least, is the choice of millions of developers around the world, the magnificent ImageMagick image library, and the command-line tool. This is an extremely powerful tool that can identify, convert, and edit images using vast options and opportunities. While it focuses on bitmap processing as its main purpose, ImageMagick’s convert command-line tool can be used to produce large bitmap images from SVG. Best results achievable with rsvg delegate, which is installed as a separate application.
Pros: a swiss knife of the image processing, easy to install, already included into number of shared hosting servers, fast;
Cons: no vector to vector conversion support, lower quality compared to other tools;

Regardless of the solution, you would choose, LiveArt team would always be glad to assist and consult on obtaining a production-ready output for your particular integration or project.

 

Upgrade guide to LiveArt HTML5 0.9.5 <= 0.9.3

This post briefly describes the new attributes that became available with the 0.9.5 version of LiveArt.

Read more

config.json

New attributes can be used as optional unless they start to throw exceptions in the console.

{ 
    ... 
    "defaultProductSize": [ 32, 16 ], 
    ... 
}

defaultProductSize attribute can be set for arbitrary size products (e.g., signs) and is non-mandatory.

{ 
    ... 
    "options": {
        "includeProductInDesign": true,
        "includePrintingAreaInDesign": true, 
        "includeMaskInDesign": true,
    }
    ... 
}

include* attributes allow including/excluding certain working elements from the designer SVG output. These will be hidden, if false.

Some other options section attributes include, with examples:

  • "checkeredBackground": true, - allows putting a checkered background in the empty area;
  • "unit": "in", - specifies main units symbol;
  • "unit2": "ft", - specifies 2nd units symbol that will be automatically recalculated if necessary;
  • "unitConversionMult": 12, - conversion rate between specified units;
  • "showProductSelector": true, - whether to show 1st tab, i.e. ability to select product;
  • "checkTextFXThrottle": 400 - delay to wait for the text effect

textEffects block introduced to define the raster text effects generator;

product.json

Additional definitions for products allow for more flexible product setup, including newly introduced signs.

"namesNumbersEnabled": true, - enable names/numbers for specific product;

"clipRect": [170, 75, 410, 485] - clips everything beyond this area, can be same as printable area definition;

    "colorizableElements": [
        {
            "name": "Color",
            "id": ".bg.fill",
            "colors": [
                {
                    "name": "White",
                    "value": "#FFF"
                },
                {
                    "name": "Black",
                    "value": "#000"
                },
                {
                    "name": "Steel Blue",
                    "value": "#4682B4"
                },

With colorizableElements you can now use single multicolor SVG with multiple colorizable areas.

"multicolor": true, should be strictly used with colorizableElements to ensure colorizing.

"resizable": true, indicates that the product can be resized. Should be used with sign type of products.

"showRuler": true, shows ruler for resizable products.

"editableAreaUnitsRange": [
    [10, 100],
    [10, 100]
]

You can indicate the validation range for the sign dimensions using the above attribute inside locations block. Used with sign-based products only.

"editableAreaSizes": [
    {"label":"3x10in", "width":3, "height":10},
    {"label":"4x4in", "width":4, "height":4}
],

Use the above construction if you need to define a set of strict sizes, which can be selected.

"hideEditableAreaBorder": true, can be used to hide the printable area frame for specific products.

"locations": [
                        {
                            "name": "Back",
                            "image": "products/iPhone/bg.svg",
                            "mask": "products/iPhone/iPhone.png"
                        }
                    ],

Use mask reference in location to specify a mask that should be an overlay per certain product location.

fonts.json

boldAllowed, italicAllowed allows disabling the bold, italic for certain fonts if they are not available.

ascent quite specific attribute that is required to calculate the real height of letters for sign products. Its representation should indicate font height in pixels for 32pt font size.

vector this reference is required if you plan to use the vector effects.

All in all, we highly recommend looking into the sample config files you receive with an upgraded package to learn the practical usage of new attributes.

Working With Quote Services In LiveArt HTML5

Unlike many other plugins, LiveArt HTML5 provides a flexible way to build your own quoting in an online product designer. Any option or design element that is added to the working area will affect the quote if it is required by the business rules of your solution. This article describes in brief how quote services work and provide insight for integration teams.

Read more

The quote service is located in the main config.json file. Open the file and locate the line, which designates the endpoint that will handle the quote

"getQuoteUrl": "http://localhost/services/getQuote.php",

Since you would prefer to obtain a quote dynamically, based on selections of the user, you would place some sort of dynamic script into getting Quote service. Referring to a static file, for example, would always return the same price and totals no matter what the selections are and you would not want that.

Once the endpoint is set, use the Fiddler tool, Inspector, or Firebug to see what is being sent to the endpoint when the quote is requested. You would typically get the following JSON structure in the POST request as a “data” variable.

{
  "product":{ "id":"11", "color":"#FFF", "colorName":"White" },
  "locations":[
    {
      "name":"Front",
      "colors":2,
      "colorsList":["#4682b4","#000"],
      "designedArea": 384.60,
      "designedAreaRect": 480.50,
      "objects":[
        {
          "type":"txt",
          "designedArea":126.97,
          "colors":1,
          "colorsList":[
            "#4682b4"
          ]
        },
        {
          "type":"svg",
          "designedArea":258.63,
          "colors":1,
          "colorsList":["#000"]
        }
      ],
      "objectCount":2,
      "letterings":1,
      "images":1
    }
  ],
  "quantities":[{"size":"XS","quantity":1}],
  "namesNumbers":[]
}

While the product ID, color, or location name would be an obvious variable, some of them require explanation, as below:

  • colors - the number of colors used in design; this value is very usable for screen printing quotes. A “-1” value would mean the design contains a photo or too many colors;
  • colorsList - is a list of hex values for each used colors;
  • designedArea - area in units (inches, feet, any kind you designate as part of Product JSON), occupied by design. The designArea is a sum of designAreas for each of the elements.
  • designedAreaRect - an area of a rectangle, in units, occupied by all design elements;

Now once you obtain all these variables, LiveArt HTML5 would expect the following reply from you, the example goes below:

{
  "prices":[
    {"label":"Item Price", "price":"$29"},
    {"label":"Decoration", "price":"$15"},
    {"label":"Discount 0.25%", "price":"-$0.11"},
    {"label":"Total", "price":"$43.89", "isTotal":true}
  ]
}

All in all, you have just got little into Get Quote request, it’s structure, and the way it’s expected to work with LiveArt HTML5. Make sure to check our PHP sample code including reading variables and calculating color-based decoration fees.