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

[BUG] - {Stream} PageArea has top=0 and bottom=-612 #19

Open
kylevarisco opened this issue Aug 10, 2021 · 0 comments
Open

[BUG] - {Stream} PageArea has top=0 and bottom=-612 #19

kylevarisco opened this issue Aug 10, 2021 · 0 comments

Comments

@kylevarisco
Copy link

Describe the bug
ObjectExtractor.Extract() produces a PageArea with top=0 and bottom=-612. Only happens on certain PDFs, and I'm not sure what causes it.

To Reproduce
I can send the PDF privately. Don't want to expose any proprietary information online.

using (PdfDocument doc = PdfDocument.Open(filePath, new ParsingOptions() { ClipPaths = true }))
{
    foreach (UglyToad.PdfPig.Content.Page page in doc.GetPages())
    {
        var extractor = new ObjectExtractor(doc);
        var pageArea = extractor.Extract(page.Number);
    }
}

Expected behavior
I would expect top/bottom to always be positive. left and right attributes don't ever seem to display this behavior.

Screenshots
image

Additional context
My workaround is to detect this particular scenario and change the way I'm creating the PdfRectangle. I've also seen other scenarios where top=-612 and bottom=0, and height=-612. Probably a similar issue.

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

1 participant