2026-03-16 11:01:50 +00:00
# AUTO-GENERATED FILE. DO NOT EDIT.
2026-04-20 15:57:11 +01:00
# Generated by scripts/generate_tool_models.py from Java OpenAPI spec (SwaggerDoc.json).
# ruff: noqa: E501
2026-03-16 11:01:50 +00:00
from __future__ import annotations
2026-04-20 15:57:11 +01:00
from enum import Enum , IntEnum , StrEnum
from pydantic import Field , RootModel , SecretStr
2026-03-16 11:01:50 +00:00
2026-03-26 10:35:47 +00:00
from stirling.models.base import ApiModel
2026-03-16 11:01:50 +00:00
class AddAttachmentsParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
attachments : list [ bytes ] = Field ( ... , description = "The image file to be overlaid onto the PDF." )
convert_to_pdf_a3b : bool = Field (
2026-04-20 15:57:11 +01:00
False , description = "Convert the resulting PDF to PDF/A-3b format after adding attachments"
)
2026-05-01 10:19:38 +01:00
class AddCommentsParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
comments : str = Field (
... ,
2026-05-01 10:19:38 +01:00
description = "JSON array of comment specs. Each element has: {pageIndex, x, y, width, height, text, author?, subject?}. Coordinates are PDF user-space with origin at the page's bottom-left." ,
examples = [
'[{"pageIndex":0,"x":72,"y":720,"width":20,"height":20,"text":"Check this paragraph","author":"Reviewer","subject":"Unclear wording"}]'
],
)
2026-04-20 15:57:11 +01:00
class AddImageParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
every_page : bool = Field ( False , description = "Whether to overlay the image onto every page of the PDF." )
x : float = Field ( 0 , description = "The x-coordinate at which to place the top-left corner of the image." )
y : float = Field ( 0 , description = "The y-coordinate at which to place the top-left corner of the image." )
2026-04-20 15:57:11 +01:00
class CustomMargin ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Custom margin: small/medium/large/x-large
"""
2026-04-20 15:57:11 +01:00
small = "small"
medium = "medium"
large = "large"
x_large = "x-large"
class FontType ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Font type for page numbers
"""
2026-04-20 15:57:11 +01:00
helvetica = "helvetica"
courier = "courier"
times = "times"
class Position ( IntEnum ):
2026-05-14 19:30:39 +01:00
"""
Position: 1-9 representing positions on the page (1=top-left, 2=top-center, 3=top-right, 4=middle-left, 5=middle-center, 6=middle-right, 7=bottom-left, 8=bottom-center, 9=bottom-right)
"""
2026-04-20 15:57:11 +01:00
integer_1 = 1
integer_2 = 2
integer_3 = 3
integer_4 = 4
integer_5 = 5
integer_6 = 6
integer_7 = 7
integer_8 = 8
integer_9 = 9
class AddPageNumbersParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
custom_margin : CustomMargin = Field ( CustomMargin . medium , description = "Custom margin: small/medium/large/x-large" )
custom_text : str = Field (
2026-04-20 15:57:11 +01:00
" {n} " ,
description = "Custom text pattern. Available variables: {n} =current page number, {total} =total pages, {filename} =original filename" ,
examples = [ "Page {n} of {total} " ],
)
2026-05-14 19:30:39 +01:00
font_color : str = Field ( "#000000" , description = "Hex colour for page numbers (e.g. #FF0000)" , examples = [ "#000000" ])
font_size : float = Field ( 12 , description = "Font size for page numbers" , ge = 1.0 )
font_type : FontType = Field ( ... , description = "Font type for page numbers" )
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
2026-05-14 19:30:39 +01:00
pages_to_number : str = Field ( "all" , description = "Which pages to number (e.g. '1,3-5,7' or 'all')" )
position : Position = Field (
... ,
2026-04-20 15:57:11 +01:00
description = "Position: 1-9 representing positions on the page (1=top-left, 2=top-center, 3=top-right, 4=middle-left, 5=middle-center, 6=middle-right, 7=bottom-left, 8=bottom-center, 9=bottom-right)" ,
)
2026-05-14 19:30:39 +01:00
starting_number : int = Field ( 1 , description = "Starting number for page numbering" , ge = 1 )
zero_pad : int = Field (
2026-04-20 15:57:11 +01:00
0 , description = "Zero-padding width for page numbers (Bates Stamping). Set to 0 to disable padding" , ge = 0
)
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class KeyLength ( IntEnum ):
2026-05-14 19:30:39 +01:00
"""
The length of the encryption key
"""
2026-04-20 15:57:11 +01:00
integer_40 = 40
integer_128 = 128
integer_256 = 256
class AddPasswordParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
key_length : KeyLength = Field ( ... , description = "The length of the encryption key" )
2026-04-20 15:57:11 +01:00
owner_password : SecretStr | None = Field (
None ,
description = "The owner password to be added to the PDF file (Restricts what can be done with the document once it is opened)" ,
)
password : SecretStr | None = Field (
None , description = "The password to be added to the PDF file (Restricts the opening of the document itself.)"
)
2026-05-14 19:30:39 +01:00
prevent_assembly : bool = Field ( False , description = "Whether document assembly is prevented" )
prevent_extract_content : bool = Field ( False , description = "Whether content extraction is prevented" )
prevent_extract_for_accessibility : bool = Field (
2026-04-20 15:57:11 +01:00
False , description = "Whether content extraction for accessibility is prevented"
)
2026-05-14 19:30:39 +01:00
prevent_fill_in_form : bool = Field ( False , description = "Whether form filling is prevented" )
prevent_modify : bool = Field ( False , description = "Whether document modification is prevented" )
prevent_modify_annotations : bool = Field ( False , description = "Whether modification of annotations is prevented" )
prevent_printing : bool = Field ( False , description = "Whether printing of the document is prevented" )
prevent_printing_faithful : bool = Field ( False , description = "Whether faithful printing is prevented" )
2026-04-20 15:57:11 +01:00
class Alphabet ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The selected alphabet of the stamp text
"""
2026-04-20 15:57:11 +01:00
roman = "roman"
arabic = "arabic"
japanese = "japanese"
korean = "korean"
chinese = "chinese"
thai = "thai"
2026-05-14 19:30:39 +01:00
class CustomMargin1 ( StrEnum ):
"""
Specifies the margin size for the stamp.
"""
small = "small"
medium = "medium"
large = "large"
x_large = "x-large"
class Position1 ( IntEnum ):
"""
Position for stamp placement based on a 1-9 grid (1: bottom-left, 2: bottom-center, 3: bottom-right, 4: middle-left, 5: middle-center, 6: middle-right, 7: top-left, 8: top-center, 9: top-right)
"""
integer_1 = 1
integer_2 = 2
integer_3 = 3
integer_4 = 4
integer_5 = 5
integer_6 = 6
integer_7 = 7
integer_8 = 8
integer_9 = 9
2026-04-20 15:57:11 +01:00
class StampType ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The stamp type (text or image)
"""
2026-04-20 15:57:11 +01:00
text = "text"
image = "image"
class AddStampParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
alphabet : Alphabet = Field ( Alphabet . roman , description = "The selected alphabet of the stamp text" )
custom_color : str = Field ( "#d3d3d3" , description = "The color of the stamp text" )
custom_margin : CustomMargin1 = Field ( CustomMargin1 . medium , description = "Specifies the margin size for the stamp." )
font_size : float = Field ( 40 , description = "The font size of the stamp text and image in points." )
opacity : float = Field ( 0.5 , description = "The opacity of the stamp (0.0 - 1.0)" )
override_x : float = Field (
2026-04-20 15:57:11 +01:00
- 1 ,
description = "Override X coordinate for stamp placement. If set, it will override the position-based calculation. Negative value means no override." ,
)
2026-05-14 19:30:39 +01:00
override_y : float = Field (
2026-04-20 15:57:11 +01:00
- 1 ,
description = "Override Y coordinate for stamp placement. If set, it will override the position-based calculation. Negative value means no override." ,
)
2026-05-14 19:30:39 +01:00
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
2026-05-14 19:30:39 +01:00
position : Position1 = Field (
Position1 . integer_8 ,
2026-04-20 15:57:11 +01:00
description = "Position for stamp placement based on a 1-9 grid (1: bottom-left, 2: bottom-center, 3: bottom-right, 4: middle-left, 5: middle-center, 6: middle-right, 7: top-left, 8: top-center, 9: top-right)" ,
)
2026-05-14 19:30:39 +01:00
rotation : float = Field ( 0 , description = "The rotation of the stamp in degrees" )
stamp_text : str = Field ( "Stirling Software" , description = "The stamp text" )
stamp_type : StampType = Field ( ... , description = "The stamp type (text or image)" )
class Alphabet1 ( StrEnum ):
"""
The selected alphabet
"""
roman = "roman"
arabic = "arabic"
japanese = "japanese"
korean = "korean"
chinese = "chinese"
thai = "thai"
2026-04-20 15:57:11 +01:00
class WatermarkType ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The watermark type (text or image)
"""
2026-04-20 15:57:11 +01:00
text = "text"
image = "image"
class AddWatermarkParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
alphabet : Alphabet1 = Field ( Alphabet1 . roman , description = "The selected alphabet" )
convert_pdf_to_image : bool = Field ( False , description = "Convert the redacted PDF to an image" )
custom_color : str = Field ( "#d3d3d3" , description = "The color for watermark" )
font_size : float = Field ( 30 , description = "The font size of the watermark text" , ge = 1.0 )
height_spacer : int = Field ( 50 , description = "The height spacer between watermark elements" , ge = 0 )
opacity : float = Field ( 0.5 , description = "The opacity of the watermark (0.0 - 1.0)" )
rotation : float = Field ( 0 , description = "The rotation of the watermark in degrees" )
watermark_text : str = Field ( "Stirling Software" , description = "The watermark text" )
watermark_type : WatermarkType = Field ( ... , description = "The watermark type (text or image)" )
width_spacer : int = Field ( 50 , description = "The width spacer between watermark elements" , ge = 0 )
2026-04-20 15:57:11 +01:00
class AutoRedactParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
convert_pdf_to_image : bool = Field ( False , description = "Convert the redacted PDF to an image" )
custom_padding : float = Field ( ... , description = "Custom padding for redaction" )
list_of_text : str = Field ( "text,text2" , description = "List of text to redact from the PDF" )
redact_color : str = Field ( "#000000" , description = "The color for redaction" )
use_regex : bool = Field ( False , description = "Whether to use regex for the listOfText" )
whole_word_search : bool = Field ( False , description = "Whether to use whole word search" )
2026-03-16 11:01:50 +00:00
class AutoRenameParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
use_first_text_as_fallback : bool = Field (
2026-04-20 15:57:11 +01:00
False ,
description = "Flag indicating whether to use the first text as a fallback if no suitable title is found. Defaults to false." ,
)
class AutoSplitPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
duplex_mode : bool = Field (
2026-04-20 15:57:11 +01:00
False ,
description = "Flag indicating if the duplex mode is active, where the page after the divider also gets removed." ,
)
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class DuplexPass ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
For manual duplex: which pass to generate
"""
2026-04-20 15:57:11 +01:00
both = "BOTH"
first = "FIRST"
second = "SECOND"
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class PagesPerSheet ( Enum ):
2026-05-14 19:30:39 +01:00
"""
The number of pages per side for booklet printing (always 2 for proper booklet).
"""
2026-04-20 15:57:11 +01:00
number_2 = 2
class SpineLocation ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The spine location for the booklet.
"""
2026-04-20 15:57:11 +01:00
left = "LEFT"
right = "RIGHT"
2026-03-16 11:01:50 +00:00
class BookletImpositionParams ( ApiModel ):
2026-04-20 15:57:11 +01:00
add_border : bool | None = Field ( None , description = "Boolean for if you wish to add border around the pages" )
add_gutter : bool | None = Field ( None , description = "Add gutter margin (inner margin for binding)" )
double_sided : bool | None = Field ( None , description = "Generate both front and back sides (double-sided printing)" )
2026-05-14 19:30:39 +01:00
duplex_pass : DuplexPass = Field ( DuplexPass . both , description = "For manual duplex: which pass to generate" )
2026-04-20 15:57:11 +01:00
flip_on_short_edge : bool | None = Field (
None , description = "Flip back sides for short-edge duplex printing (default is long-edge)"
)
2026-05-14 19:30:39 +01:00
gutter_size : float = Field ( 12 , description = "Gutter margin size in points (used when addGutter is true)" )
pages_per_sheet : PagesPerSheet = Field (
2026-04-20 15:57:11 +01:00
PagesPerSheet . number_2 ,
description = "The number of pages per side for booklet printing (always 2 for proper booklet)." ,
)
2026-05-14 19:30:39 +01:00
spine_location : SpineLocation = Field ( SpineLocation . left , description = "The spine location for the booklet." )
2026-04-20 15:57:11 +01:00
class CbrToPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
optimize_for_ebook : bool = Field ( False , description = "Optimize the output PDF for ebook reading using Ghostscript" )
2026-04-20 15:57:11 +01:00
class CbzToPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
optimize_for_ebook : bool = Field ( False , description = "Optimize the output PDF for ebook reading using Ghostscript" )
2026-04-20 15:57:11 +01:00
class CertType ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The type of the digital certificate
"""
2026-04-20 15:57:11 +01:00
pem = "PEM"
pkcs12 = "PKCS12"
pfx = "PFX"
jks = "JKS"
server = "SERVER"
2026-03-16 11:01:50 +00:00
class CertSignParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
cert_type : CertType = Field ( ... , description = "The type of the digital certificate" )
location : str = Field ( "SPDF" , description = "The location where the PDF is signed" )
name : str = Field ( "SPDF" , description = "The name of the signer" )
page_number : int = Field (
2026-04-20 15:57:11 +01:00
1 ,
description = "The page number where the signature should be visible. This is required if showSignature is set to true" ,
)
password : SecretStr | None = Field ( None , description = "The password for the keystore or the private key" )
2026-05-14 19:30:39 +01:00
reason : str = Field ( "Signed by SPDF" , description = "The reason for signing the PDF" )
show_logo : bool = Field ( True , description = "Whether to visually show a signature logo along with the signature" )
show_signature : bool = Field ( False , description = "Whether to visually show the signature in the PDF file" )
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class LineArtEdgeLevel ( IntEnum ):
2026-05-14 19:30:39 +01:00
"""
Edge detection strength to use for line art conversion (1-3). This maps to ImageMagick's -edge radius.
"""
2026-04-20 15:57:11 +01:00
integer_1 = 1
integer_2 = 2
integer_3 = 3
class OptimizeLevel ( IntEnum ):
2026-05-14 19:30:39 +01:00
"""
The level of optimization to apply to the PDF file. Higher values indicate greater compression but may reduce quality.
"""
2026-04-20 15:57:11 +01:00
integer_1 = 1
integer_2 = 2
integer_3 = 3
integer_4 = 4
integer_5 = 5
integer_6 = 6
integer_7 = 7
integer_8 = 8
integer_9 = 9
class CompressPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
expected_output_size : str = Field ( "25KB" , description = "The expected output size, e.g. '100MB', '25KB', etc." )
grayscale : bool = Field ( False , description = "Whether to convert the PDF to grayscale. Default is false." )
line_art : bool = Field (
2026-04-20 15:57:11 +01:00
False , description = "Whether to convert images to high-contrast line art using ImageMagick. Default is false."
)
2026-05-14 19:30:39 +01:00
line_art_edge_level : LineArtEdgeLevel = Field (
2026-04-20 15:57:11 +01:00
LineArtEdgeLevel . integer_1 ,
description = "Edge detection strength to use for line art conversion (1-3). This maps to ImageMagick's -edge radius." ,
)
2026-05-14 19:30:39 +01:00
line_art_threshold : float = Field ( 55 , description = "Threshold to use for line art conversion (0-100)." )
linearize : bool = Field ( False , description = "Whether to linearize the PDF for faster web viewing. Default is false." )
normalize : bool = Field (
2026-04-20 15:57:11 +01:00
False , description = "Whether to normalize the PDF content for better compatibility. Default is false."
)
2026-05-14 19:30:39 +01:00
optimize_level : OptimizeLevel = Field (
... ,
2026-04-20 15:57:11 +01:00
description = "The level of optimization to apply to the PDF file. Higher values indicate greater compression but may reduce quality." ,
)
2026-03-16 11:01:50 +00:00
class CropParams ( ApiModel ):
2026-04-20 15:57:11 +01:00
auto_crop : bool | None = Field ( None , description = "Enable auto-crop to detect and remove white space" )
height : float | None = Field ( None , description = "The height of the crop area" )
remove_data_outside_crop : bool | None = Field (
None , description = "Whether to remove text outside the crop area (keeps images)"
)
width : float | None = Field ( None , description = "The width of the crop area" )
x : float | None = Field ( None , description = "The x-coordinate of the top-left corner of the crop area" )
y : float | None = Field ( None , description = "The y-coordinate of the top-left corner of the crop area" )
class DeleteAttachmentParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
attachment_name : str = Field ( ... , description = "The name of the attachment to delete" )
2026-04-20 15:57:11 +01:00
class EmbedAllFonts ( Enum ):
2026-05-14 19:30:39 +01:00
"""
Embed all fonts from the eBook into the generated PDF
"""
2026-04-20 15:57:11 +01:00
boolean_true = True
boolean_false = False
class IncludePageNumbers ( Enum ):
2026-05-14 19:30:39 +01:00
"""
Add page numbers to the generated PDF
"""
2026-04-20 15:57:11 +01:00
boolean_true = True
boolean_false = False
class IncludeTableOfContents ( Enum ):
2026-05-14 19:30:39 +01:00
"""
Add a generated table of contents to the resulting PDF
"""
2026-04-20 15:57:11 +01:00
boolean_true = True
boolean_false = False
class OptimizeForEbook ( Enum ):
2026-05-14 19:30:39 +01:00
"""
Optimize the PDF for eBook reading (smaller file size, better rendering on eInk devices)
"""
2026-04-20 15:57:11 +01:00
boolean_true = True
boolean_false = False
class EbookToPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
embed_all_fonts : EmbedAllFonts = Field (
2026-04-20 15:57:11 +01:00
EmbedAllFonts . boolean_false , description = "Embed all fonts from the eBook into the generated PDF"
)
2026-05-14 19:30:39 +01:00
include_page_numbers : IncludePageNumbers = Field (
2026-04-20 15:57:11 +01:00
IncludePageNumbers . boolean_false , description = "Add page numbers to the generated PDF"
)
2026-05-14 19:30:39 +01:00
include_table_of_contents : IncludeTableOfContents = Field (
2026-04-20 15:57:11 +01:00
IncludeTableOfContents . boolean_false , description = "Add a generated table of contents to the resulting PDF"
)
2026-05-14 19:30:39 +01:00
optimize_for_ebook : OptimizeForEbook = Field (
2026-04-20 15:57:11 +01:00
OptimizeForEbook . boolean_false ,
description = "Optimize the PDF for eBook reading (smaller file size, better rendering on eInk devices)" ,
)
2026-03-16 11:01:50 +00:00
class EditTableOfContentsParams ( ApiModel ):
2026-04-20 15:57:11 +01:00
bookmark_data : str | None = Field (
None ,
description = "Bookmark structure in JSON format" ,
examples = [
'[{ \\ "title \\ ": \\ "Chapter 1 \\ ", \\ "pageNumber \\ ":1, \\ "children \\ ":[{ \\ "title \\ ": \\ "Section 1.1 \\ ", \\ "pageNumber \\ ":2}]}]'
],
)
replace_existing : bool | None = Field (
None , description = "Whether to replace existing bookmarks or append to them" , examples = [ True ]
)
2026-03-16 11:01:50 +00:00
2026-05-11 10:57:41 +01:00
class EditTextOperation ( ApiModel ):
2026-05-14 19:30:39 +01:00
"""
Ordered list of find/replace operations. Each replaces every occurrence on the selected pages, in order; later operations see the result of earlier ones (so 'foo'->'foos' then 'foos'->'bars' turns 'foo' into 'bars').
"""
2026-05-11 10:57:41 +01:00
find : str = Field ( ... , description = "The literal text to find." )
replace : str = Field ( ... , description = "The replacement text. May be empty to delete the matched text." )
class EditTextParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
edits : list [ EditTextOperation ] = Field (
... ,
2026-05-11 10:57:41 +01:00
description = "Ordered list of find/replace operations. Each replaces every occurrence on the selected pages, in order; later operations see the result of earlier ones (so 'foo'->'foos' then 'foos'->'bars' turns 'foo' into 'bars')." ,
)
2026-05-14 19:30:39 +01:00
page_numbers : str = Field (
2026-05-11 10:57:41 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
2026-05-14 19:30:39 +01:00
whole_word_search : bool = Field (
2026-05-11 10:57:41 +01:00
False , description = "Whether matches must be whole words (boundaries determined by non-word characters)"
)
2026-04-20 15:57:11 +01:00
class EmlToPdfParams ( ApiModel ):
download_html : bool | None = Field (
None , description = "Download HTML intermediate file instead of PDF" , examples = [ False ]
)
include_all_recipients : bool | None = Field (
None , description = "Include CC and BCC recipients in header (if available)" , examples = [ True ]
)
include_attachments : bool | None = Field (
None , description = "Include email attachments in the PDF output" , examples = [ False ]
)
max_attachment_size_mb : int | None = Field (
None ,
description = "Maximum attachment size in MB to include (default 10MB, range: 1-100)" ,
examples = [ 10 ],
ge = 1 ,
le = 100 ,
)
class ExtractImageScansParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
angle_threshold : int = Field ( 5 , description = "The angle threshold for the image scan extraction" )
border_size : int = Field ( 1 , description = "The border size for the image scan extraction" )
min_area : int = Field ( 8000 , description = "The minimum area for the image scan extraction" )
min_contour_area : int = Field ( 500 , description = "The minimum contour area for the image scan extraction" )
tolerance : int = Field ( 20 , description = "The tolerance for the image scan extraction" )
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class Format ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The output image format e.g., 'png', 'jpeg', or 'gif'
"""
2026-04-20 15:57:11 +01:00
png = "png"
jpeg = "jpeg"
gif = "gif"
class ExtractImagesParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
format : Format = Field ( Format . png , description = "The output image format e.g., 'png', 'jpeg', or 'gif'" )
2026-03-16 11:01:50 +00:00
class FlattenParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
flatten_only_forms : bool = Field (
2026-04-20 15:57:11 +01:00
False , description = "True to flatten only the forms, false to flatten full PDF (Convert page to image)"
)
render_dpi : int | None = Field (
None , description = "Optional DPI for page rendering when flattening the full document." , ge = 72
)
class HtmlToPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
zoom : float = Field ( 1 , description = "Zoom level for displaying the website. Default is '1'." )
2026-04-20 15:57:11 +01:00
class ColorType ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The color type of the output image(s)
"""
2026-04-20 15:57:11 +01:00
color = "color"
greyscale = "greyscale"
blackwhite = "blackwhite"
class FitOption ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Option to determine how the image will fit onto the page
"""
2026-04-20 15:57:11 +01:00
fill_page = "fillPage"
fit_document_to_image = "fitDocumentToImage"
maintain_aspect_ratio = "maintainAspectRatio"
class ImgToPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
auto_rotate : bool = Field (
2026-04-20 15:57:11 +01:00
False , description = "Whether to automatically rotate the images to better fit the PDF page"
)
2026-05-14 19:30:39 +01:00
color_type : ColorType = Field ( ColorType . color , description = "The color type of the output image(s)" )
fit_option : FitOption = Field (
2026-04-20 15:57:11 +01:00
FitOption . fill_page , description = "Option to determine how the image will fit onto the page"
)
class SortType ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The type of sorting to be applied on the input files before merging.
"""
2026-04-20 15:57:11 +01:00
order_provided = "orderProvided"
by_file_name = "byFileName"
by_date_modified = "byDateModified"
by_date_created = "byDateCreated"
by_pdf_title = "byPDFTitle"
class MergePdfsParams ( ApiModel ):
client_file_ids : str | None = Field (
None , description = "JSON array of client-provided IDs for each uploaded file (same order as fileInput)"
)
2026-05-01 10:19:38 +01:00
file_order : str | None = None
2026-05-14 19:30:39 +01:00
generate_toc : bool = Field (
2026-04-20 15:57:11 +01:00
False ,
description = "Flag indicating whether to generate a table of contents for the merged PDF. If true, a table of contents will be created using the input filenames as chapter names." ,
)
2026-05-14 19:30:39 +01:00
remove_cert_sign : bool = Field (
2026-04-20 15:57:11 +01:00
True ,
description = "Flag indicating whether to remove certification signatures from the merged PDF. If true, all certification signatures will be removed from the final merged document." ,
)
2026-05-14 19:30:39 +01:00
sort_type : SortType = Field (
2026-04-20 15:57:11 +01:00
SortType . order_provided , description = "The type of sorting to be applied on the input files before merging."
)
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class Arrangement ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The arrangement of pages on the sheet: BY_ROWS fills pages row by row, while BY_COLUMNS fills pages column by column.
"""
2026-04-20 15:57:11 +01:00
by_rows = "BY_ROWS"
by_columns = "BY_COLUMNS"
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class Mode ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Input mode: DEFAULT uses pagesPerSheet; CUSTOM uses explicit cols x rows.
"""
2026-04-20 15:57:11 +01:00
default = "DEFAULT"
custom = "CUSTOM"
class Orientation ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The orientation of the output PDF pages
"""
2026-04-20 15:57:11 +01:00
portrait = "PORTRAIT"
landscape = "LANDSCAPE"
class PagesPerSheet1 ( IntEnum ):
2026-05-14 19:30:39 +01:00
"""
The number of pages to fit onto a single sheet in the output PDF.
"""
2026-04-20 15:57:11 +01:00
integer_2 = 2
integer_4 = 4
integer_9 = 9
integer_16 = 16
class ReadingDirection ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The direction in which pages are arranged on the sheet: LTR (left-to-right) or RTL (right-to-left).
"""
2026-04-20 15:57:11 +01:00
ltr = "LTR"
rtl = "RTL"
class MultiPageLayoutParams ( ApiModel ):
add_border : bool | None = Field ( None , description = "Boolean for if you wish to add border around the pages" )
2026-05-14 19:30:39 +01:00
arrangement : Arrangement = Field (
2026-04-20 15:57:11 +01:00
Arrangement . by_rows ,
description = "The arrangement of pages on the sheet: BY_ROWS fills pages row by row, while BY_COLUMNS fills pages column by column." ,
)
2026-05-14 19:30:39 +01:00
border_width : float = Field (
2026-04-20 15:57:11 +01:00
1 , description = "Border width (in points) to apply around each page when merging" , examples = [ 2 ], ge = 0.0
)
2026-05-14 19:30:39 +01:00
bottom_margin : float = Field (
2026-04-20 15:57:11 +01:00
0 , description = "Bottom margin (in points) to apply to the output pages when merging" , examples = [ 200 ], ge = 0.0
)
2026-05-14 19:30:39 +01:00
cols : float = Field ( 2 , description = "Number of columns" , examples = [ 2 ], ge = 1.0 , le = 300.0 )
inner_margin : float = Field (
2026-04-20 15:57:11 +01:00
0 , description = "Inner margin (in points) to apply around each page when merging" , examples = [ 200 ], ge = 0.0
)
2026-05-14 19:30:39 +01:00
left_margin : float = Field (
2026-04-20 15:57:11 +01:00
0 , description = "Left margin (in points) to apply to the output pages when merging" , examples = [ 200 ], ge = 0.0
)
2026-05-14 19:30:39 +01:00
mode : Mode = Field (
2026-04-20 15:57:11 +01:00
Mode . default , description = "Input mode: DEFAULT uses pagesPerSheet; CUSTOM uses explicit cols x rows."
)
2026-05-14 19:30:39 +01:00
orientation : Orientation = Field ( Orientation . portrait , description = "The orientation of the output PDF pages" )
2026-04-20 15:57:11 +01:00
pages_per_sheet : PagesPerSheet1 | None = Field (
None , description = "The number of pages to fit onto a single sheet in the output PDF."
)
2026-05-14 19:30:39 +01:00
reading_direction : ReadingDirection = Field (
2026-04-20 15:57:11 +01:00
ReadingDirection . ltr ,
description = "The direction in which pages are arranged on the sheet: LTR (left-to-right) or RTL (right-to-left)." ,
)
2026-05-14 19:30:39 +01:00
right_margin : float = Field (
2026-04-20 15:57:11 +01:00
0 , description = "Right margin (in points) to apply to the output pages when merging" , examples = [ 200 ], ge = 0.0
)
2026-05-14 19:30:39 +01:00
rows : float = Field ( 1 , description = "Number of rows" , examples = [ 3 ], ge = 1.0 , le = 300.0 )
top_margin : float = Field (
2026-04-20 15:57:11 +01:00
0 , description = "Top margin (in points) to apply to the output pages when merging" , examples = [ 200 ], ge = 0.0
)
class OcrRenderType ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Specify the OCR render type, either 'hocr' or 'sandwich'
"""
2026-04-20 15:57:11 +01:00
hocr = "hocr"
sandwich = "sandwich"
class OcrType ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Specify the OCR type, e.g., 'skip-text', 'force-ocr', or 'Normal'
"""
2026-04-20 15:57:11 +01:00
skip_text = "skip-text"
force_ocr = "force-ocr"
normal = "Normal"
class OcrPdfParams ( ApiModel ):
clean : bool | None = Field ( None , description = "Clean the input file if set to true" )
clean_final : bool | None = Field ( None , description = "Clean the final output if set to true" )
deskew : bool | None = Field ( None , description = "Deskew the input file if set to true" )
2026-05-14 19:30:39 +01:00
languages : list [ str ] = Field ([ "eng" ], description = "List of languages to use in OCR processing, e.g., 'eng', 'deu'" )
ocr_render_type : OcrRenderType = Field (
2026-04-20 15:57:11 +01:00
OcrRenderType . hocr , description = "Specify the OCR render type, either 'hocr' or 'sandwich'"
)
2026-05-14 19:30:39 +01:00
ocr_type : OcrType = Field ( ... , description = "Specify the OCR type, e.g., 'skip-text', 'force-ocr', or 'Normal'" )
2026-04-20 15:57:11 +01:00
remove_images_after : bool | None = Field ( None , description = "Remove images from the output PDF if set to true" )
sidecar : bool | None = Field ( None , description = "Include OCR text in a sidecar text file if set to true" )
class OverlayMode ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The mode of overlaying: 'SequentialOverlay' for sequential application, 'InterleavedOverlay' for round-robin application, 'FixedRepeatOverlay' for fixed repetition based on provided counts
"""
2026-04-20 15:57:11 +01:00
sequential_overlay = "SequentialOverlay"
interleaved_overlay = "InterleavedOverlay"
fixed_repeat_overlay = "FixedRepeatOverlay"
class OverlayPosition ( Enum ):
2026-05-14 19:30:39 +01:00
"""
Overlay position 0 is Foregound, 1 is Background
"""
2026-04-20 15:57:11 +01:00
number_0 = 0
number_1 = 1
2026-03-16 11:01:50 +00:00
class OverlayPdfsParams ( ApiModel ):
2026-04-20 15:57:11 +01:00
counts : list [ int ] | None = Field (
None ,
description = "An array of integers specifying the number of times each corresponding overlay file should be applied in the 'FixedRepeatOverlay' mode. This should match the length of the overlayFiles array." ,
)
2026-05-14 19:30:39 +01:00
overlay_files : list [ bytes ] = Field (
... ,
2026-04-20 15:57:11 +01:00
description = "An array of PDF files to be used as overlays on the base PDF. The order in these files is applied based on the selected mode." ,
)
2026-05-14 19:30:39 +01:00
overlay_mode : OverlayMode = Field (
... ,
2026-04-20 15:57:11 +01:00
description = "The mode of overlaying: 'SequentialOverlay' for sequential application, 'InterleavedOverlay' for round-robin application, 'FixedRepeatOverlay' for fixed repetition based on provided counts" ,
)
2026-05-14 19:30:39 +01:00
overlay_position : OverlayPosition = Field ( ... , description = "Overlay position 0 is Foregound, 1 is Background" )
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class PdfToCbrParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
dpi : int = Field ( ... , description = "The DPI (Dots Per Inch) for rendering PDF pages as images" , examples = [ 150 ])
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class PdfToCbzParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
dpi : int = Field ( ... , description = "The DPI (Dots Per Inch) for rendering PDF pages as images" , examples = [ 150 ])
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class PdfToCsvParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class DetectChapters ( Enum ):
2026-05-14 19:30:39 +01:00
"""
Detect headings that look like chapters and insert EPUB page breaks.
"""
2026-04-20 15:57:11 +01:00
boolean_true = True
boolean_false = False
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class OutputFormat ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Choose the output format for the ebook.
"""
2026-04-20 15:57:11 +01:00
epub = "EPUB"
azw3 = "AZW3"
epub_1 = "EPUB"
azw3_1 = "AZW3"
class TargetDevice ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Choose an output profile optimized for the reader device.
"""
2026-04-20 15:57:11 +01:00
tablet_phone_images = "TABLET_PHONE_IMAGES"
kindle_eink_text = "KINDLE_EINK_TEXT"
tablet_phone_images_1 = "TABLET_PHONE_IMAGES"
kindle_eink_text_1 = "KINDLE_EINK_TEXT"
class PdfToEpubParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
detect_chapters : DetectChapters = Field (
2026-04-20 15:57:11 +01:00
DetectChapters . boolean_true , description = "Detect headings that look like chapters and insert EPUB page breaks."
)
2026-05-14 19:30:39 +01:00
output_format : OutputFormat = Field ( OutputFormat . epub , description = "Choose the output format for the ebook." )
target_device : TargetDevice = Field (
2026-04-20 15:57:11 +01:00
TargetDevice . tablet_phone_images , description = "Choose an output profile optimized for the reader device."
)
class ImageFormat ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The output image format
"""
2026-04-20 15:57:11 +01:00
png = "png"
jpeg = "jpeg"
jpg = "jpg"
gif = "gif"
webp = "webp"
class SingleOrMultiple ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Choose between a single image containing all pages or separate images for each page
"""
2026-04-20 15:57:11 +01:00
single = "single"
multiple = "multiple"
class PdfToImgParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
color_type : ColorType = Field ( ColorType . color , description = "The color type of the output image(s)" )
dpi : int = Field ( 300 , description = "The DPI (dots per inch) for the output image(s)" )
image_format : ImageFormat = Field ( ImageFormat . png , description = "The output image format" )
include_annotations : bool = Field ( False , description = "Include annotations such as comments in the output image(s)" )
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
2026-05-14 19:30:39 +01:00
single_or_multiple : SingleOrMultiple = Field (
2026-04-20 15:57:11 +01:00
SingleOrMultiple . multiple ,
description = "Choose between a single image containing all pages or separate images for each page" ,
)
class OutputFormat1 ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The output format type (PDF/A or PDF/X)
"""
2026-04-20 15:57:11 +01:00
pdfa = "pdfa"
pdfa_1 = "pdfa-1"
pdfa_2 = "pdfa-2"
pdfa_2b = "pdfa-2b"
pdfa_3 = "pdfa-3"
pdfa_3b = "pdfa-3b"
pdfx = "pdfx"
class PdfToPdfaParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
output_format : OutputFormat1 = Field ( ... , description = "The output format type (PDF/A or PDF/X)" )
2026-04-20 15:57:11 +01:00
strict : bool | None = Field (
None , description = "If true, the conversion will fail if the output is not perfectly compliant"
)
class OutputFormat2 ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The output Presentation format
"""
2026-04-20 15:57:11 +01:00
ppt = "ppt"
pptx = "pptx"
odp = "odp"
class PdfToPresentationParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
output_format : OutputFormat2 = Field ( ... , description = "The output Presentation format" )
2026-03-16 11:01:50 +00:00
2026-05-01 10:19:38 +01:00
class PdfToTextEditorParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
"""
Either upload a file or provide a server-side file ID
"""
lightweight : bool = False
2026-05-01 10:19:38 +01:00
2026-04-20 15:57:11 +01:00
class OutputFormat3 ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The output Text or RTF format
"""
2026-04-20 15:57:11 +01:00
rtf = "rtf"
txt = "txt"
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class PdfToTextParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
output_format : OutputFormat3 = Field ( ... , description = "The output Text or RTF format" )
2026-04-20 15:57:11 +01:00
class OutputFormat4 ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Target vector format extension
"""
2026-04-20 15:57:11 +01:00
eps = "eps"
ps = "ps"
pcl = "pcl"
xps = "xps"
class Prepress ( Enum ):
2026-05-14 19:30:39 +01:00
"""
Apply Ghostscript prepress settings
"""
2026-04-20 15:57:11 +01:00
boolean_true = True
boolean_false = False
class PdfToVectorParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
output_format : OutputFormat4 = Field ( OutputFormat4 . eps , description = "Target vector format extension" )
prepress : Prepress = Field ( Prepress . boolean_false , description = "Apply Ghostscript prepress settings" )
2026-04-20 15:57:11 +01:00
class OutputFormat5 ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The output Word document format
"""
2026-04-20 15:57:11 +01:00
doc = "doc"
docx = "docx"
odt = "odt"
class PdfToWordParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
output_format : OutputFormat5 = Field ( ... , description = "The output Word document format" )
2026-04-20 15:57:11 +01:00
class PdfToXlsxParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
class CustomMode ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The custom mode for page rearrangement. Valid values are:
CUSTOM: Uses order defined in PageNums DUPLICATE: Duplicate pages n times (if Page order defined as 4, then duplicates each page 4 times)REVERSE_ORDER: Reverses the order of all pages.
DUPLEX_SORT: Sorts pages as if all fronts were scanned then all backs in reverse (1, n, 2, n-1, ...). BOOKLET_SORT: Arranges pages for booklet printing (last, first, second, second last, ...).
ODD_EVEN_SPLIT: Splits and arranges pages into odd and even numbered pages.
REMOVE_FIRST: Removes the first page.
REMOVE_LAST: Removes the last page.
REMOVE_FIRST_AND_LAST: Removes both the first and the last pages.
"""
2026-04-20 15:57:11 +01:00
custom = "CUSTOM"
reverse_order = "REVERSE_ORDER"
duplex_sort = "DUPLEX_SORT"
booklet_sort = "BOOKLET_SORT"
side_stitch_booklet_sort = "SIDE_STITCH_BOOKLET_SORT"
odd_even_split = "ODD_EVEN_SPLIT"
remove_first = "REMOVE_FIRST"
remove_last = "REMOVE_LAST"
remove_first_and_last = "REMOVE_FIRST_AND_LAST"
duplicate = "DUPLICATE"
class RearrangePagesParams ( ApiModel ):
custom_mode : CustomMode | None = Field (
None ,
description = "The custom mode for page rearrangement. Valid values are: \n CUSTOM: Uses order defined in PageNums DUPLICATE: Duplicate pages n times (if Page order defined as 4, then duplicates each page 4 times)REVERSE_ORDER: Reverses the order of all pages. \n DUPLEX_SORT: Sorts pages as if all fronts were scanned then all backs in reverse (1, n, 2, n-1, ...). BOOKLET_SORT: Arranges pages for booklet printing (last, first, second, second last, ...). \n ODD_EVEN_SPLIT: Splits and arranges pages into odd and even numbered pages. \n REMOVE_FIRST: Removes the first page. \n REMOVE_LAST: Removes the last page. \n REMOVE_FIRST_AND_LAST: Removes both the first and the last pages. \n " ,
)
2026-05-14 19:30:39 +01:00
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
2026-04-23 14:19:27 +01:00
class RedactionArea ( ApiModel ):
2026-05-14 19:30:39 +01:00
"""
A list of areas that should be redacted
"""
2026-04-23 14:19:27 +01:00
color : str | None = Field ( None , description = "The color used to redact the specified area." )
height : float | None = Field ( None , description = "The height of the area to be redacted." )
page : int | None = Field ( None , description = "The page on which the area should be redacted." )
width : float | None = Field ( None , description = "The width of the area to be redacted." )
x : float | None = Field ( None , description = "The left edge point of the area to be redacted." )
y : float | None = Field ( None , description = "The top edge point of the area to be redacted." )
2026-04-20 15:57:11 +01:00
class RemoveBlanksParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
threshold : int = Field ( 10 , description = "The threshold value to determine blank pages" , ge = 0 , le = 255 )
white_percent : float = Field (
2026-04-20 15:57:11 +01:00
99.9 , description = "The percentage of white color on a page to consider it as blank" , ge = 0.1 , le = 100.0
)
2026-03-16 11:01:50 +00:00
class RemovePagesParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
2026-03-16 11:01:50 +00:00
class RemovePasswordParams ( ApiModel ):
2026-04-20 15:57:11 +01:00
password : SecretStr | None = Field ( None , description = "The password of the PDF file" )
class RenameAttachmentParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
attachment_name : str = Field ( ... , description = "The current name of the attachment to rename" )
new_name : str = Field ( ... , description = "The new name for the attachment" )
2026-04-20 15:57:11 +01:00
class HighContrastColorCombination ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
If HIGH_CONTRAST_COLOR option selected, then pick the default color option for text and background.
"""
2026-04-20 15:57:11 +01:00
white_text_on_black = "WHITE_TEXT_ON_BLACK"
black_text_on_white = "BLACK_TEXT_ON_WHITE"
yellow_text_on_black = "YELLOW_TEXT_ON_BLACK"
green_text_on_black = "GREEN_TEXT_ON_BLACK"
white_text_on_black_1 = "WHITE_TEXT_ON_BLACK"
black_text_on_white_1 = "BLACK_TEXT_ON_WHITE"
yellow_text_on_black_1 = "YELLOW_TEXT_ON_BLACK"
green_text_on_black_1 = "GREEN_TEXT_ON_BLACK"
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class ReplaceAndInvertOption ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Replace and Invert color options of a pdf.
"""
2026-04-20 15:57:11 +01:00
high_contrast_color = "HIGH_CONTRAST_COLOR"
custom_color = "CUSTOM_COLOR"
full_inversion = "FULL_INVERSION"
color_space_conversion = "COLOR_SPACE_CONVERSION"
high_contrast_color_1 = "HIGH_CONTRAST_COLOR"
custom_color_1 = "CUSTOM_COLOR"
full_inversion_1 = "FULL_INVERSION"
color_space_conversion_1 = "COLOR_SPACE_CONVERSION"
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class ReplaceInvertPdfParams ( ApiModel ):
back_ground_color : str | None = Field (
None ,
description = "If CUSTOM_COLOR option selected, then pick the custom color for background. Expected color value should be 24bit decimal value of a color" ,
)
2026-05-14 19:30:39 +01:00
high_contrast_color_combination : HighContrastColorCombination = Field (
2026-04-20 15:57:11 +01:00
HighContrastColorCombination . white_text_on_black ,
description = "If HIGH_CONTRAST_COLOR option selected, then pick the default color option for text and background." ,
)
2026-05-14 19:30:39 +01:00
replace_and_invert_option : ReplaceAndInvertOption = Field (
2026-04-20 15:57:11 +01:00
ReplaceAndInvertOption . high_contrast_color , description = "Replace and Invert color options of a pdf."
)
text_color : str | None = Field (
None ,
description = "If CUSTOM_COLOR option selected, then pick the custom color for text. Expected color value should be 24bit decimal value of a color" ,
)
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class Angle ( IntEnum ):
2026-05-14 19:30:39 +01:00
"""
The clockwise angle by which to rotate all pages in the PDF file. Must be a multiple of 90.
"""
2026-04-20 15:57:11 +01:00
integer_0 = 0
integer_90 = 90
integer_180 = 180
integer_270 = 270
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class RotatePdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
angle : Angle = Field (
... , description = "The clockwise angle by which to rotate all pages in the PDF file. Must be a multiple of 90."
2026-04-20 15:57:11 +01:00
)
2026-03-16 11:01:50 +00:00
2026-04-20 15:57:11 +01:00
class SanitizePdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
remove_embedded_files : bool = Field ( True , description = "Remove embedded files from the PDF" )
remove_fonts : bool = Field ( False , description = "Remove fonts from the PDF" )
remove_java_script : bool = Field ( True , description = "Remove JavaScript actions from the PDF" )
remove_links : bool = Field ( False , description = "Remove links from the PDF" )
remove_metadata : bool = Field ( False , description = "Remove document info metadata from the PDF" )
remove_xmp_metadata : bool = Field ( False , description = "Remove XMP metadata from the PDF" )
2026-04-20 15:57:11 +01:00
2026-05-28 15:16:15 +01:00
class Orientation1 ( StrEnum ):
"""
Orientation to apply to the target page size. Ignored when pageSize is KEEP.
"""
portrait = "PORTRAIT"
landscape = "LANDSCAPE"
2026-04-20 15:57:11 +01:00
class PageSize ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The scale of pages in the output PDF. Acceptable values are A0-A6, LETTER, LEGAL, KEEP.
"""
2026-04-20 15:57:11 +01:00
a0 = "A0"
a1 = "A1"
a2 = "A2"
a3 = "A3"
a4 = "A4"
a5 = "A5"
a6 = "A6"
letter = "LETTER"
legal = "LEGAL"
keep = "KEEP"
2026-03-16 11:01:50 +00:00
class ScalePagesParams ( ApiModel ):
2026-05-28 15:16:15 +01:00
orientation : Orientation1 = Field (
Orientation1 . portrait ,
description = "Orientation to apply to the target page size. Ignored when pageSize is KEEP." ,
)
2026-05-14 19:30:39 +01:00
page_size : PageSize = Field (
... , description = "The scale of pages in the output PDF. Acceptable values are A0-A6, LETTER, LEGAL, KEEP."
2026-04-20 15:57:11 +01:00
)
2026-05-14 19:30:39 +01:00
scale_factor : float = Field (
2026-04-20 15:57:11 +01:00
1 , description = "The scale of the content on the pages of the output PDF. Acceptable values are floats." , ge = 0.0
)
class Colorspace ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Colorspace for output image
"""
2026-04-20 15:57:11 +01:00
grayscale = "grayscale"
color = "color"
class Quality ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Scan quality preset
"""
2026-04-20 15:57:11 +01:00
low = "low"
medium = "medium"
high = "high"
class Rotation ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Rotation preset
"""
2026-04-20 15:57:11 +01:00
none = "none"
slight = "slight"
moderate = "moderate"
severe = "severe"
class ScannerEffectParams ( ApiModel ):
advanced_enabled : bool | None = Field ( None , description = "Whether advanced settings are enabled" , examples = [ False ])
blur : float | None = Field ( None , description = "Blur amount (0 = none, higher = more blur)" , examples = [ 1.0 ])
border : int | None = Field ( None , description = "Border thickness in pixels" , examples = [ 20 ])
brightness : float | None = Field ( None , description = "Brightness multiplier (1.0 = no change)" , examples = [ 1.0 ])
colorspace : Colorspace | None = Field ( None , description = "Colorspace for output image" , examples = [ "grayscale" ])
contrast : float | None = Field ( None , description = "Contrast multiplier (1.0 = no change)" , examples = [ 1.0 ])
noise : float | None = Field ( None , description = "Noise amount (0 = none, higher = more noise)" , examples = [ 8.0 ])
2026-05-14 19:30:39 +01:00
quality : Quality = Field ( ... , description = "Scan quality preset" , examples = [ "high" ])
2026-04-20 15:57:11 +01:00
resolution : int | None = Field ( None , description = "Rendering resolution in DPI" , examples = [ 300 ])
rotate : int | None = Field ( None , description = "Base rotation in degrees" , examples = [ 0 ])
rotate_variance : int | None = Field ( None , description = "Random rotation variance in degrees" , examples = [ 2 ])
2026-05-14 19:30:39 +01:00
rotation : Rotation = Field ( ... , description = "Rotation preset" , examples = [ "none" ])
2026-04-20 15:57:11 +01:00
rotation_value : int | None = None
yellowish : bool | None = Field ( None , description = "Simulate yellowed paper" , examples = [ False ])
class WorkflowType ( StrEnum ):
signing = "SIGNING"
review = "REVIEW"
approval = "APPROVAL"
class Request ( ApiModel ):
document_name : str | None = None
due_date : str | None = None
message : str | None = None
owner_email : str | None = None
participant_emails : list [ str ] | None = None
participant_user_ids : list [ int ] | None = None
workflow_metadata : str | None = None
workflow_type : WorkflowType | None = None
class SessionsParams ( ApiModel ):
request : Request | None = None
class SplitBySizeOrCountParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
split_type : int = Field (
2026-04-20 15:57:11 +01:00
0 , description = "Determines the type of split: 0 for size, 1 for page count, 2 for document count"
)
2026-05-14 19:30:39 +01:00
split_value : str = Field (
2026-04-20 15:57:11 +01:00
"10MB" , description = "Value for split: size in MB (e.g., '10MB') or number of pages (e.g., '5')"
)
class PageSize1 ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Target page size for output chunks (e.g., 'A4', 'Letter', 'A3')
"""
2026-04-20 15:57:11 +01:00
a4 = "A4"
letter = "Letter"
a3 = "A3"
a5 = "A5"
legal = "Legal"
tabloid = "Tabloid"
class SplitForPosterPrintParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
page_size : PageSize1 = Field ( ... , description = "Target page size for output chunks (e.g., 'A4', 'Letter', 'A3')" )
right_to_left : bool = Field ( False , description = "Split right-to-left instead of left-to-right" )
2026-04-20 15:57:11 +01:00
xfactor : int | None = None
yfactor : int | None = None
class SplitPagesParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
2026-04-23 14:19:27 +01:00
description = 'Split points - page numbers after which the PDF will be cut. For example, `"2"` produces two documents (pages 1-2 and pages 3+); `"2,5"` produces three (pages 1-2, 3-5, 6+). Supports ranges (e.g. `"1,3,5-9"` splits after pages 1, 3, 5, 6, 7, 8, 9, yielding 8 documents), `"all"` (split after every page), or functions like `"2n+1"`, `"3n"`, `"6n-5"`.' ,
2026-04-20 15:57:11 +01:00
)
class SplitPdfByChaptersParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
allow_duplicates : bool = Field ( False , description = "Whether to allow duplicates or not" )
bookmark_level : int = Field ( 0 , description = "Maximum bookmark level required" , ge = 0 )
include_metadata : bool = Field ( False , description = "Whether to include Metadata or not" )
2026-04-20 15:57:11 +01:00
class SplitMode ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Modes for page split. Valid values are:
SPLIT_ALL_EXCEPT_FIRST_AND_LAST: Splits all except the first and the last pages.
SPLIT_ALL_EXCEPT_FIRST: Splits all except the first page.
SPLIT_ALL_EXCEPT_LAST: Splits all except the last page.
SPLIT_ALL: Splits all pages.
CUSTOM: Custom split.
"""
2026-04-20 15:57:11 +01:00
custom = "CUSTOM"
split_all_except_first_and_last = "SPLIT_ALL_EXCEPT_FIRST_AND_LAST"
split_all_except_first = "SPLIT_ALL_EXCEPT_FIRST"
split_all_except_last = "SPLIT_ALL_EXCEPT_LAST"
split_all = "SPLIT_ALL"
class SplitPdfBySectionsParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
horizontal_divisions : int = Field ( 0 , description = "Number of horizontal divisions for each PDF page" , ge = 0 , le = 50 )
merge : bool = Field ( False , description = "Merge the split documents into a single PDF" )
page_numbers : str = Field ( "SPLIT_ALL" , description = "Pages to be split by section" )
2026-04-20 15:57:11 +01:00
split_mode : SplitMode | None = Field (
None ,
description = "Modes for page split. Valid values are: \n SPLIT_ALL_EXCEPT_FIRST_AND_LAST: Splits all except the first and the last pages. \n SPLIT_ALL_EXCEPT_FIRST: Splits all except the first page. \n SPLIT_ALL_EXCEPT_LAST: Splits all except the last page. \n SPLIT_ALL: Splits all pages. \n CUSTOM: Custom split. \n " ,
)
2026-05-14 19:30:39 +01:00
vertical_divisions : int = Field ( 1 , description = "Number of vertical divisions for each PDF page" , ge = 0 , le = 50 )
2026-04-20 15:57:11 +01:00
class SvgToPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
combine_into_single_pdf : bool = Field (
2026-04-20 15:57:11 +01:00
False ,
description = "Whether to combine all SVG files into a single PDF (each SVG as a separate page) or create separate PDF files for each SVG." ,
)
class TimestampPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
tsa_url : str = Field (
2026-04-20 15:57:11 +01:00
"http://timestamp.digicert.com" ,
description = "URL of the RFC 3161 Time Stamp Authority (TSA) server. Must be one of the built-in presets (DigiCert, Sectigo, SSL.com, FreeTSA, MeSign) or an admin-configured URL in settings.yml (security.timestamp.customTsaUrls). If omitted, the server default is used." ,
)
class Trapped ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
The trapped status of the document
"""
2026-04-20 15:57:11 +01:00
true = "True"
false = "False"
unknown = "Unknown"
class UpdateMetadataParams ( ApiModel ):
all_request_params : dict [ str , str ] | None = Field (
None ,
description = "Map list of key and value of custom parameters. Note these must start with customKey and customValue if they are non-standard" ,
)
2026-05-14 19:30:39 +01:00
author : str = Field ( "author" , description = "The author of the document" )
creation_date : str = Field (
2026-04-20 15:57:11 +01:00
"2023/10/01 12:00:00" ,
description = "The creation date of the document (format: yyyy/MM/dd HH:mm:ss)" ,
pattern = "yyyy/MM/dd HH:mm:ss" ,
)
2026-05-14 19:30:39 +01:00
creator : str = Field ( "creator" , description = "The creator of the document" )
delete_all : bool = Field ( False , description = "Delete all metadata if set to true" )
keywords : str = Field ( "keywords" , description = "The keywords for the document" )
modification_date : str = Field (
2026-04-20 15:57:11 +01:00
"2023/10/01 12:00:00" ,
description = "The modification date of the document (format: yyyy/MM/dd HH:mm:ss)" ,
pattern = "yyyy/MM/dd HH:mm:ss" ,
)
2026-05-14 19:30:39 +01:00
producer : str = Field ( "producer" , description = "The producer of the document" )
subject : str = Field ( "subject" , description = "The subject of the document" )
title : str = Field ( "title" , description = "The title of the document" )
trapped : Trapped = Field ( Trapped . false , description = "The trapped status of the document" )
2026-04-20 15:57:11 +01:00
class UrlToPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
url_input : str = Field ( ... , description = "The input URL to be converted to a PDF file" )
2026-04-20 15:57:11 +01:00
2026-05-01 10:19:38 +01:00
class ValidateCertificateParams ( ApiModel ):
cert_type : str | None = None
password : str | None = None
2026-04-20 15:57:11 +01:00
class OutputFormat6 ( StrEnum ):
2026-05-14 19:30:39 +01:00
"""
Target vector format extension
"""
2026-04-20 15:57:11 +01:00
eps = "eps"
ps = "ps"
pcl = "pcl"
xps = "xps"
class VectorToPdfParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
output_format : OutputFormat6 = Field ( OutputFormat6 . eps , description = "Target vector format extension" )
prepress : Prepress = Field ( Prepress . boolean_false , description = "Apply Ghostscript prepress settings" )
2026-04-20 15:57:11 +01:00
class RedactParams ( ApiModel ):
2026-05-14 19:30:39 +01:00
convert_pdf_to_image : bool = Field ( False , description = "Convert the redacted PDF to an image" )
page_numbers : str = Field (
2026-04-20 15:57:11 +01:00
"all" ,
description = "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')" ,
)
2026-05-14 19:30:39 +01:00
page_redaction_color : str = Field ( "#000000" , description = "The color used to fully redact certain pages" )
redactions : list [ RedactionArea ] = Field ( ... , description = "A list of areas that should be redacted" )
2026-04-20 15:57:11 +01:00
class Model (
RootModel [
CbrToPdfParams
| CbzToPdfParams
| EbookToPdfParams
| EmlToPdfParams
| HtmlToPdfParams
| ImgToPdfParams
| PdfToCbrParams
| PdfToCbzParams
| PdfToCsvParams
| PdfToEpubParams
| PdfToImgParams
| PdfToPdfaParams
| PdfToPresentationParams
| PdfToTextParams
2026-05-01 10:19:38 +01:00
| PdfToTextEditorParams
2026-04-20 15:57:11 +01:00
| PdfToVectorParams
| PdfToWordParams
| PdfToXlsxParams
| SvgToPdfParams
| UrlToPdfParams
| VectorToPdfParams
| BookletImpositionParams
| CropParams
| EditTableOfContentsParams
2026-05-11 10:57:41 +01:00
| EditTextParams
2026-04-20 15:57:11 +01:00
| MergePdfsParams
| MultiPageLayoutParams
| OverlayPdfsParams
| RearrangePagesParams
| RemovePagesParams
| RotatePdfParams
| ScalePagesParams
| SplitBySizeOrCountParams
| SplitForPosterPrintParams
| SplitPagesParams
| SplitPdfByChaptersParams
| SplitPdfBySectionsParams
| AddAttachmentsParams
2026-05-01 10:19:38 +01:00
| AddCommentsParams
2026-04-20 15:57:11 +01:00
| AddImageParams
| AddPageNumbersParams
| AddStampParams
| AutoRenameParams
| AutoSplitPdfParams
| CompressPdfParams
| DeleteAttachmentParams
| ExtractImageScansParams
| ExtractImagesParams
| FlattenParams
| OcrPdfParams
| RemoveBlanksParams
| RenameAttachmentParams
| ReplaceInvertPdfParams
| ScannerEffectParams
| UpdateMetadataParams
| AddPasswordParams
| AddWatermarkParams
| AutoRedactParams
| CertSignParams
| SessionsParams
2026-05-01 10:19:38 +01:00
| ValidateCertificateParams
2026-04-20 15:57:11 +01:00
| RedactParams
| RemovePasswordParams
| SanitizePdfParams
| TimestampPdfParams
]
):
root : (
CbrToPdfParams
| CbzToPdfParams
| EbookToPdfParams
| EmlToPdfParams
| HtmlToPdfParams
| ImgToPdfParams
| PdfToCbrParams
| PdfToCbzParams
| PdfToCsvParams
| PdfToEpubParams
| PdfToImgParams
| PdfToPdfaParams
| PdfToPresentationParams
| PdfToTextParams
2026-05-01 10:19:38 +01:00
| PdfToTextEditorParams
2026-04-20 15:57:11 +01:00
| PdfToVectorParams
| PdfToWordParams
| PdfToXlsxParams
| SvgToPdfParams
| UrlToPdfParams
| VectorToPdfParams
| BookletImpositionParams
| CropParams
| EditTableOfContentsParams
2026-05-11 10:57:41 +01:00
| EditTextParams
2026-04-20 15:57:11 +01:00
| MergePdfsParams
| MultiPageLayoutParams
| OverlayPdfsParams
| RearrangePagesParams
| RemovePagesParams
| RotatePdfParams
| ScalePagesParams
| SplitBySizeOrCountParams
| SplitForPosterPrintParams
| SplitPagesParams
| SplitPdfByChaptersParams
| SplitPdfBySectionsParams
| AddAttachmentsParams
2026-05-01 10:19:38 +01:00
| AddCommentsParams
2026-04-20 15:57:11 +01:00
| AddImageParams
| AddPageNumbersParams
| AddStampParams
| AutoRenameParams
| AutoSplitPdfParams
| CompressPdfParams
| DeleteAttachmentParams
| ExtractImageScansParams
| ExtractImagesParams
| FlattenParams
| OcrPdfParams
| RemoveBlanksParams
| RenameAttachmentParams
| ReplaceInvertPdfParams
| ScannerEffectParams
| UpdateMetadataParams
| AddPasswordParams
| AddWatermarkParams
| AutoRedactParams
| CertSignParams
| SessionsParams
2026-05-01 10:19:38 +01:00
| ValidateCertificateParams
2026-04-20 15:57:11 +01:00
| RedactParams
| RemovePasswordParams
| SanitizePdfParams
| TimestampPdfParams
)
2026-03-16 11:01:50 +00:00
type ParamToolModel = (
2026-04-20 15:57:11 +01:00
CbrToPdfParams
| CbzToPdfParams
| EbookToPdfParams
| EmlToPdfParams
| HtmlToPdfParams
| ImgToPdfParams
| PdfToCbrParams
| PdfToCbzParams
| PdfToCsvParams
| PdfToEpubParams
| PdfToImgParams
| PdfToPdfaParams
| PdfToPresentationParams
| PdfToTextParams
2026-05-01 10:19:38 +01:00
| PdfToTextEditorParams
2026-04-20 15:57:11 +01:00
| PdfToVectorParams
| PdfToWordParams
| PdfToXlsxParams
| SvgToPdfParams
| UrlToPdfParams
| VectorToPdfParams
2026-03-16 11:01:50 +00:00
| BookletImpositionParams
| CropParams
| EditTableOfContentsParams
2026-05-11 10:57:41 +01:00
| EditTextParams
2026-04-20 15:57:11 +01:00
| MergePdfsParams
| MultiPageLayoutParams
| OverlayPdfsParams
| RearrangePagesParams
| RemovePagesParams
| RotatePdfParams
| ScalePagesParams
| SplitBySizeOrCountParams
| SplitForPosterPrintParams
| SplitPagesParams
| SplitPdfByChaptersParams
| SplitPdfBySectionsParams
| AddAttachmentsParams
2026-05-01 10:19:38 +01:00
| AddCommentsParams
2026-04-20 15:57:11 +01:00
| AddImageParams
| AddPageNumbersParams
| AddStampParams
| AutoRenameParams
| AutoSplitPdfParams
| CompressPdfParams
| DeleteAttachmentParams
| ExtractImageScansParams
2026-03-16 11:01:50 +00:00
| ExtractImagesParams
| FlattenParams
2026-04-20 15:57:11 +01:00
| OcrPdfParams
2026-03-16 11:01:50 +00:00
| RemoveBlanksParams
2026-04-20 15:57:11 +01:00
| RenameAttachmentParams
| ReplaceInvertPdfParams
| ScannerEffectParams
| UpdateMetadataParams
| AddPasswordParams
| AddWatermarkParams
| AutoRedactParams
| CertSignParams
| SessionsParams
2026-05-01 10:19:38 +01:00
| ValidateCertificateParams
2026-04-20 15:57:11 +01:00
| RedactParams
2026-03-16 11:01:50 +00:00
| RemovePasswordParams
2026-04-20 15:57:11 +01:00
| SanitizePdfParams
| TimestampPdfParams
2026-03-16 11:01:50 +00:00
)
type ParamToolModelType = type [ ParamToolModel ]
2026-04-20 15:57:11 +01:00
class ToolEndpoint ( StrEnum ):
CBR_TO_PDF = "/api/v1/convert/cbr/pdf"
CBZ_TO_PDF = "/api/v1/convert/cbz/pdf"
EBOOK_TO_PDF = "/api/v1/convert/ebook/pdf"
EML_TO_PDF = "/api/v1/convert/eml/pdf"
HTML_TO_PDF = "/api/v1/convert/html/pdf"
IMG_TO_PDF = "/api/v1/convert/img/pdf"
PDF_TO_CBR = "/api/v1/convert/pdf/cbr"
PDF_TO_CBZ = "/api/v1/convert/pdf/cbz"
PDF_TO_CSV = "/api/v1/convert/pdf/csv"
PDF_TO_EPUB = "/api/v1/convert/pdf/epub"
PDF_TO_IMG = "/api/v1/convert/pdf/img"
PDF_TO_PDFA = "/api/v1/convert/pdf/pdfa"
PDF_TO_PRESENTATION = "/api/v1/convert/pdf/presentation"
PDF_TO_TEXT = "/api/v1/convert/pdf/text"
2026-05-01 10:19:38 +01:00
PDF_TO_TEXT_EDITOR = "/api/v1/convert/pdf/text-editor"
2026-04-20 15:57:11 +01:00
PDF_TO_VECTOR = "/api/v1/convert/pdf/vector"
PDF_TO_WORD = "/api/v1/convert/pdf/word"
PDF_TO_XLSX = "/api/v1/convert/pdf/xlsx"
SVG_TO_PDF = "/api/v1/convert/svg/pdf"
URL_TO_PDF = "/api/v1/convert/url/pdf"
VECTOR_TO_PDF = "/api/v1/convert/vector/pdf"
BOOKLET_IMPOSITION = "/api/v1/general/booklet-imposition"
CROP = "/api/v1/general/crop"
EDIT_TABLE_OF_CONTENTS = "/api/v1/general/edit-table-of-contents"
2026-05-11 10:57:41 +01:00
EDIT_TEXT = "/api/v1/general/edit-text"
2026-04-20 15:57:11 +01:00
MERGE_PDFS = "/api/v1/general/merge-pdfs"
MULTI_PAGE_LAYOUT = "/api/v1/general/multi-page-layout"
OVERLAY_PDFS = "/api/v1/general/overlay-pdfs"
REARRANGE_PAGES = "/api/v1/general/rearrange-pages"
REMOVE_PAGES = "/api/v1/general/remove-pages"
ROTATE_PDF = "/api/v1/general/rotate-pdf"
SCALE_PAGES = "/api/v1/general/scale-pages"
SPLIT_BY_SIZE_OR_COUNT = "/api/v1/general/split-by-size-or-count"
SPLIT_FOR_POSTER_PRINT = "/api/v1/general/split-for-poster-print"
SPLIT_PAGES = "/api/v1/general/split-pages"
SPLIT_PDF_BY_CHAPTERS = "/api/v1/general/split-pdf-by-chapters"
SPLIT_PDF_BY_SECTIONS = "/api/v1/general/split-pdf-by-sections"
ADD_ATTACHMENTS = "/api/v1/misc/add-attachments"
2026-05-01 10:19:38 +01:00
ADD_COMMENTS = "/api/v1/misc/add-comments"
2026-04-20 15:57:11 +01:00
ADD_IMAGE = "/api/v1/misc/add-image"
ADD_PAGE_NUMBERS = "/api/v1/misc/add-page-numbers"
ADD_STAMP = "/api/v1/misc/add-stamp"
AUTO_RENAME = "/api/v1/misc/auto-rename"
AUTO_SPLIT_PDF = "/api/v1/misc/auto-split-pdf"
COMPRESS_PDF = "/api/v1/misc/compress-pdf"
DELETE_ATTACHMENT = "/api/v1/misc/delete-attachment"
EXTRACT_IMAGE_SCANS = "/api/v1/misc/extract-image-scans"
EXTRACT_IMAGES = "/api/v1/misc/extract-images"
FLATTEN = "/api/v1/misc/flatten"
OCR_PDF = "/api/v1/misc/ocr-pdf"
REMOVE_BLANKS = "/api/v1/misc/remove-blanks"
RENAME_ATTACHMENT = "/api/v1/misc/rename-attachment"
REPLACE_INVERT_PDF = "/api/v1/misc/replace-invert-pdf"
SCANNER_EFFECT = "/api/v1/misc/scanner-effect"
UPDATE_METADATA = "/api/v1/misc/update-metadata"
ADD_PASSWORD = "/api/v1/security/add-password"
ADD_WATERMARK = "/api/v1/security/add-watermark"
AUTO_REDACT = "/api/v1/security/auto-redact"
CERT_SIGN = "/api/v1/security/cert-sign"
SESSIONS = "/api/v1/security/cert-sign/sessions"
2026-05-01 10:19:38 +01:00
VALIDATE_CERTIFICATE = "/api/v1/security/cert-sign/validate-certificate"
2026-04-20 15:57:11 +01:00
REDACT = "/api/v1/security/redact"
REMOVE_PASSWORD = "/api/v1/security/remove-password"
SANITIZE_PDF = "/api/v1/security/sanitize-pdf"
TIMESTAMP_PDF = "/api/v1/security/timestamp-pdf"
OPERATIONS : dict [ ToolEndpoint , ParamToolModelType ] = {
ToolEndpoint . CBR_TO_PDF : CbrToPdfParams ,
ToolEndpoint . CBZ_TO_PDF : CbzToPdfParams ,
ToolEndpoint . EBOOK_TO_PDF : EbookToPdfParams ,
ToolEndpoint . EML_TO_PDF : EmlToPdfParams ,
ToolEndpoint . HTML_TO_PDF : HtmlToPdfParams ,
ToolEndpoint . IMG_TO_PDF : ImgToPdfParams ,
ToolEndpoint . PDF_TO_CBR : PdfToCbrParams ,
ToolEndpoint . PDF_TO_CBZ : PdfToCbzParams ,
ToolEndpoint . PDF_TO_CSV : PdfToCsvParams ,
ToolEndpoint . PDF_TO_EPUB : PdfToEpubParams ,
ToolEndpoint . PDF_TO_IMG : PdfToImgParams ,
ToolEndpoint . PDF_TO_PDFA : PdfToPdfaParams ,
ToolEndpoint . PDF_TO_PRESENTATION : PdfToPresentationParams ,
ToolEndpoint . PDF_TO_TEXT : PdfToTextParams ,
2026-05-01 10:19:38 +01:00
ToolEndpoint . PDF_TO_TEXT_EDITOR : PdfToTextEditorParams ,
2026-04-20 15:57:11 +01:00
ToolEndpoint . PDF_TO_VECTOR : PdfToVectorParams ,
ToolEndpoint . PDF_TO_WORD : PdfToWordParams ,
ToolEndpoint . PDF_TO_XLSX : PdfToXlsxParams ,
ToolEndpoint . SVG_TO_PDF : SvgToPdfParams ,
ToolEndpoint . URL_TO_PDF : UrlToPdfParams ,
ToolEndpoint . VECTOR_TO_PDF : VectorToPdfParams ,
ToolEndpoint . BOOKLET_IMPOSITION : BookletImpositionParams ,
ToolEndpoint . CROP : CropParams ,
ToolEndpoint . EDIT_TABLE_OF_CONTENTS : EditTableOfContentsParams ,
2026-05-11 10:57:41 +01:00
ToolEndpoint . EDIT_TEXT : EditTextParams ,
2026-04-20 15:57:11 +01:00
ToolEndpoint . MERGE_PDFS : MergePdfsParams ,
ToolEndpoint . MULTI_PAGE_LAYOUT : MultiPageLayoutParams ,
ToolEndpoint . OVERLAY_PDFS : OverlayPdfsParams ,
ToolEndpoint . REARRANGE_PAGES : RearrangePagesParams ,
ToolEndpoint . REMOVE_PAGES : RemovePagesParams ,
ToolEndpoint . ROTATE_PDF : RotatePdfParams ,
ToolEndpoint . SCALE_PAGES : ScalePagesParams ,
ToolEndpoint . SPLIT_BY_SIZE_OR_COUNT : SplitBySizeOrCountParams ,
ToolEndpoint . SPLIT_FOR_POSTER_PRINT : SplitForPosterPrintParams ,
ToolEndpoint . SPLIT_PAGES : SplitPagesParams ,
ToolEndpoint . SPLIT_PDF_BY_CHAPTERS : SplitPdfByChaptersParams ,
ToolEndpoint . SPLIT_PDF_BY_SECTIONS : SplitPdfBySectionsParams ,
ToolEndpoint . ADD_ATTACHMENTS : AddAttachmentsParams ,
2026-05-01 10:19:38 +01:00
ToolEndpoint . ADD_COMMENTS : AddCommentsParams ,
2026-04-20 15:57:11 +01:00
ToolEndpoint . ADD_IMAGE : AddImageParams ,
ToolEndpoint . ADD_PAGE_NUMBERS : AddPageNumbersParams ,
ToolEndpoint . ADD_STAMP : AddStampParams ,
ToolEndpoint . AUTO_RENAME : AutoRenameParams ,
ToolEndpoint . AUTO_SPLIT_PDF : AutoSplitPdfParams ,
ToolEndpoint . COMPRESS_PDF : CompressPdfParams ,
ToolEndpoint . DELETE_ATTACHMENT : DeleteAttachmentParams ,
ToolEndpoint . EXTRACT_IMAGE_SCANS : ExtractImageScansParams ,
ToolEndpoint . EXTRACT_IMAGES : ExtractImagesParams ,
ToolEndpoint . FLATTEN : FlattenParams ,
ToolEndpoint . OCR_PDF : OcrPdfParams ,
ToolEndpoint . REMOVE_BLANKS : RemoveBlanksParams ,
ToolEndpoint . RENAME_ATTACHMENT : RenameAttachmentParams ,
ToolEndpoint . REPLACE_INVERT_PDF : ReplaceInvertPdfParams ,
ToolEndpoint . SCANNER_EFFECT : ScannerEffectParams ,
ToolEndpoint . UPDATE_METADATA : UpdateMetadataParams ,
ToolEndpoint . ADD_PASSWORD : AddPasswordParams ,
ToolEndpoint . ADD_WATERMARK : AddWatermarkParams ,
ToolEndpoint . AUTO_REDACT : AutoRedactParams ,
ToolEndpoint . CERT_SIGN : CertSignParams ,
ToolEndpoint . SESSIONS : SessionsParams ,
2026-05-01 10:19:38 +01:00
ToolEndpoint . VALIDATE_CERTIFICATE : ValidateCertificateParams ,
2026-04-20 15:57:11 +01:00
ToolEndpoint . REDACT : RedactParams ,
ToolEndpoint . REMOVE_PASSWORD : RemovePasswordParams ,
ToolEndpoint . SANITIZE_PDF : SanitizePdfParams ,
ToolEndpoint . TIMESTAMP_PDF : TimestampPdfParams ,
2026-03-16 11:01:50 +00:00
}