Skip to content
ComPDF
DemoAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Definition of Error Codes

When a request fails, ComPDF Self-hosted returns one normalized error response. Conversion and PDF processing errors use HTTP 200 and preserve the relevant business error in the JSON body. Errors produced by ComPDF Self-hosted itself retain the corresponding 4xx or 5xx HTTP status.

The type field identifies the error-code namespace. Always use type together with code or errorCode: the conversion engine and PDF SDK reuse some numeric codes with different meanings. A conversion SDK error can use its original SDK numeric code, such as 4, while API and server errors normally use six-digit business codes.

json
{
  "type": "conversion",
  "code": 4,
  "errorCode": "PDF_PAGE_ERROR",
  "message": "PDF page failed to load.",
  "traceId": "82f733c63cc74946a7c5671430e3c6a4"
}

Fields

FieldTypeDescription
typeStringError source: conversion, pdf, or server.
codeNumberNumeric code returned by the source. Conversion SDK errors can use the original SDK code; API and server errors normally use six-digit business codes.
errorCodeStringStable semantic error identifier corresponding to code.
messageStringEnglish human-readable error description. For documented processing errors, this follows the corresponding SDK error definition.
traceIdStringTrace identifier for correlating the request with service logs.

Error Sources and Duplicate Codes

typeSourceerrorCode behavior
conversionConversion processingIdentifies a conversion-processing error.
pdfPDF processingIdentifies a PDF-processing error.
serverComPDF Self-hostedThe error is generated by ComPDF Self-hosted and uses the Server error-code definition.

The same numeric value can mean different things for different sources. For example, 120001 is AUTH_REQUIRED for type: "conversion", but PASSWORD_REQUIRED for type: "pdf". Likewise, 190005 is OCR_FAILURE for conversion and RESOURCE_EXHAUSTED for PDF processing.

ComPDF Web uses type and errorCode to display localized error text. API clients should also use these stable fields for programmatic handling and should not parse message.

Common Error Codes

HTTP StatuscodeerrorCodeMeaning
200Processing codeProcessing errorCodeA conversion or PDF-processing business error occurred. type identifies whether it is conversion or pdf.
400100001BAD_REQUEST / VALIDATION_ERRORMissing or invalid server request parameters.
401140001UNAUTHORIZEDMissing or invalid x-api-key or admin session.
403140002FORBIDDEN / INVALID_TOKENThe request is not permitted.
404150001NOT_FOUNDResource or task was not found.
409150002 / 150003TASK_NOT_READY / CONFLICT / INVALID_STATETask or resource state does not allow the request.
413100104FILE_TOO_LARGEUploaded file exceeds the ComPDF Self-hosted request limit before processing.
429130012CONCURRENCY_LIMITToo many requests reached ComPDF Self-hosted concurrently.
500190999INTERNAL_ERRORUnexpected server error.

Request Example

bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/docx" \
  -H "x-api-key: your_api_key_here" \
  -F "file=@/path/to/sample.pdf" \
  -F 'options={"pageRanges":"999999"}'

Processing Engine Business Codes

All processing errors in this table are returned with HTTP 200. The conversion catalog includes original numeric codes such as 4 (PDF_PAGE_ERROR) and six-digit conversion API codes. Refer to the source-specific type before interpreting overlapping values.

codeerrorCodeMeaning
100001INVALID_REQUEST (conversion) / INVALID_ARGUMENT (pdf)Invalid request or argument.
100002INVALID_JSONInvalid JSON in request or options.
100101INVALID_FILE_TYPEUploaded file type is not supported.
100102FILE_REQUIREDRequired file field is missing.
100103FILE_COUNT_MISMATCHFile count does not match parameters.
100104FILE_TOO_LARGEUploaded file is too large.
100105PAGE_LIMIT_EXCEEDEDPage limit exceeded.
100106INVALID_OUTPUT_FILE_NAMEOutput file name is invalid.
110001INVALID_PAGE_RANGEPage range is invalid.
110002INVALID_PAGE_INDEXPage index is invalid.
110003INVALID_RECTRectangle parameter is invalid.
110004INVALID_QUAD_RECTSQuad rectangle parameter is invalid.
110005PAGE_RANGE_EMPTYPage range resolves to no pages.
120001AUTH_REQUIRED (conversion) / PASSWORD_REQUIRED (pdf)Authentication is required for conversion; a password is required for PDF processing.
120002INVALID_TOKEN (conversion) / INVALID_PASSWORD (pdf)Token is invalid for conversion; password is invalid for PDF processing.
120201ICC_PROFILE_REQUIREDICC profile file is required.
120202ICC_PROFILE_INVALIDICC profile file is invalid.
130003INVALID_STATETask state does not allow this action.
190001CONVERT_FAILED (conversion) / SDK_PROCESS_FAILED (pdf)Conversion or SDK processing failed.
190002PDF_PASSWORD_ERROR (conversion) / TEMP_FILE_WRITE_FAILED (pdf)Password failure for conversion; temporary-file write failure for PDF processing.
190003PDF_FORMAT_ERROR (conversion) / TEMP_FILE_READ_FAILED (pdf)PDF format failure for conversion; temporary-file read failure for PDF processing.
190004PDF_SECURITY_ERROR (conversion) / RESULT_PACKAGE_FAILED (pdf)PDF security failure for conversion; result packaging failure for PDF processing.
190005OCR_FAILURE (conversion) / RESOURCE_EXHAUSTED (pdf)OCR failure for conversion; insufficient resources for PDF processing.
190006JOB_TIMEOUT (conversion) / REQUEST_TIMEOUT (pdf)Conversion task timeout or PDF processing request timeout.
190009SDK_FILE_ERRORFile cannot be opened or found.
190999UPSTREAM_ERRORUnknown processing engine error.