### Split PDF by Chapters using Java SDK Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index This Java SDK example demonstrates how to split a PDF file into chapters. It utilizes the Stirling SDK and requires a file ID for server-side files. The operation can result in a successful split (returning a PDF or ZIP) or various error codes. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.SplitPdfByChaptersRequest; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.SplitPdf1Response; public class Application { public static void main(String[] args) throws SplitPdf1BadRequestException, SplitPdf1RequestEntityTooLargeException, SplitPdf1UnprocessableEntityException, SplitPdf1InternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); SplitPdfByChaptersRequest req = SplitPdfByChaptersRequest.builder() .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); SplitPdf1Response res = sdk.general().splitPdf1() .request(req) .call(); } } ``` -------------------------------- ### Split PDF by Size or Count using Java SDK Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Demonstrates how to use the Stirling PDF SDK for Java to split a PDF file based on size or page count. It shows the setup of the SDK client and the creation of a request object with a file ID. This method is suitable for server-side processing where the file is already stored. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.SplitPdfBySizeOrCountRequest; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.AutoSplitPdf1Response; public class Application { public static void main(String[] args) throws AutoSplitPdf1BadRequestException, AutoSplitPdf1RequestEntityTooLargeException, AutoSplitPdf1UnprocessableEntityException, AutoSplitPdf1InternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); SplitPdfBySizeOrCountRequest req = SplitPdfBySizeOrCountRequest.builder() .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); AutoSplitPdf1Response res = sdk.general().autoSplitPdf1() .request(req) .call(); } } ``` -------------------------------- ### Split PDF by Page Numbers using Java SDK Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index This Java SDK example shows how to split a PDF file into separate documents based on specified page numbers or ranges. It uses the Stirling SDK and allows for specifying pages via numbers, ranges, 'all', or mathematical functions. Similar to the chapter split, it returns success or error codes. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.PDFWithPageNums; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.SplitPdf2Response; public class Application { public static void main(String[] args) throws SplitPdf2BadRequestException, SplitPdf2RequestEntityTooLargeException, SplitPdf2UnprocessableEntityException, SplitPdf2InternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); PDFWithPageNums req = PDFWithPageNums.builder() .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); SplitPdf2Response res = sdk.general().splitPdf2() .request(req) .call(); } } ``` -------------------------------- ### Rearrange PDF Pages with File ID (Java SDK) Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Demonstrates how to rearrange pages in a PDF file using the Stirling PDF API's Java SDK. This example utilizes a file ID for server-side file referencing. It handles potential errors like bad requests, payload too large, unprocessable entities, and internal server errors. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.RearrangePagesRequest; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.RearrangePagesResponse; public class Application { public static void main(String[] args) throws RearrangePagesBadRequestException, RearrangePagesRequestEntityTooLargeException, RearrangePagesUnprocessableEntityException, RearrangePagesInternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); RearrangePagesRequest req = RearrangePagesRequest.builder() .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); RearrangePagesResponse res = sdk.general().rearrangePages() .request(req) .call(); } } ``` -------------------------------- ### Overlay PDF Files using Java SDK Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Demonstrates how to overlay PDF files using the Stirling PDF SDK in Java. It shows setting up the SDK client, preparing the overlay request with files, mode, and position, and making the API call. Handles various potential API errors. ```java package hello.world; import java.io.FileInputStream; import java.lang.Exception; import java.util.List; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.*; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.OverlayPdfsResponse; import org.openapis.openapi.utils.Utils; public class Application { public static void main(String[] args) throws OverlayPdfsBadRequestException, OverlayPdfsRequestEntityTooLargeException, OverlayPdfsUnprocessableEntityException, OverlayPdfsInternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); OverlayPdfsRequest req = OverlayPdfsRequest.builder() .overlayFiles(List.of( OverlayFile.builder() .fileName("example.file") .content(Utils.readBytesAndClose(new FileInputStream("example.file"))) .build())) .overlayMode(OverlayMode.SEQUENTIAL_OVERLAY) .overlayPosition(543.74) .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); OverlayPdfsResponse res = sdk.general().overlayPdfs() .request(req) .call(); } } ``` -------------------------------- ### Create Booklet Imposition using Java SDK Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index This Java code demonstrates how to use the Stirling PDF SDK to create a booklet with specified imposition settings. It configures the booklet type, page orientation, and pages per sheet, then sends the request to the API. Ensure the Stirling SDK is properly configured and dependencies are met. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.BookletImpositionRequest; import org.openapis.openapi.models.components.BookletImpositionRequestPagesPerSheet; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.CreateBookletImpositionResponse; public class Application { public static void main(String[] args) throws CreateBookletImpositionBadRequestException, CreateBookletImpositionRequestEntityTooLargeException, CreateBookletImpositionUnprocessableEntityException, CreateBookletImpositionInternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); BookletImpositionRequest req = BookletImpositionRequest.builder() .pagesPerSheet(BookletImpositionRequestPagesPerSheet.TWO) .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); CreateBookletImpositionResponse res = sdk.general().createBookletImposition() .request(req) .call(); } } ``` -------------------------------- ### Crop PDF Document using Java SDK Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Demonstrates how to crop a PDF document using the Stirling PDF API's Java SDK. This involves initializing the SDK, creating a CropPdfForm object with the file ID, and calling the cropPdf method. It handles potential exceptions like bad requests, payload too large, unprocessable entities, and internal server errors. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.CropPdfForm; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.CropPdfResponse; public class Application { public static void main(String[] args) throws CropPdfBadRequestException, CropPdfRequestEntityTooLargeException, CropPdfUnprocessableEntityException, CropPdfInternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); CropPdfForm req = CropPdfForm.builder() .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); CropPdfResponse res = sdk.general().cropPdf() .request(req) .call(); } } ``` -------------------------------- ### POST /api/v1/general/split-pdf-by-chapters Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Splits a PDF into chapters based on bookmark levels and returns a ZIP file. It supports options to allow duplicate chapters and include metadata. ```APIDOC ## POST /api/v1/general/split-pdf-by-chapters ### Description Splits a PDF into chapters and returns a ZIP file. This endpoint allows for controlling duplicate chapters and metadata inclusion. ### Method POST ### Endpoint /api/v1/general/split-pdf-by-chapters ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **allowDuplicates** (boolean) - Required - Whether to allow duplicates or not. Defaults to true. - **bookmarkLevel** (integer) - Required - Maximum bookmark level required. Defaults to 2. - **includeMetadata** (boolean) - Required - Whether to include Metadata or not. Defaults to true. - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput). - **fileInput** (string) - Optional - The PDF file to process. ### Request Example ```json { "fileId": "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr" } ``` ### Response #### Success Response (200) - **application/pdf** - Files processed successfully. Returns single file or ZIP archive containing multiple files. #### Error Responses - **400** (application/json) - Bad request - Invalid input parameters, unsupported format, or corrupted file. - **413** (application/json) - Payload too large - File exceeds maximum allowed size. - **422** (application/json) - Unprocessable entity - File is valid but cannot be processed. - **500** (application/json) - Internal server error - Unexpected error during processing. #### Response Example (200) ```json "string" ``` ``` -------------------------------- ### POST /api/v1/general/booklet-imposition Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Creates a booklet with proper page imposition, rearranging pages for booklet printing and arranging multiple pages on each sheet for folding and binding. ```APIDOC ## POST /api/v1/general/booklet-imposition ### Description Combines page reordering for booklet printing with multi-page layout. It rearranges pages in the correct order for booklet printing and places multiple pages on each sheet for proper folding and binding. ### Method POST ### Endpoint /api/v1/general/booklet-imposition ### Parameters #### Request Body - **bookletType** (string) - Required - Enum: "BOOKLET", "SIDE_STITCH_BOOKLET". The booklet type to create. - **pageOrientation** (string) - Required - Enum: "LANDSCAPE", "PORTRAIT". The page orientation for the output booklet sheets. - **pagesPerSheet** (integer) - Required - Enum: 2, 4. The number of pages to fit onto a single sheet in the output PDF. - **addBorder** (boolean) - Optional - Boolean for if you wish to add border around the pages. - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput). Example: a1b2c3d4-5678-90ab-cdef-ghijklmnopqr - **fileInput** (string) - Optional - The input PDF file. ### Request Example ```json { "bookletType": "BOOKLET", "pageOrientation": "LANDSCAPE", "pagesPerSheet": 4, "addBorder": true, "fileId": "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr" } ``` ### Response #### Success Response (200) - **application/pdf** - PDF processed successfully #### Error Responses - **400** (application/json) - Bad request - Invalid input parameters, unsupported format, or corrupted file - **413** (application/json) - Payload too large - File exceeds maximum allowed size - **422** (application/json) - Unprocessable entity - File is valid but cannot be processed - **500** (application/json) - Internal server error - Unexpected error during processing ``` -------------------------------- ### Scale PDF Page Size using Java SDK Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Scales the pages of an input PDF file to a specified size. Accepts page sizes like A0-A6, LETTER, LEGAL, or KEEP. Requires a file ID or file input. Returns a processed PDF or an error. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.PageSize; import org.openapis.openapi.models.components.ScalePagesRequest; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.ScalePagesResponse; public class Application { public static void main(String[] args) throws ScalePagesBadRequestException, ScalePagesRequestEntityTooLargeException, ScalePagesUnprocessableEntityException, ScalePagesInternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); ScalePagesRequest req = ScalePagesRequest.builder() .pageSize(PageSize.LEGAL) .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); ScalePagesResponse res = sdk.general().scalePages() .request(req) .call(); } } ``` -------------------------------- ### POST /api/v1/general/overlay-pdfs Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Overlay PDF files onto a base PDF with different modes: Sequential, Interleaved, or Fixed Repeat. Supports both file uploads and server-side file IDs. ```APIDOC ## POST /api/v1/general/overlay-pdfs ### Description Overlay PDF files onto a base PDF with different modes: Sequential, Interleaved, or Fixed Repeat. Input: PDF, Output: PDF. Type: MIMO. ### Method POST ### Endpoint /api/v1/general/overlay-pdfs ### Parameters #### Request Body - **overlayFiles** (array[string]) - Required - 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. - **overlayMode** (string, enum) - Required - The mode of overlaying: 'SequentialOverlay', 'InterleavedOverlay', or 'FixedRepeatOverlay'. - SequentialOverlay - InterleavedOverlay - FixedRepeatOverlay - **overlayPosition** (number, enum) - Required - Overlay position: 0 for Foreground, 1 for Background. - 0 - 1 - **counts** (array[integer]) - Optional - 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. - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput). - Example: a1b2c3d4-5678-90ab-cdef-ghijklmnopqr - **fileInput** (string) - Optional - Represents the input file content. ### Request Example ```json { "overlayFiles": [ { "fileName": "example.file", "content": "...file content..." } ], "overlayMode": "SequentialOverlay", "overlayPosition": 0, "counts": [1, 2], "fileId": "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr" } ``` ### Response #### Success Response (200) - **response** (application/pdf) - PDF processed successfully. #### Error Response (400) - **error** (application/json) - Bad request - Invalid input parameters, unsupported format, or corrupted file. #### Error Response (413) - **error** (application/json) - Payload too large - File exceeds maximum allowed size. #### Error Response (422) - **error** (application/json) - Unprocessable entity - File is valid but cannot be processed. #### Error Response (500) - **error** (application/json) - Internal server error - Unexpected error during processing. #### Response Example (200) ``` ...pdf content... ``` ``` -------------------------------- ### Convert PDF to Single Page using Java SDK Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Demonstrates how to use the Stirling PDF SDK for Java to convert a multi-page PDF into a single-page PDF. It utilizes a file ID for server-side file processing. The SDK handles request building and response parsing, including potential errors. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.PDFFile; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.PdfToSinglePageResponse; public class Application { public static void main(String[] args) throws PdfToSinglePageBadRequestException, PdfToSinglePageRequestEntityTooLargeException, PdfToSinglePageUnprocessableEntityException, PdfToSinglePageInternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); PDFFile req = PDFFile.builder() .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); PdfToSinglePageResponse res = sdk.general().pdfToSinglePage() .request(req) .call(); } } ``` -------------------------------- ### Split PDF into Sections (Java SDK) Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Splits each page of a PDF into smaller sections based on user-defined horizontal and vertical divisions. It can merge the split documents into a single PDF or output them as separate files. Requires authentication and accepts either a file ID or file input. ```java package hello.world; import java.lang.Exception; import org.openapis.openapi.Stirling; import org.openapis.openapi.models.components.SplitPdfBySectionsRequest; import org.openapis.openapi.models.errors.*; import org.openapis.openapi.models.operations.SplitPdfResponse; public class Application { public static void main(String[] args) throws SplitPdfBadRequestException, SplitPdfRequestEntityTooLargeException, SplitPdfUnprocessableEntityException, SplitPdfInternalServerError, Exception { Stirling sdk = Stirling.builder() .build(); SplitPdfBySectionsRequest req = SplitPdfBySectionsRequest.builder() .fileId("a1b2c3d4-5678-90ab-cdef-ghijklmnopqr") .build(); SplitPdfResponse res = sdk.general().splitPdf() .request(req) .call(); } } ``` -------------------------------- ### Scale PDF Page Size Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Scales the pages of an input PDF file to a specified size and scale factor. Supports both file uploads and server-side file IDs. ```APIDOC ## POST /api/v1/general/scale-pages ### Description Scales the pages of an input PDF file to a specified size and scale factor. This operation accepts a PDF file and the desired output page size. ### Method POST ### Endpoint /api/v1/general/scale-pages ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **pageSize** (string) - Required - The scale of pages in the output PDF. Acceptable values are A0-A6, LETTER, LEGAL, KEEP. - **scaleFactor** (number) - Optional - The scale of the content on the pages of the output PDF. Acceptable values are floats. Defaults to 1. - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput). - **fileInput** (string) - Optional - The input PDF file. ### Request Example ```json { "pageSize": "A4", "scaleFactor": 0.8, "fileId": "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr" } ``` ### Response #### Success Response (200) - **application/pdf** - PDF processed successfully #### Error Responses - **400** - Bad request - Invalid input parameters, unsupported format, or corrupted file - **413** - Payload too large - File exceeds maximum allowed size - **422** - Unprocessable entity - File is valid but cannot be processed - **500** - Internal server error - Unexpected error during processing ``` -------------------------------- ### POST /api/v1/general/split-pages Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Splits a PDF file into separate documents based on specified page numbers or ranges. Supports various formats for page selection. ```APIDOC ## POST /api/v1/general/split-pages ### Description This endpoint splits a given PDF file into separate documents based on the specified page numbers or ranges. Users can specify pages using individual numbers, ranges, or 'all' for every page. ### Method POST ### Endpoint /api/v1/general/split-pages ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **pageNumbers** (string) - Required - 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'). Defaults to "all". - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput). - **fileInput** (string) - Optional - The PDF file to process. ### Request Example ```json { "fileId": "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr" } ``` ### Response #### Success Response (200) - **application/pdf** - Files processed successfully. Returns single file or ZIP archive containing multiple files. #### Error Responses - **400** (application/json) - Bad request - Invalid input parameters, unsupported format, or corrupted file. - **413** (application/json) - Payload too large - File exceeds maximum allowed size. - **422** (application/json) - Unprocessable entity - File is valid but cannot be processed. - **500** (application/json) - Internal server error - Unexpected error during processing. #### Response Example (200) ```json "string" ``` ``` -------------------------------- ### POST /api/v1/general/crop Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Crops a PDF document according to the specified coordinates. This endpoint accepts a PDF file and returns the cropped version. ```APIDOC ## POST /api/v1/general/crop ### Description Crops a PDF document according to the specified coordinates. This endpoint accepts a PDF file and returns the cropped version. ### Method POST ### Endpoint /api/v1/general/crop ### Parameters #### Request Body - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput) - **fileInput** (string) - Optional - The input PDF file. - **height** (number) - Required - The height of the crop area. - **width** (number) - Required - The width of the crop area. - **x** (number) - Required - The x-coordinate of the top-left corner of the crop area. - **y** (number) - Required - The y-coordinate of the top-left corner of the crop area ### Request Example ```json { "fileId": "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr", "height": 100, "width": 200, "x": 10, "y": 20 } ``` ### Response #### Success Response (200) - **application/pdf** - PDF processed successfully #### Response Example (Binary PDF data) #### Error Responses - **400** - Bad request - Invalid input parameters, unsupported format, or corrupted file - **413** - Payload too large - File exceeds maximum allowed size - **422** - Unprocessable entity - File is valid but cannot be processed - **500** - Internal server error - Unexpected error during processing ``` -------------------------------- ### Analysis Operations Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Document analysis and information extraction services for content intelligence and insights. ```APIDOC ## POST /api/v1/analysis/security-info ### Description Analyzes a PDF document to retrieve security-related information. ### Method POST ### Endpoint /api/v1/analysis/security-info ### Parameters #### Request Body - **file** (file) - Required - The PDF file to analyze. ### Response #### Success Response (200) - **is_encrypted** (boolean) - Indicates if the document is encrypted. - **permissions** (object) - Details about document permissions. #### Response Example { "is_encrypted": false, "permissions": { "can_print": true, "can_modify": true } } ``` ```APIDOC ## POST /api/v1/analysis/page-dimensions ### Description Analyzes a PDF document to retrieve the dimensions of each page. ### Method POST ### Endpoint /api/v1/analysis/page-dimensions ### Parameters #### Request Body - **file** (file) - Required - The PDF file to analyze. ### Response #### Success Response (200) - **page_dimensions** (array) - An array of objects, each containing width and height for a page. #### Response Example { "page_dimensions": [ {"page": 1, "width": 612, "height": 792}, {"page": 2, "width": 612, "height": 792} ] } ``` ```APIDOC ## POST /api/v1/analysis/page-count ### Description Analyzes a PDF document to retrieve the total number of pages. ### Method POST ### Endpoint /api/v1/analysis/page-count ### Parameters #### Request Body - **file** (file) - Required - The PDF file to analyze. ### Response #### Success Response (200) - **page_count** (integer) - The total number of pages in the document. #### Response Example { "page_count": 25 } ``` ```APIDOC ## POST /api/v1/analysis/form-fields ### Description Analyzes a PDF document to extract information about form fields. ### Method POST ### Endpoint /api/v1/analysis/form-fields ### Parameters #### Request Body - **file** (file) - Required - The PDF file to analyze. ### Response #### Success Response (200) - **form_fields** (array) - An array of objects, each describing a form field. #### Response Example { "form_fields": [ {"name": "firstName", "type": "text", "value": "John"}, {"name": "agreeTerms", "type": "checkbox", "value": true} ] } ``` ```APIDOC ## POST /api/v1/analysis/font-info ### Description Analyzes a PDF document to retrieve information about the fonts used. ### Method POST ### Endpoint /api/v1/analysis/font-info ### Parameters #### Request Body - **file** (file) - Required - The PDF file to analyze. ### Response #### Success Response (200) - **font_info** (array) - An array of objects, each containing details about a font. #### Response Example { "font_info": [ {"name": "Arial", "embedded": true, "type": "TrueType"}, {"name": "Times New Roman", "embedded": false, "type": "Type1"} ] } ``` ```APIDOC ## POST /api/v1/analysis/document-properties ### Description Analyzes a PDF document to retrieve its metadata properties. ### Method POST ### Endpoint /api/v1/analysis/document-properties ### Parameters #### Request Body - **file** (file) - Required - The PDF file to analyze. ### Response #### Success Response (200) - **properties** (object) - An object containing document properties like title, author, subject, etc. #### Response Example { "properties": { "title": "Sample Document", "author": "Jane Doe", "subject": "API Documentation Example" } } ``` ```APIDOC ## POST /api/v1/analysis/basic-info ### Description Retrieves basic information about a PDF document, such as version and producer. ### Method POST ### Endpoint /api/v1/analysis/basic-info ### Parameters #### Request Body - **file** (file) - Required - The PDF file to analyze. ### Response #### Success Response (200) - **pdf_version** (string) - The PDF version. - **producer** (string) - The software that created the PDF. #### Response Example { "pdf_version": "1.7", "producer": "Stirling PDF" } ``` ```APIDOC ## POST /api/v1/analysis/annotation-info ### Description Analyzes a PDF document to retrieve information about annotations. ### Method POST ### Endpoint /api/v1/analysis/annotation-info ### Parameters #### Request Body - **file** (file) - Required - The PDF file to analyze. ### Response #### Success Response (200) - **annotations** (array) - An array of objects, each describing an annotation. #### Response Example { "annotations": [ {"type": "Text", "page": 1, "content": "Important note"}, {"type": "Highlight", "page": 2} ] } ``` -------------------------------- ### Pipeline Operations Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Automated document processing workflows for complex multi-stage business operations. ```APIDOC ## POST /api/v1/pipeline/handleData ### Description Executes a predefined document processing pipeline with provided data. ### Method POST ### Endpoint /api/v1/pipeline/handleData ### Parameters #### Request Body - **pipeline_id** (string) - Required - The ID of the pipeline to execute. - **data** (object) - Required - The data payload for the pipeline. ### Response #### Success Response (200) - **result** (object) - The result of the pipeline execution. #### Response Example { "result": { "status": "completed", "output_files": ["file1.pdf", "file2.docx"] } } ``` -------------------------------- ### POST /api/v1/general/split-pdf-by-sections Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Splits each page of a PDF into smaller sections based on user-defined horizontal and vertical divisions. The output can be a single PDF or a ZIP archive containing multiple PDFs. ```APIDOC ## POST /api/v1/general/split-pdf-by-sections ### Description Splits each page of a PDF into smaller sections based on the user's choice (halves, thirds, quarters, etc.), both vertically and horizontally. Input: PDF, Output: ZIP-PDF. Type: SISO. ### Method POST ### Endpoint /api/v1/general/split-pdf-by-sections ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **horizontalDivisions** (integer) - Required - Number of horizontal divisions for each PDF page. Minimum: 0, Default: 0. - **merge** (boolean) - Required - Merge the split documents into a single PDF. Default: true. - **verticalDivisions** (integer) - Required - Number of vertical divisions for each PDF page. Minimum: 0, Default: 1. - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput). Example: a1b2c3d4-5678-90ab-cdef-ghijklmnopqr - **fileInput** (string) - Optional - The PDF file to process. ### Request Example ``` --boundary Content-Disposition: form-data; name="horizontalDivisions" 2 --boundary Content-Disposition: form-data; name="verticalDivisions" 2 --boundary Content-Disposition: form-data; name="fileInput"; filename="example.pdf" Content-Type: application/pdf [PDF content here] --boundary-- ``` ### Response #### Success Response (200) - **application/pdf** or **application/zip** - Files processed successfully. Returns single file or ZIP archive containing multiple files. #### Response Example ``` [PDF or ZIP content here] ``` #### Error Responses - **400** (Bad request) - Invalid input parameters, unsupported format, or corrupted file. - **413** (Payload too large) - File exceeds maximum allowed size. - **422** (Unprocessable entity) - File is valid but cannot be processed. - **500** (Internal server error) - Unexpected error during processing. ``` -------------------------------- ### POST /api/v1/general/multi-page-layout Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Merges multiple pages of a PDF document into a single page. This operation takes an input PDF file and the number of pages to merge into a single sheet in the output PDF file. ```APIDOC ## POST /api/v1/general/multi-page-layout ### Description Merges multiple pages of a PDF document into a single page. This operation takes an input PDF file and the number of pages to merge into a single sheet in the output PDF file. ### Method POST ### Endpoint /api/v1/general/multi-page-layout ### Parameters #### Request Body - **pagesPerSheet** (integer) - Required - The number of pages to fit onto a single sheet in the output PDF. Enum: 2, 3, 4, 9, 16 - **addBorder** (boolean) - Optional - Boolean for if you wish to add border around the pages - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput). Example: a1b2c3d4-5678-90ab-cdef-ghijklmnopqr - **fileInput** (string) - Optional - The input PDF file ### Request Example ```json { "pagesPerSheet": 4, "fileId": "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr" } ``` ### Response #### Success Response (200) - **application/pdf** - PDF processed successfully #### Error Responses - **400** - Bad request - Invalid input parameters, unsupported format, or corrupted file (application/json) - **413** - Payload too large - File exceeds maximum allowed size (application/json) - **422** - Unprocessable entity - File is valid but cannot be processed (application/json) - **500** - Internal server error - Unexpected error during processing (application/json) ``` -------------------------------- ### POST /api/v1/general/rearrange-pages Source: https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/index Rearranges pages in a PDF file based on specified page order or custom modes. Supports input via file ID or direct file upload. ```APIDOC ## POST /api/v1/general/rearrange-pages ### Description Rearranges pages in a given PDF file based on the specified page order or custom mode. Users can provide a page order as a comma-separated list of page numbers or page ranges, or a custom mode. Input: PDF, Output: PDF. ### Method POST ### Endpoint /api/v1/general/rearrange-pages ### Parameters #### Request Body - **pageNumbers** (string) - Optional - 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'). Defaults to 'all'. - **customMode** (string) - Optional - The custom mode for page rearrangement. Valid values are: CUSTOM, DUPLICATE, REVERSE_ORDER, DUPLEX_SORT, BOOKLET_SORT, SIDE_STITCH_BOOKLET_SORT, ODD_EVEN_SPLIT, ODD_EVEN_MERGE, REMOVE_FIRST, REMOVE_LAST, REMOVE_FIRST_AND_LAST. - **fileId** (string) - Optional - File ID for server-side files (can be used instead of fileInput). - **fileInput** (string) - Optional - The PDF file to process. ### Request Example ```json { "pageNumbers": "1,3,5-7", "customMode": "REVERSE_ORDER", "fileId": "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr" } ``` ### Response #### Success Response (200) - **application/pdf** - PDF processed successfully #### Error Responses - **400** - Bad request - Invalid input parameters, unsupported format, or corrupted file - **413** - Payload too large - File exceeds maximum allowed size - **422** - Unprocessable entity - File is valid but cannot be processed - **500** - Internal server error - Unexpected error during processing ```