save file into app
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 4
- Joined: Wed Apr 11, 2012 5:27 pm
save file into app
good day
I'm making car instruction step by step how to
ex how to change oil and oil filter
i already make pdf files with instruction
but i need to press button and it show the instruction
i already know to make path and open pdf but if i send the application to other the pdf will be on my laptop and it will not work with them
what can i do ?
ps. my app
1st stack car company ex( bmw , vw , Toyota ...
then it go to car model
then car year
then 6 button show ex( oil and oil filter change
I'm making car instruction step by step how to
ex how to change oil and oil filter
i already make pdf files with instruction
but i need to press button and it show the instruction
i already know to make path and open pdf but if i send the application to other the pdf will be on my laptop and it will not work with them
what can i do ?
ps. my app
1st stack car company ex( bmw , vw , Toyota ...
then it go to car model
then car year
then 6 button show ex( oil and oil filter change
-
- Posts: 4
- Joined: Wed Apr 11, 2012 5:27 pm
Re: save file into app
it prefer be in app as internet access not always have
Re: save file into app
You can store the PDF files in the app as custom properties. Do you know how to do that?
Another way is to put the files in the Copy Files pane of the standalone settings. Then they will be included in the app installation.
Another way is to put the files in the Copy Files pane of the standalone settings. Then they will be included in the app installation.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 4
- Joined: Wed Apr 11, 2012 5:27 pm
Re: save file into app
thank you so much ill try it
-
- Posts: 4
- Joined: Wed Apr 11, 2012 5:27 pm
Re: save file into app
hi i try to find tutorials for what u said but didnt find
can u refer tutorials for "You can store the PDF files in the app as custom properties. Do you know how to do that?"
i already upload pdf in standalone but dont know to to refear button to open it
Re: save file into app
It is possible to store pretty much any information in a custom property. A pdf is a binary file so you would need to use the "binfile" syntax in a "url" command to get the original file.
To display it afterwards would need you to do the reverse operation and take the data in the custom property and then write it into a file on the user's device that can be read by whatever application is used for the display. (There are complications in cross-device methods, and "generally speaking" there are security reasons why displaying a local file in a browser is prevented. You can search for info on this forum.)
To write it out you need to use a writeable location and also a place that is readable by the display app, with the complications noted above.
If you are the author of the datasheets, it might be much more convenient to save them as rtf documents instead of pdf.
Then you can import them in the same way as indicated above. But instead of having to write out the file for display, with those complications, you can just display the rtfText in a field within the LiveCode app.
To display it afterwards would need you to do the reverse operation and take the data in the custom property and then write it into a file on the user's device that can be read by whatever application is used for the display. (There are complications in cross-device methods, and "generally speaking" there are security reasons why displaying a local file in a browser is prevented. You can search for info on this forum.)
Code: Select all
--you need to know the full path and filename
--for the purpose of this illustration it is assumed to be stored in a variable "tFile"
put url ("binfile://" & tFile) into tDatasheet
set the cDatasheet of this card to tDatasheet
--this allows for one datasheet per card, but you can adjust the naming and storage convention to your design, however you wish
Code: Select all
--you need to know the destination file path and name,
--assumed here to be stored in a variable, such as
put specialFolderPath("documents") & "/xyz.pdf" into tDatafile
put the cDatasheet of this card into url ("binfile://" & tDatafile)
launch document tDatafile --results may vary
Then you can import them in the same way as indicated above. But instead of having to write out the file for display, with those complications, you can just display the rtfText in a field within the LiveCode app.
Code: Select all
set the rtfText of field "DatasheetView" to the cDatasheet of this card
Re: save file into app
If you already incude the PDF files in standalone settings they will be stored in specialFolderPath("resources") in the app. The file name will be specialFolderPath("resources") & "/myFile.pdf". If you want to get the file content instead of just the path, use this:mah_qethyBUShPJV wrote: ↑Sat Aug 06, 2022 9:45 ami already upload pdf in standalone but dont know to to refear button to open it
Code: Select all
put url ("binfile:" & specialFolderPath("resources") & "/myFile.pdf") into tPDF
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com