Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix drawRectangle to handle rotation correctly #62

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

MatheusrdSantos
Copy link
Collaborator

What?

Fix drawRectangle to handle rotation correctly

Why?

to fix the issue reported here: #61

How?

Testing?

const fs = require('fs');
const pdf = require('@cantoo/pdf-lib');
run();
async function run() {
	const doc = await pdf.PDFDocument.create();
	const page = doc.addPage();
	page.drawRectangle({x: 20, y: 200, width: 100, height: 50, rotate: pdf.degrees(45)});
	fs.writeFileSync('bugreport.pdf', await doc.save());
}

New Dependencies?

Screenshots

before(left) and after(right)
image

@Sharcoux Sharcoux merged commit e5f590d into master Aug 12, 2024
2 checks passed
@Sharcoux Sharcoux deleted the fix-draw-rectangle branch August 12, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants