Downloading pdf that has been fetched from API - flutter-dependencies

I have a function that returns a file of type pdf from API. How can I give a user an option of downloading it?

Related

Export document to pdf file with sepatated pages

I am using RESTful API /documents/id to retrieve pdf file as described here. But I get the single-page pdf file even if the document is very large, one big page. However if I try to export pdf by business intelligence designer I will get the pdf in multi-page format. How can I export the document in multi-page format by RESTful API? In the documentation I do not see appropriate parameter, just dpi for pdf...
I found an answer. There is a separate API for this - /raylight/v1/documents/27592/pages, p. 8.1.13.2 of User Guide.

Can I use Autodesk viewing API to render local DWG (2D) files to my browser?

The main goal of my project is to read Autocad(DWG) drawings from my local server to output them in a web browser (Chrome).
I managed to do it with the View and Data API in JAVA from Autocad with buckets, Key, etc. but when it comes to read offline files with this sample code from https://github.com/Developer-Autodesk/view-and-data-offline-sample, the DWG format did not work.
Do you have suggestion or have a clue to use the offline API with DWG files?
The Autodesk View & Data API (developer.autodesk.com) allows you to display a DWG on your website using a zero-client (WebGL) viewer. You need to upload the DWG to the Autodesk server, translate it, and either then download the translation to store on your local server (as demonstrated on extract.autodesk.io) or keep it on the Autodesk server. You might consider downloading it to be advantageous because then you don't need to implement the OAuth code on your server.
Buckets on the Autodesk server can only be accessed using the accesstoken created from your API keys, so it is secure in that only someone with your accesstoken and who knows the URN can access your translated file. However, for the viewer on your client-page to access the file, you need to provide it with your accesstoken. This does mean that someone could separately access your translated file by grabbing the accesstoken and URN from your webpage. But if you're serving up the model on a public page, then you presumably don't care about that.
There is a 'list' API available, but this is white-listed (available on request), so getting your accesstoken and urn for one file doesn't automatically give access to your other files - unless someone can guess the other filenames (or iterate to find them).
If you use a non-permanent bucket, then your original (untranslated file) becomes unavailable when the bucket expires, or you can explicitly delete the untranslated file (using the delete API).
Files translated via the View & Data API are not accessible via A360. They are stored in a separate area. (But I wouldn't be at all surprised if an A360 file access API became available in the near future :-).
Finally, unless you want to interact with the displayed file via the viewer's JavaScript API, you may prefer just to upload your files to A360, share the translated model, and then iframe embed them in your webpage.

SAP BI Open Doc URL for retrieving pdf

In a reporting application we use, we were using BI 3.x API to produce Web reports. While doing the migration activity to 4.x version, we thought it is fine to go with open doc url rather than doing the report generation through API.
Many of the samples I have seen uses sIDType and iDocID parameters along with Token value to retrieve the document by constructing a URL like below http://server:port/BOE/OpenDocument/opendoc/openDocument.jsp?token=[LogonToken]&iDocID=[XXXX]&sIDType=CUID
But all those URLs get HTML page as response from BI 4.x SAP webservice, the java script in that HTML page does the task of retrieving the pdf file.
I am just wondering if there is any way I could retrieve the pdf report as response from the BI Webservice directly ? Please assist me on this. Thanks
You can if you use the REST SDK to retrieve the document, refresh it and then export it to PDF.
In short, these are the steps:
Logon: POST /biprws/logon/long
Get the doc's prompts (if any) GET /biprws/raylight/v1/documents/5690743/parameters
Pass the correct values for the prompts (if any) and refresh the document: PUT /biprws/raylight/v1/documents/5690743/parameters
Export as PDF GET /biprws/raylight/v1/documents/5690743
That last step requires you to pass Accept: application/pdf in your HTTP headers to get the PDF version.
Detailed information on the REST SDK and the different steps listed above is available on help.sap.com (look for the manual SAP BusinessObjects RESTful Web Service SDK User Guide for Web Intelligence and the BI Semantic Layer).
Use sOutputFormat=P to always retrieve the PDF of the report using open doc

Upload large file on server is this possible by create firefox addon

I want to upload large video file. for that i want to create firefox addon. Is this possible by create firefox addons to upload large files on my server.
or is there any other way to upload large files on server.
please suggest.
If you are POSTing the data to the server as application/x-www-form-urlencoded then you should base64 encode it using btoa() and include it as one of the POST parameters in the request body (i.e. the string passed to XMLHttpRequest.send()):
postbody = "body=" + btoa(fileContents);
xhr.send(postbody);
If you are just downloading the file and uploading it right away, you might as well keep it in memory since you're presumably going to load it into memory anyway in order to base64 encode the contents.
Well if you're reading the file into memory then you should need an nsIFile at all. You can just download it using XMLHttpRequest and use responseText, uploading it in the way I described in the answer. If you do have an nsIFile then yes, that snippet describes how to read from it.
I assume you are wanting to upload via HTTP.
If so, the upload limit is usually decided by the server-side software. This affects both the maximum size and the length of time you have to upload it.
Without a server capable of taking an upload in chunks and reassembling it, you are limited in ways you can't get around through software.
If you want to upload via FTP on the other hand, there are a lot of options... look at FireFTP.
I have made firefox addons for fileupload.
I integrate jquery file upload.
I create widget. In the widget I made panel. In panel I create separate web page for file uploading. And panel is calling that page.
For more information you can mail me at chetansinghal1988#gmail.com

How do you upload a video to youtube using json-c format?

I'm able to upload videos to youtube using their xml input/output format but their documentation on how to implement uploading with json-c is frustratingly sparse. For instance, what is the 'key' for the json data I'm sticking in the body? Or put a different way, how is the json string added to the body of the request?
Here are instructions for uploading a video using JSON-C:
https://developers.google.com/youtube/2.0/developers_guide_jsonc#Add_Video
The upload is done in two parts: 1) First you upload the metadata in JSON format. The response of this will contain an upload url. 2) Upload the actual video to the upload url.
However #Alexander is right, the Objective-C client may be a better route, since it handles all the upload details for you:
http://code.google.com/p/gdata-objectivec-client/