0 Replies Latest reply on Jun 23, 2016 4:14 AM by tejaarukoti

    Export the Illustrator document to buffer data.




      I need export the illustrator document to one buffer data variable.  I am successful in export the Illustrator document to .PNG file using below snippet.


              AIDataFilter* dstfilter = NULL;
                AIDataFilter* filter;
            AIErr result = sAIDataFilter->NewFileDataFilter (file, "write", 'prvw', 'PNGf', &filter);
             if (!result)
                  result = sAIDataFilter->LinkDataFilter (dstfilter, filter);
                  dstfilter = filter;
           result = sAIImageOpt->MakePNG24 (art, dstfilter, params, MyRasterizeProgressProc);



      But, I want to store in a buffer variable. I tried following snippet, which fails to do it.


          size_t image_Size = 1024*1024;
          char store[image_Size];
               AIErr result = sAIDataFilter->NewBufferDataFilter(image_Size,&filter1);
             if (!result)
                         result = sAIDataFilter->LinkDataFilter (dstfilter1, filter1);
                         dstfilter1 = filter1;
         result = sAIImageOpt->MakePNG24 (art, dstfilter1, params, MyRasterizeProgressProc);
         result = sAIDataFilter->ReadDataFilter(dstfilter1,store,&image_Size);



      After executing the code snippet, the "store" variable is empty. nothing gets stored there.