Comments (9)
Hi! Can you post the code you are using? Preferably a working example on codepen or similar that demonstrates the issue. Unfortunately I'm not sure I understand your problem
from jspdf-autotable.
Sure, take a look
$scope.callJspdfAfterSubmitButton = function(){
var doc = new jsPDF('p', 'pt', 'letter');
var elementHandler = {
'#ignorePDF': function (element, renderer) {
return true;
}
};
var canvas = document.getElementsByClassName('canvasjs-chart-canvas');
document.getElementById('chartContainer').style.width = "550px"
$scope.chart.render();
var imgData = canvas[0].toDataURL("image/png", 1.0);
doc.addImage(imgData, 'PNG', 30, 15);
var totalPagesExp = "{total_pages_count_string}";
var footer = function (doc, lastCellPos, pageCount, options) {
var str = "Page " + pageCount;
// Total page number plugin only available in jspdf v1.0+
if (typeof doc.putTotalPages === 'function') {
str = str + " of " + totalPagesExp;
}
doc.text(str, options.margins.horizontal, doc.internal.pageSize.height - 30);
};
var options = {
renderFooter: footer,
startY: 315, // The start Y position on the first page. If set to false, top margin is used
overflow: 'linebreak' // false, ellipsize or linebreak (false passes the raw text to renderCell)
};
var columns =
[{title: "col1", key: "key1", width: 90 },
{title: "col2", key: "key2", width: 300},
{title: "col3", key: "key3", width: 220},
{title: "col4", key: "key4", width: 90},
{title: "col5", key: "key5", width: 100}];
var data = $scope.data.tipe1;
data.extend($scope.data.tipe2);
data.extend($scope.data.tip3);
data.extend($scope.data.tip4);
//parametros (columnas, info, options)
doc.autoTable(columns, data, options);
if (typeof doc.putTotalPages === 'function') {
doc.putTotalPages(totalPagesExp);
}
doc.output("datauri");
};
see the result, bro.
Erase photo for personal reasons, bro
if i set
margins: {bottom: 160},
the problem is fixed, but only because i say the last row was created soo distant from page foot, you know?.
if my columns have a loot of info, the issue appear.
from jspdf-autotable.
If can't understand what happen here with this portion of code and the image, please tell me, to make a working demostration.
from jspdf-autotable.
Thanks for reporting this issue! When I tried your code and found multiple bugs when having long text in a table wrapping more than one page. I don't think it has anything todo with images though? I will look into this as soon as possible.
Partly this is fixed in the very experimental version 2.0 of the library which can be found in the v2
branch. However, there were still issues and it's probably not worth testing until it is officially released.
from jspdf-autotable.
Maybe i should change the issue name, right? because Isnt the image problem, i think it was but.. is just the columns wth long text.
i will try version 2.0 thnx for quick answer!
Good luck.
from jspdf-autotable.
It should now definitely be fixed in version 2.0. Keep in mind that custom column widths are not supported in that version as of yet however.
from jspdf-autotable.
One last thing SomeAtoms, what should i change in my code to make it run?... can't make it ran with v2
from jspdf-autotable.
I will write an upgrade guide when it is officially released. For now you would have to check the examples.
from jspdf-autotable.
Version 2.0 is released which should fix this issue.
from jspdf-autotable.
Related Issues (20)
- (0 , import_jspdf_autotable.default) is not a function HOT 9
- Textfield Signature?
- 表格项合并时表格项与表头信息不对应 HOT 2
- Multitable loop doesn't align properly and creates unusual gaps or overlaps each other HOT 11
- HorizontalPageBreak page break can continue on same page if vertical space is enough HOT 6
- Cannot Read html tags HOT 1
- Merge Cell Inside the body of the table HOT 1
- Parsing HTML with tables HOT 1
- Rowspan on heading HOT 1
- Inconsistent Table Width Across Pages When Exporting Using jsPDF-AutoTable HOT 4
- Table Border is off and value is not displayed when the first column is having large rowSpan. HOT 7
- Some columns are shrinked because of large texts in some columns HOT 2
- I wanted to highlight some part of text in cell text. HOT 1
- How to set specific startY even after page break HOT 1
- Autotable heading or subheading HOT 1
- Text with horizontal spaces are going out of cell boundry or text is hidden under the next column. HOT 1
- Node.js PDF Rendering Issue with HTML Table String from MongoDB HOT 1
- Uncaught TypeError: Cannot set properties of undefined (setting 'pageNumber') at Table2 HOT 2
- There is console.log in cssParser HOT 3
- halign on column headers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jspdf-autotable.