Skip to content

the content placed at the very top of the page is being cropped in the generated PDF #3926

@yogesh-h-98

Description

@yogesh-h-98

const orientation = reportSize.width > reportSize.height ? "l" : "p";
const pdf = new jsPDF(orientation, "px", pdfFormat);

	const pdfPageWidth = pdf.internal.pageSize.getWidth();
	const padding = 10;

	await pdf.html(printContent, {
		callback: (doc) => doc.save(fileName),
		x: padding,
		y: padding,
		width: pdfPageWidth,
		windowWidth: reportSize.width,
		html2canvas: {
			scale: 1,
			logging: false,
		},
	});
Image Image

This is my code above, the first image shows the preview, and the second image shows the result after download. When the image is placed above the border as in the first image, that content does not appear in the downloaded PDF, as in the second image. I think the issue is related to padding or margin.

How can I fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions