Hi all community members, I have a requirement that, when i click on “Read” button, then based on book which is selected need to open in a new window in a pdf format of that particular book only.
As i have included this in a data class section and on that button i have created an action set->Click->Open Url in Window and added this section in work class using Repeated dynamic layout.
Now, when i click on any read button from the available books i can see all the books available in the above URL.
Attachments might help for more clear understanding.
Let me know the below two points so it would be better to provide a solution.
Are these PDF files stored as binary files in the system?
Do you want to download the PDF files on click of read button or do you want to open the and show the pdf files on the screen.
Assuming that PDF files are stored as binary files in the system and you want to open the pdf files on the screen I am suggesting the below design.
In order to download the PDF files and show it on the screen first you need to write an activity using obj-open-by-handle to extract pyFileSource property value.
pyFileSource property value will contain the base64 stream of the pdf document.
Once you have extracted the base64 data, then create a section to show the PDF file.
In the section, go to HTML tab and uncheck Auto-generated HTML checkbox.
Now you will get a HTML code editor on the section.
In this HTML code editor, paste the below code.
In the above code snippet replace YOURBASE64DATA with the base64 data that you have extracted in point 3.
Execute the section and on runtime it should display the uploaded PDF file.
Now assuming that you want to download the PDF files on click of read button and the PDF file is stored as a binary file in your system.
For this design you first have to use open URL in window event on click action.
Next you can use pyDownloadBinaryFile activity to download the binary file.
Make sure you pass all the necessary parameters to this activity in order to process it.
Lastly provide the window name value as _self in order to download the file while staying on the current window.
I have attached a screenshot of the configuration, please have a look.
Hope the solutions offered above might help you to achieve desired output.
I came through the reference, and it helped me to open a single document and the procedure to download it, and my requirement to open each document as an individual document whenever we select the button “Read” on the selected book.