https://github.com/miyako/pdfcpu
Classes to use the golang utility pdfcpu
https://github.com/miyako/pdfcpu
4d-class 4d-component pdf
Last synced: 11 days ago
JSON representation
Classes to use the golang utility pdfcpu
- Host: GitHub
- URL: https://github.com/miyako/pdfcpu
- Owner: miyako
- License: mit
- Created: 2024-04-01T01:59:48.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-05T04:22:23.000Z (over 1 year ago)
- Last Synced: 2025-01-08T17:55:16.944Z (about 1 year ago)
- Topics: 4d-class, 4d-component, pdf
- Language: 4D
- Homepage: https://miyako.github.io/pdfcpu/
- Size: 20.3 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](LICENSE)

Classes to use the golang utility [pdfcpu](https://pdfcpu.io).
## dependencies.json
```json
{
"dependencies": {
"pdfcpu": {
"github": "miyako/pdfcpu",
"version": "*"
}
}
}
```
## Examples
```4d
$PROJECT:=File(Structure file; fk platform path).name
$src:=Folder(Folder("/PROJECT/").platformPath; fk platform path).parent.folder("Samples/windows")
$dst:=Folder(fk desktop folder)
var $pdfcpu : cs.pdfcpu.pdfcpu
$pdfcpu:=cs.pdfcpu.pdfcpu.new(cs.pdfcpu._pdfcpu_Controller)
$inFile:=File("/PROJECT/4D Summit 2011 Pre-Class.pdf")
$outDir:=Folder(fk desktop folder)
//before and after page 2
$ex1:={inFile: $inFile; outDir: $outDir.folder("page"); mode: "page"; span: 2}
//3 pages each
$ex2:={inFile: $inFile; outDir: $outDir.folder("span"); span: 3}
//before pages 2,4,10
$ex3:={inFile: $inFile; outDir: $outDir.folder("pages"); mode: "page"; span: [2; 4; 10]}
$pdfcpu.split([$ex1; $ex2; $ex3])
```