Comments (2)
Hello @ithillel-aminev. The default unit is 1⁄72 inch.
This isn't currently mentioned anywhere in the docs. I'd definitely like to improve the docs and add more details and examples when I have the time. I've copied the relevant section(s) from the PDF specification below, in case you're interested. (Note that I certainly don't expect users of pdf-lib
to consult this document when they have questions, it's just sometimes interesting to read things directly from the source.)
8.3.2.2 Device Space
The contents of a page ultimately appear on a raster output device such as a display or a printer. Such devices vary greatly in the built-in coordinate systems they use to address pixels within their imageable areas. A particular device’s coordinate system is called its device space. The origin of the device space on different devices can fall in different places on the output page; on displays, the origin can vary depending on the window system. Because the paper or other output medium moves through different printers and imagesetters in different directions, the axes of their device spaces may be oriented differently. For instance, vertical (y) coordinates may increase from the top of the page to the bottom on some devices and from bottom to top on others. Finally, different devices have different resolutions; some even have resolutions that differ in the horizontal and vertical directions.
8.3.2.3 User Space
To avoid the device-dependent effects of specifying objects in device space, PDF defines a device-independent coordinate system that always bears the same relationship to the current page, regardless of the output device on which printing or displaying occurs. This device-independent coordinate system is called user space.
The user space coordinate system shall be initialized to a default state for each page of a document. The CropBox entry in the page dictionary shall specify the rectangle of user space corresponding to the visible area of the intended output medium (display window or printed page). The positive x axis extends horizontally to the right and the positive y axis vertically upward, as in standard mathematical practice (subject to alteration by the Rotate entry in the page dictionary). The length of a unit along both the x and y axes is set by the UserUnit entry (PDF 1.6) in the page dictionary (see Table 30). If that entry is not present or supported, the default value of 1⁄72 inch is used. This coordinate system is called default user space.
NOTE: The default for the size of the unit in default user space (1⁄72 inch) is approximately the same as a point, a unit widely used in the printing industry. It is not exactly the same, however; there is no universal definition of a point.
from pdf-lib.
I'm going to close this now. Feel free to reopen it if you have additional questions 👍
from pdf-lib.
Related Issues (20)
- Some pages (PageLeaf) missing once the pdf is loaded
- Add a custom font Bogle
- Improve unicode support HOT 2
- Set BoundingBox for Images HOT 1
- How to decrypt a pdf doc by using pdf-lib HOT 2
- Document what the unit is for page dimensions HOT 1
- Local font is not rendering in React Native App
- Is it possible to set line height using text field? HOT 1
- Original font is not mantained when a form is filled HOT 1
- How can we add set auto dimension of image in pdf
- From field tabulation order
- Cannot add an image on top of a shape HOT 2
- Pdf not saved (in Device file ) in React Native HOT 3
- We are getting the error "pdflib:17785 Uncaught (in promise) TypeError: fontkit.create is not a function"
- getCreationDate has issues parsing some dates
- Unexpected Checkbox Borders on Print After Editing PDF with pdf-lib
- Text size shrinking and expanding in Text Fields as per text length.
- Flatten is removing RadioGroups and Checkboxes HOT 9
- Custom Font (Libre Barcode 128) : Trying to access beyond buffer length HOT 2
- Unable to print the document which is filled with same text field twice.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf-lib.