To Open document in a new window based on selected book

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.

Is there any way to do so?

Thank You!

Hi@Dharma_Pati

Let me know the below two points so it would be better to provide a solution.

  1. Are these PDF files stored as binary files in the system?

  2. 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.

  1. 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.

  2. pyFileSource property value will contain the base64 stream of the pdf document.

  3. Once you have extracted the base64 data, then create a section to show the PDF file.

  4. In the section, go to HTML tab and uncheck Auto-generated HTML checkbox.

  5. Now you will get a HTML code editor on the section.

  6. In this HTML code editor, paste the below code.

  1. In the above code snippet replace YOURBASE64DATA with the base64 data that you have extracted in point 3.

  2. 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.

  1. For this design you first have to use open URL in window event on click action.

  2. Next you can use pyDownloadBinaryFile activity to download the binary file.

  3. Make sure you pass all the necessary parameters to this activity in order to process it.

  4. 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.

Let me know if you have any further queries.

@Dharma_Pati

I hope this helps!

Hi, @SoumyajitB Thanks for replying.

->I haven’t created binary files for the pdf’s and i am not sure how to store pdf’s as a binary file.

->And i want that pdf to view and also for downloading, as you guide me how to download the file also.

It’s more helpful to me, if you guide me how to store pdf as binary file.

Thank You!

Hi @RameshSangili thanks for replying.

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.

Thank You!

Hi@Dharma_Pati

In order to create a binary file of type PDF, follow the below steps.

  1. Go to create menu on the header bar and navigate to Technical and then to click on Binary file.

  2. Fill in the label field with the desired name.

  3. Provide the app name (directory) for example webwb.

  4. Provide the extension type as pdf.

  5. Click create and open.

  6. Click on upload file and choose the PDF file you want to upload.

  7. Save the rule type and your binary file instance is ready.

@Dharma_Pati Did you find a resolution for this issue? I have the same business requirement. Kindly let me know if this is feasible to develop OOTB?