2024 Aug 26 1:51 PM - edited 2024 Sep 05 10:11 AM
Dear MDK experts,
In my iOS app build using SAP MDK. I am trying to get a PDF by calling the URL received in previous step from Adobe. When application runs on web using fetch command, it works fine and I am able to get the PDF file as the response is processed by the browser correctly. However, on iOS using sendRequest the response received is not straight forward or may be I am unable to process it correctly.
Could you please help me with the correct way of handling the PDF response in this case. I have tried multiple ways but it just does not work.
Details: the response received is in the following format:
data = {length = 171568, bytes = 0x25504446 2d312e37 0d25e2e3 cfd30d0a ... 0a252545 4f460d0a };
headers = {
"Accept-Ranges" = bytes;
"Content-Length" = 171568;
"Content-Type" = "application/pdf";
Date = "Tue, 16 Jul 2024 11:08:10 GMT";
Etag = "\\"9c3125582e1dc11f94f9304ffa12b7dd\\"";
"Last-Modified" = "Tue, 16 Jul 2024 11:07:57 GMT";
Server = AmazonS3;
"Strict-Transport-Security" = "max-age=31536000; includeSubDomains; preload;";
Via = "1.1 fde85e7daa13f95cf6b8f5fa09c62ef6.cloudfront.net (CloudFront)";
"x-amz-cf-id" = "M0ObxiQjt3eRsE1uuDlEGzlToEH_GNozAKOeFp8LIGhkjDD4KxdIsw==";
"x-amz-cf-pop" = "FRA56-P7";
"x-amz-expiration" = "expiry-date=\\"Thu, 18 Jul 2024 00:00:00 GMT\\", rule-id=\\"YTNmNmJlMTktM2U4YS00NDhhLTkyNzEtNjk1NTc3NGZlMDBj\\"";
"x-amz-id-2" = "OAvPSYiXsOkwEiKzADCWqN/AGIxCB/9tUEwqSsHNHSzr4/Az+9zDTb3ZeFqFPl5+TssIH7CyebK4DLc;
}
}`;
here bytes contain the pdf data.
On checking the Mobile Network Trace in Mobile Services on Visual Studio, I was able to see the pdf response in the preview section. So, its on the part where we to correctly process the PDF.
Here is the code:
Kindly let me know if you see anything wrong or help me find the right way to process pdf.
Note: I am able to open the PDF on click of button by providing the url in the path but I need the PDF response in Blob format to save it on sharepoint online.
Best Regards,
Geet Bijlani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lim,
Thanks for your reply. As my requirement is to get the PDF as BLOB, I would refer to your suggestion
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.