GithubHelp home page GithubHelp logo

Comments (4)

cefetra-valstar avatar cefetra-valstar commented on August 30, 2024 1

Solution: exchange 217 and 403 with each other.
Reason: You get that error because your y1 is smaller than y2.
Hint: in [x1,y1,x2,y2] the following must hold: x1 is smaller than x2 and y1 is bigger than y2.
From the documentation: x1,y1,x2,y2 where (x1, y1) -> top-left and (x2, y2) -> bottom-right in PDF coordinate space. In PDF coordinate space, the bottom-left corner of the page is the origin, with coordinates (0, 0).

from camelot.

vinayak-mehta avatar vinayak-mehta commented on August 30, 2024

@shivohmgupta Can you please post the PDF that raised this issue?

from camelot.

Achilleusdk avatar Achilleusdk commented on August 30, 2024

I had the same issue. In my case, the coordinates tool defined the origin as the top left rather than the bottom left corner of the PDF. So, the solution was to "reverse" the y-coordinates by taking the height of the page and subtracting the y-coordinates.
This post was useful: Hopding/pdf-lib#87 (comment)

from camelot.

bendlev avatar bendlev commented on August 30, 2024

Would there be a way to detect this sort of error and report it to the user? Even a hint phrase or a reminder that PDF coordinates are defined differently would be useful when debugging. (I ran into this issue and went through 3 Stack Overflow posts and 2 issues before landing here, and the solution worked)

from camelot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.