on 10-31-2017 3:24 AM
Hi,
Thanks in Advance,
I am using SAPUI5 PDFViewer in my application. When I set the source property to the pdf file path, it is working fine. But when I set the base64 pdf value to the source property, the pdf is not visible.
Kindly provide any solution, or is there any way to extend the sapui5 control to adapt to the base64 pdf value as source.
Hi Ajit Kumar B.
Did you find or get a solution for this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Define your PDFViewer like this :
<PDFViewer source="data:application/pdf;base64,{/Source}" title="{/Title}" height="{/Height}">
<layoutData>
<FlexItemData growFactor="1" />
</layoutData>
</PDFViewer>
Whenever you use base64 encoded data, you have to mention the data parameter while rendering the data in the browser.
Hope this helps,
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajit,
Use it as following it'll work.
<iframe src="data:application/pdf;base64, yourBase64ContentGoesHere" />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i have tried but it showing garbage values.Can you please give me entire flow like XML View and Controller code.
i am using view code:
<core:HTML id="idFrame"/>
controller code:
var zid = '00001 Definitions';
var sRead = "/DisplayPDFSet(FILENAME='" + zid + "')/$value";
oModel.read(sRead, {
success: function (oData, oResponse) {
var pdfURL = oResponse.body; //if you use Oresponse.responseuri; not getting any output
pdfURL = "data:application/pdf;base64," + pdfURL;
var html = that.getView().byId("idFrame");
html.setContent('<iframe src="' + pdfURL +'" width="100%" height="100%"></iframe>');
Could you please help me it is very urgent issue for me.
Thanks advance.
am using gateway side like below:
DATA base64 TYPE string.
CALL FUNCTION 'SCMS_BASE64_ENCODE_STR'
EXPORTING
input = li_zhr_policy_line-content //XSTRING Format content
IMPORTING
output = base64.
ls_stream-value = base64.
ls_stream-mime_type = 'application/pdf'.
copy_data_to_ref( EXPORTING is_data = ls_stream
CHANGING cr_data = er_stream ).
please check and let me know where i did wrong and give me example for working fine code.
Thanks advance.
Regards,
Laxmi
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.