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

Problem with obtaining image size #97

Open
a875210 opened this issue Mar 6, 2024 · 1 comment
Open

Problem with obtaining image size #97

a875210 opened this issue Mar 6, 2024 · 1 comment

Comments

@a875210
Copy link

a875210 commented Mar 6, 2024

/// <inheritdoc />
public int GetPageWidth()
{
    lock (DocLib.Lock)
    {
        return (int)((int)fpdf_view.FPDF_GetPageWidth(_page) * _scaling);
    }
}

/// <inheritdoc />
public int GetPageHeight()
{
    lock (DocLib.Lock)
    {
        return (int)((int)fpdf_view.FPDF_GetPageHeight(_page) * _scaling);
    }
}

It needs to be modified in this way to be normal, otherwise there will be a difference in size

@Modest-as
Copy link
Member

Modest-as commented Mar 6, 2024

what do you mean? FPDF_GetPage... returns a double, we cast it to int, but I'd rather lose precision once than twice. The same functions are used when images are being generated.

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