How can i convert a jpg file to pdf file?

Hi at all,
i developed an app with App Inventor2 where i used camera component. Is it possible to convert / to save the image in pdf file?

Many thanks.

See here:

2 Likes

Hi TIMAI2,
I saw the plugin but I can't use it because I don't see the image in the screen. I would need a plugin that passing the path of the jpg file saves it in the same path in pdf.
Is there a extension?

Perhaps you can try saving as 'pdf' instead of 'jpeg'

Why not try loading picture in image component?

1 Like

I tried this, but it isn't correct: the component "FILE" saves a file in pdf format, but it is not readable.

I can offer online conversion using imagemagick with php or google apps script, would that work for you?

It would mean sending the image to a server then returning the pdf.

1 Like

I have a screen with a "Image" component and other text: if i use the extension to Create PDF files, the image in the file is very small. I need to convert only image in a pdf file without inserting text.
The user don't view the file: i need the file pdf to send by email, in remote.

It is not very well: the app is used off line too.

and you will send the email how ?

It is possible with google apps script to send the image to google servers, convert it to a pdf and attach it to an email sent by your google account.

Really not sure why it has to be a pdf ?

1 Like

Sorry, i send the file by FTP, not email.
The remote server needs to pdf files for a batch procedure that I do not manage.

Hi,
i'm tring the extension but i have any problems. I'm working in Adroid 11 and your example p284C_extension_crear_pdf.aia returns an error too.
I suppose that the extension don't create the file pdf beacause the notification in the block KIO4_pdf1.AddedPage never appare.
I attacched the screen of the my code and the error: can you help me? Thanks


Errore

Yoy can no longer save in the root dir of the external storage.
See also here.

Save it in one of the Shared folders or in the ASD:

grafik

Hi,
i just tried it, but i have the same error. I saved in /mtn/sdcard/filename.pdf (screen 1) or in /storage/emulated/0/Android/Test_PDF/files/prova.pdf (my project has name Test_PDF: screen 2). I have the same error



Errore

As I said, save it in the ASD:

grafik

(or one of the shared folders).

I tried:
/mnt/sdcard/prova.pdf
/mnt/sdcard/Test_PDF/prova.pdf
/storage/emulated/0/Android/Test_PDF/files/prova.pdf
/storage/emulated/0/Android/Data/edu.mit.appinventor.aicompanion3/files/Test_PDF/prova.pdf
/storage/emulated/0/Android/Data/edu.mit.appinventor.aicompanion3/files/Test_PDF/files/prova.pdf
/storage/emulated/0/Android/Data/edu.mit.appinventor.aicompanion3/files/prova.pdf

I have the same error. I repeat that the norification in the event "KIO4_PDF1.AddeddPage not appeare.

data != Data

2 Likes

this is a correct path for the companion app...
EDIT: directories are case sensitive as @vknow360 said... so only almost correct... :laughing:
probably the subdirectories /Test_PDF/files do not exist?

what about just trying
/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/prova.pdf

or alternatively first create the subdirectories...

Taifun

1 Like

grafik

1 Like

I am trying all of them :frowning:
I tried /storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/prova.pdf but i have the same error.
What do i do?