Probleme de qualité image dans

i already test it (with 5840 / 4800 the dimension of my image), so my image is bigger and what i write on si very little (but when i zoom is very good). But my image is always poor quality...

I dont know how i can solve this pobleme, maybe it s app inventor which scales my image and then it loose quality ... ?

thanls for your help,

Yes, that happens.

Can you share the image, then perhpas we can advise on the best solution? You say you have to write on the image, are you using a canvas to do this ?

1 Like

@Jean-Paul
With the example that I have put in the previous post, does it also print pixelated?

borrar_pdf_comprime_v2.aia (4.9 MB)

Bonjour,

Voici le fichier modifié avec une image (il faut que l'image soit dans un arrangement car je dois pouvoir écrire dessus pour compléter le pdf.
(n'importe laquelle convient, le problème n'est pas lié à l'image, je pense même que le problème ne vient pas de la création du pdf mais à la manière dont app inventor insère l'image dans un arrangement)
On peut modifier les dimensions de l'arrangement pour les mettre a la tailles de l'image 480/3509 format A4 mais cela ne change rien du tout
J'ai pris ce pdf : tableau_termin.pdf - Google Drive
que j'ai converti avec cela : Convertir PDF en JPEG – Extraire les images des PDF - gratuit

J'ai modifié dans screen1 sizing à fixed au lieu de response car l'image est ainsi meilleure même si ce n'est pas satisfaisant ...

Il suffit de comparer l'image d'origine en zoomant un peu avec le pdf créé en zoomant un peu pour voir la perte de qualité sur les écritures notamment.

Merci de votre aide.

I just took a screenshot of the pdf to make a png image, and used that in the test app.

The image quality is not great to start with, but I do not see much difference when converted to a pdf using the aia you provided.

Image (Screen1)

PDF view (Screen2)

But see that the actual text for the two labels at the bottom is much sharper and more distinct.

As suggested, you may have more success if you replicate the table in the app, instead of trying to extract a poor standard image from a pdf, then creating another pdf from that image.

Again, I am interested to know how you are writing on the image ?

Bonjour,

Il y a pourtant une grande différence entre la qualité de l'image d'origine et celle du pdf final en zoomant un peu. Je vous rappelle que le but est d'imprimer le pdf sur une page A4 (il me faut une qualité professionnelle). Je n'ai pas le temps pour le moment mais je ferai des copies d'écran.

Ma question est pourquoi et comment regler ce probleme.

Oui bien sur refaire entièrement le tableau serait une solution
Mais c'est tres difficile de refaire des cadres des lignes ... non ? En tout cas je ne sais pas faire.

Bien cordialement,

How about thinking outside the box.

Build a scrolling screen that allows the user to make text inputs for all the elements you require. Save all these user entries to a list.

In google sheets, create a template of your "pdf" to match.

Upload your list to google sheets, and use an apps script to complete the template, and then export the completed template as a pdf back to the app.

1 Like

Hello Jean-Paul

Creating the table from new really is the only professional solution. It is possible for example to define the table in HTML + CSS.

Part of the problem is increasing/stretching the image to A4.
An A4 page on my PC screen (96dpi) is 794 x 1123 pixels and the table image is 666 x 945 pixels - so making the table image fit A4 reduces the quality. Then of course, the image is too large for most phones. It has to be sized to "fit" the smallest phone likely to display it - your guess is as good as mine on that predicament, but a smaller size = more difficult to read (see screenshot below). The image could be displayed in a WebView Component, which would allow the User to scroll and scale, but how would you edit/add to the table?

On top of that, the original image is both poor in render quality and poorly arranged, with text touching borders and not being aligned.

Modified Image is sharper loaded in WebView:

borrar_pdf_webview.aia (5.0 MB)

.... would be better if the Table was reconstructed as an HTML Table.

Jean-Paul

There is a copyright notice at the foot of the table - I trust you have obtained permission to use/modify/distribute it from Michel Coéffé?

Thanks for your answer, it s not this image that i want to use but it was an exemple.
(There is tel mail name banque etc on the pdf i want to use)
Yes i need to add/edit the image after ...The idea is to complete a pdf.

So you suggest that i use css htlm to creat a table ?
Can i use variabe of appinventor in htlm css ?
What compunent i use to do that ?
When i have my table, what compunent i use to write on ?

Thanks for your help,

Yes you can. In the Html code, any field to be edited can be given an id. A small JavaScript Procedure in the HTML communicates with the App.

From the Help:

You can use the WebViewer.WebViewString property to communicate between your app and Javascript code running in the Webviewer page. In the app, you get and set WebViewString. In the WebViewer, you include Javascript that references the window.AppInventor object, using the methoods and setWebViewString(text).

For example, if the WebViewer opens to a page that contains the Javascript command
document.write("The answer is" + window.AppInventor.getWebViewString());
and if you set WebView.WebVewString to "hello", then the web page will show
The answer is hello.
And if the Web page contains Javascript that executes the command
**window.AppInventor.setWebViewString("hello from Javascript"),
then the value of the WebViewString property will be
hello from Javascript.

It is also possible to run a JavaScript via the JavaScript Block.

blocks

J'ai déjà une liste avec toutes les informations a écrire sur le pdf
Merci pour l'idee mais je ne vois pas du tout comment faire en sorte d'automatiser tout cela ...

J'ai une 50eme d'informations à écrire sur mon pdf je ne vois pas comment je vais faire.
D'autre part comment ensuite créer le pdf ? à priori il faut qu'il soit dans un arrangement ... mais je n'ai pas l'impression que la sortie de la page html est dans un arrangement si ?

There is more than one way to make a PDF and probably one of the most common is HTML --> PDF.

Another way