I have to create a print preview page where I have to show some information and a highchart of the original page. Is there a way to export the highchart graph from one page to another?
There are probably many ways to accomplish this.
What language are you working in?
I would try it this way:
set the chart options in an external js file
include that js file in both the original page, and the 'preview' page
I assume the user will click on a link or button to open the preview page...?
send the data via POST to the new page, and instantiate the chart on the new page on page load
You could also look into using the Export package to
on link/button click, export the chart as an image, to the server
pass the url of the saved image to the new page, and load the image there
I have not worked with exporting to the server, and wouldn't bother with the set up for this when you can just pass the data and build the chart on the new page, but it's an option.
Related
In the OpenStreetMap iD Editor (the main one you get on the website when you login and try to edit), there is a way to overlay a custom boundary, as shown in screenshot below.
Latest Task Manager is displaying the iD editor in an iframe or so, but earlier versions used to just open it in a new tab, with the custom overlay data still working either through a URL param, or maybe some header attached.
How is this done? I want to overlay a similar boundary over iD editor when a user clicks a button on my website and it opens iD editor in a new tab with the chosen co-ordinates.
Pass on link to gpx as url params.
https://github.com/openstreetmap/iD/blob/develop/API.md
Edit by nikhil: Found that in main openstreetmap site, we have to put the gpx param after a # instead of putting as a regular query parameter. So, this works:
https://www.openstreetmap.org/edit#gpx=https%3A//server.nikhilvj.co.in/pmgsy/gpx/1445.gpx
Ref: https://github.com/openstreetmap/openstreetmap-website/issues/3540
The newer version of Chartkick has a download option that displays a button over the javascript chart, when clicked will open a new browser window and render the chart as an image. This is great. However, that method does not seem to help render an image to use as an email attachment. Unless there is a way to call/render the chart using a chartkick method inside the mailer, grab the image and attach it...As far as I can tell, this functionality does not exist.
Anyone know of a way to attach a chartkick chart as an image email attachment?
Natively? No. Chartkick performs a download using their script chartkick.js and chart.bundle.js. It happens entirely client-side, not server-side. And it should not be opening a new window. It should just download the file directly onto the client's machine. Example here: https://chartkick.com/react
I am updating an old application, and have been asked to change the old Print routine (which just invoked the print command via javascript, and printed out the html), to one that prints out a pdf (the theory being that we then have more control of the pdf / how it looks etc across all printers.)
Using the Rotativa library, I can generate my pdf's, either on the fly or to a file.
After doing some reading, it appears impossible to stream a pdf from memory, and it has to be created as a file first, sent to the browser, and then deleted.)
the last line of my controller is;
return File(#"D:\Development\Source\Workspaces\ConsumerCreditLicenseSystem\Code\ConsumerCreditSystem\CCLSystem\_Idd\1.pdf", "application/pdf");
What I am strugglign with is getting that page to invoke the Print Dialog. If I send it to a new view with javascript to do this, then I am back to square one as the page is html not my pdf. Is there any way I can mark that my pdf is for printing, or combine it with some html so I can have the old faithful of
window.print();
in the document?
A PDF is not a webpage; it's a binary. When you send the PDF as a response to the user, you have no control over what happens on their end. If their browser is capable of viewing a PDF in place, it will display it; otherwise, it will prompt the user to download it. Either way, it will be up to the user whether they want to print it or not, and it will also be up to them to go back or whatever. You cannot redirect the user automatically at this point.
A slightly better option would be to redirect the user to another page, with a link to a view that will send the PDF down to them. Then, you can do things like force the PDF to download (so it's not rendered inside the same tab/window, effectively taking the user away from your site), or force the link to open in a new tab or window. However, you still will not be able to prompt the user to print.
I am using HighChart in my application.
I want to export chart image on a button click like http://jsfiddle.net/hfrntt/fXHB5/1896/.
but i want to save image in a predefined folder and remove the save dialog pop-up to save image.
On button click image saved on the predefined folder.(No save dialog)
Thanks in advance
You have to setup an exportserver. Upon the client sends the Highcharts SVG file to this service it will be converted to an image. Before the server returns the image to the client you can save it to the predefined filesystem.
Here you can find a php export server and a java based one. https://github.com/highslide-software/highcharts.com/tree/master/exporting-server developed by Highcharts
These exportservers are setup to remove the temporary created files. You have to change the code a bit to prevent this.
read also this article for more background information on Highcharts exportservers
This is going to involve much more than simply using highcharts. You are going to have to use some sort of wrapper that will actually render the chart/page on the server-side and then essentially output it as an image. The following are links taken from a post on the highcharts website.
GWT Highcharts wrapper
Highcharts-server-side-export (with Rhino/Batik)
I've been using Indesign to create some brochures. I export them as SWF to display them as a flip book.
The next step I want to take is to put hyperlinks on each product in my brochure so that when a user clicks them the item gets added to their shopping basket, or something similar.
First I tried using a hyperlink value of ?product=code, but as there's no http://, whenever you open this link it just opens a blank tab.
Secondly I tried a hyperlink value of http://linktosite.com/flipbook.php?product=code. This worked fine but as the users may want to order several products from the catalogue they're going to click on a lot of the links, which will in turn open up loads of new tabs in the browser.
My question is: Is there a way of passing hyperlink values through the same page the SWF is on? I don't want the links to open a new tab everytime.
How can I achieve this?
Indesign cs5.5 has new feature called 'web viewer'in windows/extensions/overlay creator. This let you browsing another website in indesign file.