Hi All,
I dont know if this really fixes the issue or messes soomething else up but this seems to work for me to prevent duplicate pages.
Im using Charts & Graphs demo view with google charts (which works perfectly).
My next issue is i get two copies of the underlying data in tables with one column named 'x' and i cant remove it for any not obvious reason.
/* line 63 in js/pdf_export.js
getHtml: function ($button) {
var $content = $($button.attr('data-content-selector'));
if ($content.length === 0) {
return;
}
var $clone = $content.clone();
var html = '';
$clone.each(function (index, value) {
$('.generating-pdf', value).remove();
html += this.elementToHtml($(value));
return false; /* ******************* ADDED BY ME ******************** */
}.bind(this));
return html;
},
Comments
Comment #2
arne_hortell commentedI found that the "extra" table which i cant remove is actually a part of the google chart&graph which keeps a tabular representation of the data in the piechart.
This is printed in the pdf.
Comment #3
arne_hortell commentedComment #4
arne_hortell commentedFor anyone out there, here is maybe a solution possible...
In your view add class pdf-export for items you want in your pdf document.
For those who you dont want to export the aria table also add a second class
Then add this at line 64
getHtml: function ($button) {
var $content = $($button.attr('data-content-selector'));
if ($content.length === 0) {
return;
}
var $clone = $content.clone();
var html = '';
$clone.each(function (index, value) {
$('.not-aria-table', value).find("table").remove(); // <- this is the remove tag
html += this.elementToHtml($(value));
Comment #5
arne_hortell commentedDo like this instead
Alter at row 64 above
$('.not-aria-table', value).find("table").remove();
$('.not-for-pdf', value).remove();
Now, add class pdf-export for everything you want to export with pdf
secondly add class
not-aria-table
for everything which have a ariatable you DO NOT WANT INTO THE PDF
and finally
add
not-for-pdf
Which is perfect for links etc you DO NOT WANT IN THE PDF.
Problem solved.
Comment #6
arne_hortell commentedFile mentioned above is the
pdf_export/js/pdf_export.js
Happy coding!
I might make a patch for this.
Meanwhile its a twoliner...
Comment #7
nbouhid commentedIt's not really clean, but you can always include your own JS file and override the getHtml method with your own implementation.