Extract graph image using PhantomJs - phantomjs

I use jqplot to create a complex data graph for a clinical web application using IE7. Now, I need to create a PDF and the graph is part of the PDF.
Since it is IE7, I can't export jqplot graph as an image.
My plan is:
From the web app, user clicks on a button to send the graph data (JSON) to a web service on a remote server.
On the remote server, I will have a HTML page to be built dynamically by PhantomJS using the JSON data passed to the web service.
When the page load is complete, I will "rasterize ??" the page to get the graph image.
I will use this image in building my PDF using package like jsPDF.
Return the PDF URI back to the web app.
Does this make any sense at all? I struggle on how to integrate all the moving parts together. Any suggestions?

Related

Android camera, take picture(s) and save as multipage PDF, then upload to server via <input type="file" />

I have a webform with and want to open it on smartphone - than take pictures of some documents which need to be merged in one PDF, and on the end this file need to be uploaded to server.
My solution is to use Google Drive to upload PDF (scan) to GDrive and then somehow download this file from gdrive to server via some sort of widget (any links appreciate) installed on website.
Maybe someone have a better idea?
I know its late but my answer might help others. I also face the same challenge and implemented a custom solution based on Javascript and Since you are using web form so this solution will perfectly fits on your need.
You have to use JSPdf javascript library, JSPdf provide you pdf object in your browser and you can upload it download it and there are many other thing to play with.
First you have to initialize JSPdf object as per your requirement. I am creating PDF with page size width:500px and height 500px.
pdf = new jsPDF("l", "pt", [500,500]);
Simply when you will take picture from camera you will have each picture in form of base64, that base64 format you have to insert in JSPdf object
pdf.addImage(imgData, 'JPEG', 0, 0);
you can repeat the above code to add pictures from camera as much as you want, at the back-end these images are compiling and creating pdf document where each page have each images in sequence.
Once you are done, you can get PDF object in form of base64 object using below code that you can upload to any server.
pdf.output('datauristring')
above is only pdf part, you can find complete working example including camera part here Javascript Component to Scan Document

How to use external data when using ArcGIS API for JavaScript

I am building a dashboard(web app) to present the landslide related data. I have some external maps (slope, drainage and etc). I want to show them as layers in the web app. I was unable to find a correct way of doing so. Can someone suggest a solution?
You mentioned in your comment that you're trying to map Shapefiles. If you want to load your Shapefiles into the map from the JavaScript API, there's a sample here that shows you how to load that file into the map.
If you'd like to add it to your Web Map so that you can view it in an app, you can do that too, just go to the Arcgis.com Map page and click Add > Layer from File (more info).

URL link for the project reports for the PNG

Is there a way using a REST API or some other means to get the end point the URL which holds PNG for the iteration break down, velocity chart, iteration cumulative flow diagram for each project so that we can share it across.
Something like below
https://rally1.rallydev.com/slm/analytics/report/view/3161993978732214d/chart.png
How are you trying to share it? If you'd like to embed it in a wiki or sharepoint it's fairly easy to embed a custom app with that chart in it. The generated report images themselves are not actually linkable- they are generated as a client side image map...

How to set my canvas drawings visible to anther user who opens same page where actions performed using paper.js script

I am working with paper.js in asp.net mvc4 application ,which helps in drawing on canvas region of HTML. I need your support for my requirement:
When I draw on my canvas I want to make visible these drawings on other canvas who opened same page over internet.
Paper.js provides a global variable called project.activeLayer to access items on view. I saved cavnas data in JSON format from active Layer , then I send this data through server communication. How can I rebuild the view in the canvas with same data. ?
(or)
Is there any way to do this without transmission of data.?
Thanks,
surbob.
This is not going to be simple. What you're talking about is basically the same as a chat room with caht cleints in the browser. You need to send the canvas data to the server, and then have the server update any other clients connected to it.
Probably the best place to start would be a chat-room sample and modify the code to handle the canvas data. The SignalR real-time communications library would probablyhelp to make tings a lot simpler, and it has good samples to get you going.

sencha touch pdf generation form client side

We are working on creating mobile app using sencha touch frame work. one of our requirements is when user hits view pdf, the user entered form details which stored locally has json format should be rendered and view as pdf and also it can be saved as a pdf locally.
i found that itext is one of the java library which is widely used for pdf generation. but i couldn't find any article inter relating both sencha touch and itext. let me know is that a possible way or any other method available for json to pdf generation in sencha touch.
Regards
java has nothing to do with javascript.
A quick Google search of "javascript pdf generation" lists some libraries that may work but getting them to run on a device might be more trouble than its worth id look at submitting the form results to a server and downloading the resultant PDF.
this might point you in the right direction:
generating-pdf-files-with-javascript