Skip to content

E002 Refinement: Empty Profile Handling

Context

The user identified an issue where an empty pdf_profile string (e.g., "") triggered the E002 "Invalid Profile" error. The expected behavior is that an empty profile implies Standard PDF generation (no specific PDF/A compliance), and thus should NOT trigger an error.

Changes

  • Logic Update: In both level_b.rs and parallel.rs, we now check if pdf_profile is empty or whitespace-only before attempting to match it against known profiles.
  • Behavior:
    • pdf_profile: "" or None -> Standard PDF (Success).
    • pdf_profile: "pdfa-1b" -> PDF/A-1b (Success).
    • pdf_profile: "invalid-profile" -> E002 Error (Failure).

Verification

  • Server: Restarted on http://127.0.0.1:6000.
  • Test: Sending a request with pdf_profile: "" now generates a standard PDF successfully, whereas previously it returned an E002 overlay.