How should I work with the print extension?

Hi everyone!

I am using the Screenshot component from utilities, as well as @Ben’s printing extension.

What I want is,

  • when a buton is clicked, a qr code should generate.
  • After the QR is generated, set a image’s pic to the QR Code. Also fire a timer for 1500ms. (1.5 sec)
  • When timer ends, capture a screenshot & print it.

What does not work is, the image is not printing (the print function is not launching); Also, in the if block under the gotScreenshot event is not functioning in my case… What I mean is, if my system doesn’t support with printing, then it should show the verticalArrangement, right? It’s not showing too…

This is what I’ve tried -

What am I doing wrong?
Hope I am clear to you :slight_smile:

Thanks a lot! :blush:

are you trying it in companion or apk?

1 Like

Hi, @ImranTariq! :wave:
Thanks a lot for replying! :blush:

I tested in both Companion, & APK.

Thanks! :blush:

1 Like

i was trying to check this extension but i think thunkable community server is down and not opening page of that extension, and i am not sure if this extension is working perfectly or not, have you tried with another phone? like maybe printing function supported phone. share apk or aia so we can see for us its working or not?

1 Like

Hi again, @ImranTariq! :wave:
Thanks a lot for replying! :blush:

For me, it’s opening -

Not yet, but I’ll try & report here soon :+1:
Currently I am testing on Galaxy A50 (Android 9.0)


Thanks! :blush:

1 Like

its not checking that device is supported or not, problem is in extension

Image Print extension only handles settings and configuration before printing and passes that to the printing app such as Google Cloud Print or Samsung Print Service. If none of these apps exist on your phone, it won’t work. Moreover, the SystemSupportsPrint only checks whether your phone is capable of printing and handling such kind of requests, not whether it has a printing application.

but its not checking that phone is capable or not, like check block, not working for that if else and direct passing to next process where it dosnt found any apps for print,

It checks if physically it’s capable of printing if it had the printing application installed.

if not, then it must response something, lets see if any other phone shows any response if not capable of print, like we have tried of android 9.0 , both phone was android 9.0 , not responding anything if capable or not.

1 Like

The extension is a wrapper for Android’s PrintHelper class. SystemSupportsPrint method is not my implementation, if you have problems with it, please consider contacting Android development team.

1 Like

Hi,

So, is it possible to print a screenshot?

Thanks! :slight_smile:

Hi, @Ben :wave:

If you could provide a way to print a screenshot, It would help me a lot :blush:
An AIA would be of very much help…

Thank you so much! :blush:

Just combine my ImagePrint and @Taifun’s Screenshot extension.

2 Likes

Thanks for your reply! :blush:

I’ll try this soon :+1:

Thanks! :blush:

Hi @Ben! :wave:

Edit - blocks updated in the below post.

This post

Still not printing -

Am I doing something wrong?


Thanks! :blush:

Hi @Ben! :wave:
There’s an update -

Your idea works perfect :+1:


These blocks now work perfectly. Printing is also working :+1:

But, @Taifun’s extension returns a compressed/blur image -


Is there any workaround for this?
Thanks! :blush:

3 Likes

what happens if you use the example project downloadable from here?
https://puravidaapps.com/screenshot.php
Taifun

2 Likes

Hi, @Taifun! :wave:
Thanks for your reply :blush:

I cannot find any sample .aia in the webpage :confused:
But, I read your source code, and found these lines -

image

It contains “compress”. Is it the thing which is compressing?
I have no knowledge of JAVA; I can’t say anything :confounded:

Thanks! :blush:

it uses quality = 100…
my guess is, because the format is JPEG… I might offer PNG as additional format one day…

however in Kodular you do not need an extension to take a screenshot…
what about trying the Screenshot component form the Utilities menu?

Taifun

1 Like