Quantcast
Viewing all articles
Browse latest Browse all 8068

Capture and Save an image into the pdf

Hi everyone... in my project i have to capture a signature and save it into datadirectory it supports only .png format. i tried to add file to pdf but pdf supports only jpeg.I have converted the image from png to jpeg and couldn't save that image into the pdf file where it says null value . i m confused ..

my code for converting is

var imgSample2 = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'my_library/sign/w4.png');

     var sample1 = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory , 'Image.jpg');
     if(!sample1.exists){
               sample1.createFile();

           }

     sample1.write(imgSample2.imageAsResized(40, 20),false);
     Note: i have also tried by removing  imageAsResized()

thanks for your answers in advance if any samples mailto : vijaykumar243@gmail.com


Viewing all articles
Browse latest Browse all 8068

Trending Articles