-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export to PDF #509
Comments
+1 |
Comments via IRC [kubes] Ok, what do you think the issue is. Can you point me in the write direction and I take swing @ it. [rashidkpc] basically you need to convince phantom JS to both wait for thr route to full resolve, as well as wait for all of the data to be loaded [kubes] rashidkpc: Is there any element to check to tell if the data is loaded? If I have phantomjs just wait for N sec it works.. thinking of waiting for something... [rashidkpc] kubes: not really, everything is async, and the panels operate independently, there's currently no way to tell if everything is "done" |
here is a modified version of the example https://github.com/ariya/phantomjs/wiki/Screen-Capture rasterize.js Increase(added) the WaitTime to 10 seconds var page = require('webpage').create(),
system = require('system'),
address, output, size;
//How to to wait for kibana to load and the data from elasticseatch in milliseconds.
var waitTime = 10 * 1000;
if (system.args.length < 3 || system.args.length > 5) {
console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]');
console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"');
phantom.exit(1);
} else {
address = system.args[1];
output = system.args[2];
page.viewportSize = { width: 1024, height: 1024 };
if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") {
size = system.args[3].split('*');
page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' }
: { format: system.args[3], orientation: 'portrait', margin: '1cm' };
}
if (system.args.length > 4) {
page.zoomFactor = system.args[4];
}
page.open(address, function (status) {
if (status !== 'success') {
console.log('Unable to load the address!');
phantom.exit();
} else {
window.setTimeout(function () {
page.render(output);
phantom.exit();
}, waitTime);
}
});
} |
+1 |
When will this be supported? 2015? Greetings Damien |
For the records:
|
Sorry Guys , can someone help me to run this JS in Phantom. Actually I am new to Phantom and I am sure I am missing some argument. Below I have mentioned my command , with this it is creating blank PDF file . Please suggest how I can modify it to show correct result .
Second question regarding this would be do I need to mention complete kibana dashboard URL in the URL argument ? |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 |
2 similar comments
+1 |
+1 |
+5. Please take care of the page breaks too. So that the graphs are not distributed in two pages while printing. |
+1 |
I have tried using this: https://github.com/fzaninotto/screenshot-as-a-service Nevermind. This works well after updating PhantomJS to 2.1.1 :) |
+1 |
16 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
Elastic devs, now that reporting feature is already released , will that be utilized to bring pdf export to kibana ? |
heya, we have released reporting as a plugin to kibana, you can find more info here: https://www.elastic.co/products/reporting. |
@kimchy , reporting seems to be a paid plugin. Will the pdf export ever come to kibana core itself . |
@biswajit86 no, there are no plans. The reporting infrastructure we built and the generation of PDF/images are part of xpack. Note, we do provide it as part of our cloud offering in our cheapest tier (Standard): https://www.elastic.co/cloud/as-a-service/subscriptions. |
how to authenticate in kibana using phantomjjs and then take a screen-shot? |
Hi, After some tests, I managed to export a Kibana dashboard to PDF using More information here: https://github.com/theMiddleBlue/From-Kibana-to-PDF hope this can help ✌️ |
Try this:- |
* Checked out function_wrapper from common-tests * Removed url arg from image and fetch_image function. Added unit testsfor image. * Changed default val for _ to an array containing an empty string in markdown. Added unit tests for markdown * Updated unit tests for markdown * Changed default value of paginate in table to true. Added unit tests for table * Unit tests for repeatImage * Unit tests for revealimage * Updated render to not mutate context. Added unit tests for render * Pulled out style objects into a fixtures file. Updated imports in markdown, render and table unit tests * Removed large objects and cleaned up tests * Added tests for plot * Cleaned up tests for markdown and render * Pulled out plot helper functions into separate files. Removed step from seriesStyleToFlot * Added seriesStyle tests for plot. Removed unused bubble options in plot function. * Added pointseries and style fixtures * Added tests for getFlotAxisConfig * Added unit tests for getLegendConfig * Added tests for getColorsFromPalette * Added tests for getTickHash * Added tests for seriesStyleToFlot * Refactored plot and added unit tests * Rearranged test pointseries * Added tests for data in plot * moved getColorsFromPalette to lib * Renamed testpointseries and updated tests for plot * Added default values to pie. Added unit tests for pie. Added test pointseries for pie. * Removed .js * Cleaned up tests * Cleaned up tests * Removed comments for url handling in image view * Removed label color from pie function * Changed palette colors and updated tests * Wrapped empty string in double quotes for default values in markdown and replace. Commented out tests that require an instance of the interpreter * Removed fallback value for css in render * Removed null types from markdown args * Removed pie tests for 'combine' arg
Use PhantomJS to render images of a dashboard. These images then could be email/shared. All this could be scheduled.
rashidkpc came up with this idea the other day in IRC. There is an issue with AngularJS' routing though, and it does not work.
The text was updated successfully, but these errors were encountered: