How to create PDF file and dowload in react js - reactjs

I am working on react ja project which is contains pdf file download. I have list view which is contains some get service data from the api, exactly on the list view I have download button. If I click on the download button the list view should download as pdf file.
I have no idea how to that, so how to generate pdf file in react js?

There are two older answers for this in stackoverfow.
First one is this.
How to make PDF from React?
Second one is how to use jsPDF properly. And there is a working jsfiddle example allso. Refer them.
How to properly use jsPDF library

Related

Upload media/images on aws3 using tinymce editor in React js

I'm trying to implement TinyMCE rich text editor in react, all the setup is done. I don't know how can I upload media/images on AWS-3 using TinyMCE in react. If anybody has done it before please share
By default, TinyMCE does not upload images on the server. It converts them into base64 and adds them as blobs. To upload these images to the server, you will need to set up automatic_uploads and add a custom upload handler (check other options in the configuration reference, like images_upload_url, images_upload_base_path, images_upload_credentials, etc).
Since automatic_uploads isn't one of the default options for React, you will need to set up the additional editor options via init.

URL link preview issue in react JS

We are having one problem while generating a link preview for our react application URL's. Actually we have the requirement to display the dynamic link preview for different URLs.
We are able to add the link preview by using open graph tags in our index.html file placed under the public folder.
But once we tried to add dynamic metadata using the "react-meta" or "helmet" package. it is successfully changing the title of the application. but links preview are not working after making these changes.
so I kindly let me know if there is any way that we can different link preview for different urls for react application. Thanks in advance.

How I do paginate with Pdfmake and html2canvas?

I created a html table using angularjs. I am able to download the document as pdf using pdfmake and html2canvas based on this question:
Generate PDF from HTML using pdfMake in Angularjs
The document layout is nice and everything works fine until it comes to documents that goes beyond a single page. In that case the pdfmake generates a blank (2 pages) pdf document.
How can I handle the generation of a multipage document with pdfmake and html2canvas?
I found the root cause of the problem. When the image generated by html2canvas is larger than one page it seems that pdfmaker is unable to handle the page split. So you have to managed output context by yourself.

React File Preview (FIREBASE)

I currently have files stored in Firebase Storage. I want to be able to generate a file preview for each file in real time (mapping).
For example, a PDF files will show the first page as an image, a .docx will be the first page of the document, a pptx will be the first slide, an unknown document will be a default document symbol.
Anyone know any good services for easy integration into React ES6?

Creating the view as PDF in sencha touch

My requirement is after user taps createPDF button,to generate current view as PDF. Using
console.log(this.getMain().getActiveItem().renderElement.dom.innerHTML);
i can able to get entire HTML element. Now i stuck to generate my view as PDF. Any suggestion
You should google pdf viewer.
For example, if you wanted to view the PDF at the URL http://research.google.com/archive/bigtable-osdi06.pdf ,
you would use the URL: http://docs.google.com/viewer?url=http%3A%2F%2Fresearch.google.com%2Farchive%2Fbigtable-osdi06.pdf
then use HTML object tag and pass the url to "data" attribute. Attached this as html in your view.
Thanks
You have two options if you are working in a browser, (if you are working in mobile devices you should working with inAppBrowser cordova plugin)
1º With the mozilla-pdf library: http://mozilla.github.io/pdf.js/
2º With the pdfObject library: http://pdfobject.com/instructions.php
Both libraries are very complete to work with the browser but the mobile devices are other mistake...

Resources