Upload PDF from MIT web viewer by link into web page

Good...

I have create another page called Show_PDF

On this page i have put :

And one
blocks(2)

I thinking that if i closed my page Show_PDF, the page below called Occasions_GPS will be on same state..., on the link of PDF but not.
On this ASP page i show 4 items with possible pdf or not.
This ASP page can have a lot of page with 4 items presented.
When i close PDF page, i return at begining of my ASP page and not on link to upload my PDF...
Do you know if i keep ASP position to be on same machine when i close my PDF page ?

I have find one error

Runtime Error

java.lang.OutOfMemoryError: Failed to allocate a 140486008 byte allocation with 25165824 free bytes and 107MB until OOM, target footprint 180679536, growth limit 268435456
Note: You will not see another error reported for 5 seconds.

For PDF of 4505 ko

I continue to test her...

You have created an infinite loop somewhere, this will cause a crash of your app.

Are you testing with companion app ?

What android version device are you testing with ?

I have now had a chance to test, with companion app on Android 12, these blocks work OK, and display the (small - 341kB) pdf. You will see I test for a .pdf extension so that the viewpdf extension is not demanded if other file types are downloaded.

With a compiled app you may need to request a permission...

(Alternatives, if that doesn't work, is to either copy the file to your ASD, or setup the webviewer with webviewextra to save the files to the ASD, so that you can read the files from there)

Dear TIMAI2

I never upload file on my phone and i read from my phone.

It's working on Samsung S24 ultra.
Just now, my problem is that when i close the page Show_PDF created especialy for the pdf get by my asp link, i come back on original page but she is rebooted at begining.

I have ASP listing of 4 machines by pages.
I have 20 pages.
On page number 10 i select one machine who has pdf.
I upload him.
Page of upload is open and pdf is display.
I close this page...
I come back on page one of my listing and not on page 10 where the upload link is present...
Thus my customer has seen the pdf but he has lost the machine... :face_exhaling:

It looks like you are talking about your screen Show_PDF... Please use the correct term Screen to not confuse everyone

You should look into how to switch screens... which method do you use? From a previous screenshot I assume, you are using a variation of Tribblehunter's method, so at any time there is only 1 screen open?

You could store the screenname of the screen you later like to come back to in TinyDB and open that screen then?

Taifun

Are you saying, you have 20 screens?
What about reusing screens? DRY - Don't repeat yourself... see also tip 1 here

Taifun

He probably means 20 pages in the PDF doc.

1 Like

Meanwhile I think, he is talking about webpages... :thinking:
Taifun

1 Like

Yes web pages lol.
In reality i have around web 63 pages.
228 divide by 4 machines shown by web pages.

Thus my address has querystring like https://www.mysite.com/informations.asp?select=all&offset=16#vue

I should register this address at the moment where i clic to upload my pdf.
When i go away of my pdf page, i should return on same address.

I can register her into variable, send this address by startvalue and come back with her...

To have the address of web browser at opening pdf it's webViewExtra1 GetUserAgentString ?

No... Apparently i can have two variables into start value...

I should recover web address just before to clic on pdf link.
This address should be register into tinydb and when i go away of my pdf page (Show_PDF) i should go back on page Occasions_GPS and display the address into Afficheur_Web1.

How to have this address who has querystrings to be able to come back on same page ?

Try the manager screen method, see link above
Taifun

Good Morning Taifun
My problem is not to close screens but to retrieve the URL address of the web page displayed in Afficheur_web1 before clicking on the link to display the PDF. Once recovered I can store it in tinyDB to reuse it to return to the correct address by closing my page where my PDFs are displayed

A few relevant screenshots might help...

How do you open screen Show_PDF?
Would it probabky be possible to stay on the screen to show the pdf? Look into using a virtual screen, see tip 1 General Tips and Tricks for App Inventor

The url address you are looking for, is it the same information whjch is passed to screen Show_PDF, or is it something else?

Provide an example of those...

Taifun

It's working now...

I'm going to try to explain better but... I'm French and it's complicate...

1st
On my app i have a page called Occasions_GPS where i display on "Afficheur_web" one ASP page who take into MS ACCESS database some informations.
This page is heavy and i display just 4 items by page with possibility on asp page to move on pages upto number 64...
She is all the time display into web viewer of APP inventor.
I call her one time and after i move into the asp page. Thus asp page is all time time the same but some querystring move to inform of page number with others querystring informations.

2nd
The code of my Occasions_GPS page is :

3rd
Sample of screen phone copy :

If i'm connected, some buttons appear into this asp page to provide links to see movie and sometimes pdf of the machine presented.
Like


On picture above you see pdf logo.
If customer clic on, now, its open "Show_PDF" page like :

And Pdf appear

Before, when I closed "Show_PDF" page, I was coming back on my "Occasion_GPS" page but at begining of my ASP page...

Now, with this programmation, when i close PDF, i come back on good page when PDF link is present and where the machine is present too...

Thus perfect !!!

Just... I should clic several times on my button "Fermer" (close screen) to close the pdf ?!

You are using a mixture of different methods to switch screens... in this case you are opening Show_PDF and in that screen instead of closing the current screen you open again screen Occassion_GPS, which keeps screen Show_PDF open. After a while you then have several screens Show_PDF open at the same time

Switch screens correctly! But in your case let me suggest to use virtual screens and show the pdf directly in scren Ocassion_GPS

Taifun

If i well understand well, you say me to remove my page "Show_PDF" to open the pdf into virtual screen directly into my page "Occasions_GPS" ?!
How you close this virtual page to shut down the PDF ?
They are one button to do it on virtual page ?

Herewith a simple example of using a virtual screen to display the PDF

getPDFThenShow.aia (44.6 KB)

Insert your own web page url

Just ise 2 vertical arrangements
1 is your Ocassions_GPS screen, 2 is to Show the Pdf... you can have buttons in both arrangements

Taifun

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.