score:1
There is a Fork with a fix for that. You can set the dpi now with this fork: https://github.com/martonw/phantomjs/tree/issue-%2313553
You need to compile it for your OS and then you can set the dpi with page.dpi
console.log('Loading a web page');
var page = require('webpage').create();
var url = 'http://phantomjs.org/';
page.open(url, function (status) {
//Page is loaded!
page.dpi=300; // this is where you actually set the DPI
page.render("test.pdf");
phantom.exit();
}
Be sure you use the same OS for phatomjs on where you compile it, because the compile process reads the dpi from the system and uses it for phantomjs. This means: If you compile it on windows with standard dpi 96 and use it on centos you will have a scale of 96/72 because centos uses 72 dpi
score:0
Yes, >2.0 has a poorly defined A4. I scale my html by adjusting the css style from within rasterize.js just before the .render command.
page.evaluate(function () {
var the_page = document.getElementsByTagName("page")[0];
the_page.style.transformOrigin='0 0';
the_page.style.WebkitTransformOrigin='0 0';
the_page.style.transform='scale(1.28)';
the_page.style.webkitTransform ='scale(1.28)';
);
Source: stackoverflow.com
Related Query
- PhantomJS PDF DPI scaling issues
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- exporting highcharts polar chart to PDF with phantomjs
- Highcharts columns height in phantomjs generated pdf
- Angular.js, Highcharts, Phantomjs PDF printer - graphs not showing up
- Strange character in the Highstock source code
- Highcharts Polar Plot area scaling issues
- Exporting Charts on server side with Highcharts and PhantomJS to make a custom PDF
- Export Highcharts to PDF (using javascript and local server - no internet connection)
- How to export a Highchart chart to PDF thanks to a button outside the chart?
- Disable PDF and SVG download options in Highcharts
- Using html2canvas to render a highcharts chart to pdf doesn't work on IE and Firefox
- Optimize JavaScript DrillDown code
- I can't make Highcharts phantomJs export server work
- Highcharts and phantomjs error. Can't find variable Highcharts
- Replacing highcharts.each in my code as it is being deprecated
- PhantomJS with embedded web server uses only one CPU
- Dynamic PDF from html that contains Javascript
- highcharts and canvg scaling issue
- Highcharts phantomjs export server can't parse json string
- Highcharts yAxis is not scaling to fill available height
- Code works on fiddle but not when I do /show
- Highcharts - Global configuration with common code and unique data & Headings
- Can I use highcharts in a pdf generate with prawn in Rails?
- Highchart render in pdf generated using PHP mPdf
- JavaScript code inside TypeScript file .ts not working
- Issues using highcharts node export server from ClojureScript - "0x03 error when performing chart generation"
- Remove DataPoint from x-axis redraw Issues
- Highcharts x axis custom scaling
- Highcharts' verifying stacking issues
More Query from same tag
- HighCharts: column grouped drill down
- adding more data in highchart
- how to display chart in jquery?
- Highcharts tick interval positioning
- Chart with different colour for each cell
- How to get access to the chart from HighchartsReact component to ResponsiveGridLayout component when I'm using functional react component
- highcharts & rails
- Load event issue: unable to add hover event on pie chart's legend
- HighCharts fitting long Y-axis labels
- HighCharts - HighStock - Show Date for Candlestick & Volume
- Hide stacklabel if zero
- Highcharts can not display ajax's return data
- How to set the highcharts interactive with select option
- How do I attach a click event handler to the whole HighCharts Gauge control?
- Angular 8 highcharts How to pass custom data to drilldown event in Highcharts
- Webpack Highcharts Plugin IIFE
- Gradle sync failed. Basic functionality will not work properly
- Column chart in Highcharts - select series with a click
- Highcharts - Line chart mark selected Point
- How to get data in Highstock from PHP MySQL data on AJAX call
- jQuery detach() v/s remove() v/s hide()
- Highchart Bubble Chart Shadow
- Displaying multiple Highcharts from single json
- How to show all the annotations in Hichcharts?
- HighCharts: Reaching options of other charts from point event
- Would it be possible to make two columns which belong to different series respectively to be placed exactly on the tick on x-axis with highchart?
- highstock crosshair width according to zoom
- HighStock xAxis values separate from series "y" data
- How to change camera angle in highcharts 3d
- Render Table jQuery weird load order