Render React page to html string for print service - html

This is a design question instead of a code question. I have a SPA written with React JS and a microservice that takes any html string and print to PDF.
I need to implement a feature that allow the user to click a print button on a page, certain form (majority of current screen) will be printed in PDF format.
My question is how to let React application render to html string so that print service can consume. Server-side rendering? any other approaches? Please advise. Thanks.

Related

Parsing HTML with TFHpple on iOS

I am working on an iOS project and my goal is to create a "pretty" app version of a specific website. To do this, I'm parsing all the data from said website with TFHpple for use in my app.
This website has a store, so my goal was to read the webpage with the products, then display them all in a table view and what not. However, the website doesn't display all the products on the specific page at once.
It splits up the products across 3 pages inside the one website page so you have to click the "next page" button on the website, and that runs some javascript code and adds the "?foo" part to make the URL in the browser be "http://www.domain.com/page?foo". I read up that this "?foo" is a query string, however I don't know how I would trigger this in my Objective-C code from the base "http://www.domain.com/page" page.
So simply, I can't grab all the items I would like to with TFHpple because some are not in the HTML until the correct query string is used.
I'm not really sure if I am explaining my predicament very clearly, but if anyone has any info that I could use I would appreciate it immensely!
I am working on a similar project. I think your problem has nothing to do with TFHpple. TFHpple only handles HTML parsing rather than data downloading from server. My approach is like this:
NSInteger currentPageIndex=1;
NSString *dataUrlString=[NSString stringWithFormat:#"http://www.domain.com/page?index=%d",currentPageIndex];
Detecting tableView's scrolling event, if it reaches the end of the tableView, then load next page data from server;
Parse the new page's HTML data from server, append data to tableView's datasource and reload the tableView.

How to use an html form to gather information to create a link

I would like to have a html form that will have the user input values, i.e. module ID for a DEMO, desired dimensions of the mask and which environment the demo should be loaded. Then from hitting submit a new page would pop up with the desired information filling in the rest of the link.
I hope this makes sense, if not I can try to explain more.
Try writing a dynamic web page where the link in the HTML is constructed on the server-side based on the information provided in your form on the previous page. Some popular dynamic web page languages are JSP, ASP, and PHP. Note that dynamic web pages have to be hosted on a web server.

How to buffer results from a webpage to another?

I am using flask for my website.
I want to submit data using a form from my website to another website and then format the results page (an html page) before displaying it on the browser on my website.
After the form is submitted, the browser is directed to results page of that (another) website. Can I redirect again it to my site?
How to process the results page(call its html content as a string in code) ?
Sounds the process like this: user input the data -> your website get the data and post it to another website -> the website return a worked data -> your website receive this data, parse it and display it. I don't know you are familiar with API or not. If you are familiar with it you should know the process is just like using API. You just need to put all the process in a view and add_url_rule for it.

Can I start a webview out of view, scrape the html, and post forms through it?

I'm attempting to develop an application that scapes html of a site for relevant data and then display it back to the user in a more UI friendly way. I'm assuming that you can start a webView by
mWebView = (WebView) findViewById(R.id.webview);
but never setting the content to the actual view. So now my question is, can I take the html from the webview, scrape it, then somehow have the webview post back the forms, all while staying in the background? Any help is appreciated.
Or does anyone know of source such as htmlunit that will compile within android?
I have found out how to extract the HTML from the WebView using JavaScript thanks the guide on this site http://lexandera.com/category/webview_examples/ but I am still searching on how to return post forms to webView. Perhaps through javascript aswell?

Is there an application that generates an HTML form from a PDF?

Is there an application out there that Generates an HTML form from a PDF file? Also, it would need to generate the HTML form so that it would be able to submit to the PDF to fill out the fields inside the PDF.
PDF is not so good at validation and it's just a kluge interface to begin with.
Not sure of your full requirements but docudesk does this conversion as well as a number of others.
Adobe also have an online conversion tool that does this.