mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-13 02:18:16 +01:00
Add Crop to V2 (#4471)
# Description of Changes Add Crop to V2 --------- Co-authored-by: EthanHealy01 <80844253+EthanHealy01@users.noreply.github.com> Co-authored-by: Connor Yoh <connor@stirlingpdf.com> Co-authored-by: ConnorYoh <40631091+ConnorYoh@users.noreply.github.com>
This commit is contained in:
12
frontend/src/constants/cropConstants.ts
Normal file
12
frontend/src/constants/cropConstants.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { PAGE_SIZES } from "./pageSizeConstants";
|
||||
|
||||
// Default crop area (covers entire page)
|
||||
export const DEFAULT_CROP_AREA = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: PAGE_SIZES.A4.width,
|
||||
height: PAGE_SIZES.A4.height,
|
||||
} as const;
|
||||
|
||||
|
||||
export type ResizeHandle = 'nw' | 'ne' | 'sw' | 'se' | 'n' | 'e' | 's' | 'w' | null;
|
||||
8
frontend/src/constants/pageSizeConstants.ts
Normal file
8
frontend/src/constants/pageSizeConstants.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
// Default PDF page sizes in points (1 point = 1/72 inch)
|
||||
export const PAGE_SIZES = {
|
||||
A4: { width: 595, height: 842 },
|
||||
LETTER: { width: 612, height: 792 },
|
||||
A3: { width: 842, height: 1191 },
|
||||
A5: { width: 420, height: 595 },
|
||||
LEGAL: { width: 612, height: 1008 },
|
||||
} as const;
|
||||
Reference in New Issue
Block a user