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

Scaling in both dimentions #8

Open
michaelpastushkov opened this issue Jun 29, 2024 · 2 comments
Open

Scaling in both dimentions #8

michaelpastushkov opened this issue Jun 29, 2024 · 2 comments

Comments

@michaelpastushkov
Copy link

Can you please make scaling to accept width and height number, instead of just one for both. This would be a great help for many situations. BTW muPDF does that. Great simple wrapper otherwise!! Tx.

@hyzyla
Copy link
Owner

hyzyla commented Jun 29, 2024

@michaelpastushkov. I've just added width and height options to PDFiumPage.render function in v1.0.3 version

📝 width and height, instead of scale

@michaelpastushkov
Copy link
Author

Thanks a lot! One small addition that might save a lot of debugging time for many - round to the lower integer number inside your code. Or else we have to do it in ours (sizes are often calculated and may have decimals, in which case the render fails).

    const bitmap = await pdf_page.render({
        width: Math.floor(dst_width),
        height: Math.floor(dst_height),
        render: 'bitmap'
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants