PDF file reader

I have a requirement.

First, I will upload a PDF file, after uploading the file, the content within that file should be displayed in one section. How can i achieve this?

Hi@Rakesh Chilukuri please use the following code in your non auto generated section.

You will find YOURBASE64DATA in Data-WorkAttach-File instance in pyAttachStream property.

<object data="data:application/pdf;base64,YOURBASE64DATA" type="application/pdf"></object>

@SoumyajitB Can you please elaborate more

@Rakesh Chilukuri Sure I can, please follow the below steps:

  1. After you upload a PDF file you will find base64 data in Data-WorkAttach-File class instance.

  2. pyAttachStream is the property in Data-WorkAttach-File where you will find the base64 encoded data corresponding to the PDF file you have uploaded.

  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.

Let me know if you face any issues further.