Ionic Screenshot URI to pdf file

On Success Screenshot gives us a URI.

Is it possible to convert that Image URI into a pdf file and show that file to the user in mobile ?

I am looking into it from sometime but I am not able to find a solution till now.

@mhartington can you help on this issue ?

Any Answer?
I’am stuck on it…

Hi. You can use this plugin :cordova-pdf-generator

It’s converting HTML to PDF, there’s many tutorials/blog questions on the web about how to use it :slight_smile:

    captureSS(){
        this.screenShot.URI(80,).then(onSuccess => {
            console.log('success URI',onSuccess);
            let data = onSuccess.URI.split(',')[1];
            this.base64ToGallery.base64ToGallery(data,{prefix: '_img', mediaScanner: true}).then(res => {
                console.log('base 1');
                // this.httpClient.showLoading();
                // this.httpClient.showPrompt('Download Successfully.');
                this.screenShot.save('jpg', 80, 'lifecode').then(onSuccess => {
                    console.log('base 2');

                    console.log('success',onSuccess);
                    // this.httpClient.dismissLoading();
                    this.httpClient.showPrompt('QR Code Successfully Downloaded.');
                    this.navCtrl.navigateRoot('dashboard');
                }, onError => {
                    console.log('Failed',onError);
                    // this.httpClient.dismissLoading();
                    this.httpClient.showPrompt('Download Error. Try Again!1');
                    this.navCtrl.navigateRoot('dashboard');
                });
            }, err => {
                // this.httpClient.dismissLoading();
                this.httpClient.showPrompt('Download Error. Try Again!2');
                this.navCtrl.navigateRoot('dashboard');
            });
        }, onError => {
            // this.httpClient.dismissLoading();
            console.log('Failed URI',onError);
            this.httpClient.showPrompt('Download Error. Try Again!3');
            this.navCtrl.navigateRoot('dashboard');
        });

    }

this is not generating PDF but screenshot can save in your gallery with base64-to-gallery