The Unifinity application can call up and display PDFs. This article explains how to display PDF files obtained via the Internet and PDFs registered as resources.
Please take a look at the following cases that we can help you with.
- I want to view PDF files downloaded from the Internet.
- I want to display a PDF file defined in a resource.
The sample projects used in the explanation can be downloaded from the following links. We hope you will take advantage of it.
2. Operation image
3. Implementation method (explanation of key points only)
3-1. Screen Creation
Create a new screen as follows and place the buttons in it.
3-2. Creating download logic
Create the logic to be used for downloading and register the logic in the download button.
The logic used for the download is as follows
#1 Logic to download files from the network.
HTTP communication is performed to the URI of the PDF file to download the file.
The downloaded file will be saved in the application area as "download.pdf".
#2 View PDF file. The "download.pdf" obtained in #1 above is specified as the file name.
3-3. Creating Resource Call Logic
Create logic to call the resource PDF and set it to a button. This requires that the PDF be registered with the resource in advance.
Resource PDFs are registered by setting "keywords" from "Properties" > "Resources". keyword is used when calling a resource.
The logic used for resource loading is as follows
#1 Call PDF from a resource. Specify the keyword you have just set for the "Resource KEY" parameter.
This completes the setup for displaying PDFs.
Run the application from the "Run" button on the menu icon to see if it works correctly.
Press each button and if the PDF file appears on the screen, you have succeeded.