en locales

This commit is contained in:
Felix Kaspar 2024-07-14 01:27:41 +02:00
parent 40ed0f68db
commit d449ccf624
13 changed files with 87 additions and 16 deletions

View File

@ -111,7 +111,7 @@ export function GenericField({ fieldName, joiDefinition }: GenericFieldProps) {
return (<div>comma_array, joi items are empty or bigger than one, this is not implemented</div>);
}
break;
case "alternatives":
case "alternatives": // TODO: Better support this. It is currently used by ScaleContent (working) and SplitByPreset (incompatible, but with that operator it isn't even considered a field so we need a different schema for that)
return (
<Fragment>
<label htmlFor={fieldName}>{flags.label}:</label>
@ -138,5 +138,6 @@ export function GenericField({ fieldName, joiDefinition }: GenericFieldProps) {
default:
console.log(joiDefinition);
return (<div>GenericField.tsx: <br/> "{fieldName}": requested type "{joiDefinition.type}" not found. Check console for further info.</div>)
}
}

View File

@ -0,0 +1,10 @@
{
"friendlyName": "Arrange Pages",
"description": "Arrange Pages in a new order",
"values": {
"arrangementConfig": {
"friendlyName": "Arrangement Config",
"description": "How to order the pages. See documentation for more info on the possible values."
}
}
}

View File

@ -1,6 +1,6 @@
{
"friendlyName": "Remove Blank Pages",
"description": "Remove pages without .",
"description": "Remove pages without text and images.",
"values": {
"whiteThreashold": {
"friendlyName": "Image White Threashold",

View File

@ -0,0 +1,10 @@
{
"friendlyName": "Remove Pages",
"description": "Remove selected pages.",
"values": {
"pageIndexes": {
"friendlyName": "Page Indexes",
"description": "An array of indexes of pages you want to extract."
}
}
}

View File

@ -0,0 +1,10 @@
{
"friendlyName": "Rotate Pagess",
"description": "Rotate selected pages by multiples of 90deg.",
"values": {
"rotation": {
"friendlyName": "Rotation",
"description": "Multiples of 90. Can be an array with the same size as the pdf pages or a single number."
}
}
}

View File

@ -0,0 +1,10 @@
{
"friendlyName": "Scale Content",
"description": "Scales the content of a page by a set factor.",
"values": {
"scaleFactor": {
"friendlyName": "Scale Factor",
"description": "Can be an array with the same size as the pdf pages or a single number."
}
}
}

View File

@ -0,0 +1,14 @@
{
"friendlyName": "Scale Page",
"description": "Sets the size of all pdf pages of the given document in pixels.",
"values": {
"height": {
"friendlyName": "Height",
"description": "The height of the pdf document in pixels."
},
"width": {
"friendlyName": "Width",
"description": "The width of the pdf document in pixels."
}
}
}

View File

@ -0,0 +1,10 @@
{
"friendlyName": "Split Pages By Preset",
"description": "Splits the Document when a specific split indicator is detected on a page.",
"values": {
"pageIndexes": {
"friendlyName": "Split Settings",
"description": "The type of page that should be used as a split indecator. whiteThreashold is only used when BLANK_PAGE is selected."
}
}
}

View File

@ -0,0 +1,10 @@
{
"friendlyName": "Split PDF by Index",
"description": "Splits the document at specific pages.",
"values": {
"pageIndexes": {
"friendlyName": "Page Indexes",
"description": "An array of indexes of pages you want to split the document after."
}
}
}

View File

@ -0,0 +1,10 @@
{
"friendlyName": "Update Metadata",
"description": "Updates the metadata of a PDF.",
"values": {
"deleteAll": {
"friendlyName": "Delete All",
"description": "Delete all metadata instead of overwriting it?"
}
}
}

View File

@ -1,17 +1,11 @@
import { Operator, Progress, oneToN } from ".";
import Joi from "@stirling-tools/joi";
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
import i18next from "i18next";
import { PdfFile } from "../wrappers/PdfFile";
import { splitPagesByIndex } from "./common/splitPagesByIndex";
import { detectEmptyPages } from "./common/detectEmptyPages";
import { detectQRCodePages } from "./common/detectQRCodePages";
export class SplitPagesByPreset extends Operator {
/** Detect and remove white pages */
async run(input: PdfFile[], progressCallback: (state: Progress) => void): Promise<PdfFile[]> {

View File

@ -1,8 +1,6 @@
import { PdfFile } from "../wrappers/PdfFile";
import { Operator, Progress, oneToN } from ".";
import Joi from "@stirling-tools/joi";
import { splitPagesByIndex } from "./common/splitPagesByIndex";
export class SplitPdfByIndex extends Operator {

View File

@ -1,12 +1,6 @@
import { PdfFile } from "../wrappers/PdfFile";
import { Operator, Progress, oneToOne } from ".";
import Joi from "@stirling-tools/joi";
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
import i18next from "i18next";
export class UpdateMetadata extends Operator {
/** PDF extraction, specify pages from one pdf and output them to a new pdf */
async run(input: PdfFile[], progressCallback: (state: Progress) => void): Promise<PdfFile[]> {