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

Template-to-PDF Error Codes

This page describes error codes for POST /api/v1/process/pdf/generation/template-to-pdf. In an error response, the HTTP status is in code, and the ComPDF service code is in bizCode.

Error Response Format

json
{
  "code": "500",
  "msg": "HTML_CONVERTER_ERROR_TEMPLATE_PARSE",
  "data": null,
  "errorCode": "SDK_PROCESS_FAILED",
  "bizCode": 190001,
  "traceId": "d971b49f-4353-494c-963e-1c14918e23be"
}
FieldTypeDescription
codestringHTTP status code returned by the proxy, as a string.
msgstringError description. When bizCode=190001, it contains an HTML_CONVERTER_* SDK enum name.
datanullAlways null in an error response.
errorCodestringNormalized semantic error code returned by the proxy.
bizCodenumberComPDF service code. It can be omitted when the proxy or upstream service does not provide it.
traceIdstringRequest trace ID. Provide it when troubleshooting.
detailsunknownOptional error details returned by the upstream service.

Service Error Codes

100xxx - Request and File Errors

CodeerrorCodeHTTPUser MessageTechnical Description
100001INVALID_ARGUMENT400The parameters are invalid. Check the input and try again.A request parameter is missing, has the wrong type, or is invalid for the conversion.
100002INVALID_JSON400JSON parsing failed. Check the JSON format and try again.The request JSON or template data JSON cannot be parsed.
100102FILE_REQUIRED400A required file or request part is missing.Provide templateFile, or template content supported by the upstream service.
100104FILE_TOO_LARGE413The uploaded content or content returned by htmlUrl exceeds the service limit.Reduce the input size and submit the request again.
100106INVALID_OUTPUT_FILE_NAME400outputFileName contains an invalid path segment.Use a file name without directory or path-traversal characters.

190xxx - Processing and System Errors

CodeerrorCodeHTTPUser MessageTechnical Description
190001SDK_PROCESS_FAILED500Determined by the SDK enum in msg.The ComPDF SDK returned a non-success HTML conversion result.
190002TEMP_FILE_WRITE_FAILED500PDF saving failed. Confirm that the storage location is available and try again.Writing to the server temporary directory, upload location, or PDF output failed.
190003TEMP_FILE_READ_FAILED500File reading failed. Confirm that the file exists and is accessible, then try again.Reading the uploaded HTML, template, or data file failed.
190999INTERNAL_ERROR500An unknown error occurred. Try again later; contact support if it persists.An unhandled internal service exception occurred.

SDK Conversion Errors

The following table applies only when bizCode=190001. The original SDK ID is not returned directly as the HTTP error code; use the enum name in msg to determine the failure stage.

SDK IDmsg EnumUser MessageTechnical Description
-1HTML_CONVERTER_ERROR_FILE_READFile reading failed. Confirm that the file exists and is accessible, then try again.The input HTML or related resources could not be read.
-2HTML_CONVERTER_ERROR_HTML_PARSEHTML parsing failed. Check the HTML structure and syntax, then try again.HTML parsing failed.
-3HTML_CONVERTER_ERROR_RENDERHTML rendering failed. Check the content or styles, then try again.HTML rendering failed.
-4HTML_CONVERTER_ERROR_PDF_SAVEPDF saving failed. Confirm that the storage location is available and try again.PDF saving failed.
-5HTML_CONVERTER_ERROR_INVALID_PARAMThe parameters are invalid. Check the input and try again.The SDK determined that the conversion parameters are invalid.
-6HTML_CONVERTER_ERROR_JSON_PARSEJSON parsing failed. Check the JSON format and try again.Template data JSON parsing failed.
-7HTML_CONVERTER_ERROR_TEMPLATE_PARSETemplate parsing failed. Check tag closure, nesting order, and ComPDF Generation syntax compatibility; contact technical support if the issue remains.Template syntax parsing failed.
-8HTML_CONVERTER_ERROR_TEMPLATE_RENDERThe template syntax is valid, but data substitution failed. Check placeholders and array or object types; for more than 1,000 items or a timeout, try processing in batches.The template syntax is valid, but data substitution failed.
-9HTML_CONVERTER_ERROR_LICENSE_NOT_INITThe license is not initialized. Initialize the license and try again.The Generation license is not initialized.
-10HTML_CONVERTER_ERROR_LICENSE_INVALIDThe license is invalid. Check the license configuration and try again.The Generation license is invalid.
-11HTML_CONVERTER_ERROR_LICENSE_EXPIREDThe license has expired. Update the license and try again.The Generation license has expired.
-12HTML_CONVERTER_ERROR_LICENSE_NO_PERMISSIONThe license does not permit this operation. Check its permissions.The license has no permission for Generation operations.
-13HTML_CONVERTER_ERROR_UNKNOWNAn unknown error occurred. Try again later; contact support if it persists.The SDK could not classify the error.

Retry Recommendations

CodeRetry Directly?Recommendation
100001, 100002, 100102, 100104, 100106NoCorrect the request, file, or JSON first.
190001Depends on the enumCorrect parameter, template, data, and license issues first. Retry file-reading, rendering, and saving errors after confirming the environment.
190002, 190003YesCheck the storage or input file, then retry.
190999YesUse a short backoff. If the problem persists, provide the traceId.