Stirling-PDF/client-vanilla/exampleWorkflows.js

165 lines
3.8 KiB
JavaScript
Raw Normal View History

2023-10-17 01:31:00 +02:00
// JSON Representation of this Node Tree:
// https://discord.com/channels/1068636748814483718/1099390571493195898/1118192754103693483
// https://cdn.discordapp.com/attachments/1099390571493195898/1118192753759764520/image.png?ex=6537dba7&is=652566a7&hm=dc46820ef7c34bc37424794966c5f66f93ba0e15a740742c364d47d31ea119a9&
export const discordWorkflow = {
2023-10-17 01:31:00 +02:00
outputOptions: {
2023-10-17 03:40:54 +02:00
zip: false
2023-10-17 01:31:00 +02:00
},
operations: [
{
type: "extract",
values: { "index": "1" },
operations: [
{
type: "removeObjects",
values: { "objectNames": "photo, josh" },
operations: [
{
type: "wait",
values: { "id": 1 }
}
]
}
]
},
{
type: "extract",
values: { "index": "2-5" },
operations: [
{
type: "fillField",
values: { "objectName": "name", "inputValue": "Josh" },
operations: [
{
type: "wait",
values: { "id": 1 }
}
]
}
]
},
{
type: "done", // This gets called when the other merge-ops with the same id finish.
values: { "id": 1 },
operations: [
{
type: "merge",
2023-10-17 01:31:00 +02:00
values: {},
operations: []
}
]
},
{
type: "extractImages",
values: {},
operations: []
},
{
type: "merge",
2023-10-17 01:31:00 +02:00
values: {},
operations: [
{
type: "transform",
values: { "scale": "2x", "rotation": "90deg" },
operations: []
}
]
}
]
}
// This will merge all input files into one giant document
export const mergeOnly = {
outputOptions: {
2023-10-17 03:40:54 +02:00
zip: false
},
operations: [
{
type: "merge",
values: {},
operations: []
}
]
2023-10-17 03:40:54 +02:00
}
// Extract Pages and store them in a new document
export const extractOnly = {
outputOptions: {
zip: false
},
operations: [
{
type: "extract",
values: { "pagesToExtractArray": [0, 2] },
operations: []
}
]
}
// Split a document up into multiple documents
export const splitOnly = {
outputOptions: {
zip: false
},
operations: [
{
type: "split",
values: { "pagesToSplitAfterArray": [2, 10] },
operations: []
}
]
}
export const rotateOnly = {
outputOptions: {
zip: false
},
operations: [
{
type: "rotate",
values: { "rotation": -90 },
operations: []
}
]
2023-10-18 01:20:31 +02:00
}
export const imposeOnly = {
outputOptions: {
zip: false
},
operations: [
{
type: "impose",
values: { "nup": 2, "format": "A4L" },
operations: []
}
]
}
export const removeBlankPagesOnly = {
outputOptions: {
zip: false
},
operations: [
{
type: "removeBlankPages",
values: { "whiteThreashold": 10 },
operations: []
}
]
2023-10-28 19:48:16 +02:00
}
export const splitOnQR = {
outputOptions: {
zip: false
},
operations: [
{
type: "splitOn",
values: {
type: "QR_CODE"
},
operations: []
}
]
}