1 Reply Latest reply on Sep 28, 2017 5:33 AM by williamadowling

    Convert JPG/PNG using AI

    rachellep93463543

      @williamdowHi,

       

      I want to create a dynamic PNG/JPG file programmatically for AI extension.

       

      For photoshop i'm using this approach:

      Created a PSD as a template, parse it and created duplicate of it in JSX, then replace the content of all the layers and merge/convert it to JPG and PNG.

      var templateDoc = app.open(new File(extPath + '/images/zcdp_palette_template_'+orientation+'.psd'));

       

        var dupeDoc = templateDoc.duplicate(filePath.match(/[^\/]+$/)[0]);

        templateDoc.close(SaveOptions.DONOTSAVECHANGES);

       

      But this code is not working in AI. It throws error while duplicating the psd. //templateDoc.duplicate() is not a function

       

      Is it possible to maintain same code base for PS and AI

       

      Or is there any other approach in AI to create PNG/JPG and place text and color rectangle on x,y axis of document (HTML5 Canvas style)

       

      williamadowling