Skip to content

Issue in exporting PDF #788

@Divyam192001

Description

@Divyam192001
  1. While exporting PDF, some child nodes that are on the right side are not getting printed in PDF. I have tried inline css also and other option but it is not working.

$('#export-pdf').on('click', function () {
exportFullChart('pdf');
});
function exportFullChart(type = 'png') {
const $originalContainer = $('#chart-container');
const originalStyle = $originalContainer.attr('style') || '';
const companyName = '@Model.CurrentCompany.OrganisationName';
const exportName = companyName.replace(/\s+/g, '_') + '_OrgChart';

// Clone the DOM node only
const $clonedContainer = $originalContainer.clone();
const $offscreenWrapper = $('

')
.css({
position: 'absolute',
top: '-9999px',
left: '-9999px',
width: $originalContainer.outerWidth(),
height: 'auto',
overflow: 'visible',
})
.append($clonedContainer)
.appendTo('body');

setTimeout(() => {
orgChartInstance.export(exportName, type);
$offscreenWrapper.remove();
}, 500);
}
2. While exporting PDf, some extra white space is coming in the right side

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions