harbor run -t LiteCoder/extract-hidden-pdf-textharbor download LiteCoder/extract-hidden-pdf-textRecover text that has been visually hidden inside a PDF file. A whistle-blower has released a PDF report (/app/suspect.pdf). On screen everything looks perfectly innocent, but a short secret text passage has been concealed in a way that is not visible to a normal reader. Your job is to locate and extract that hidden message.
/app/suspect.pdf — a valid PDF that contains one or more hidden text passages not visible when the PDF is rendered normally/app/output.jsonBefore extraction, you must first create the test PDF /app/suspect.pdf. Build a valid PDF file that:
"This is a normal public report with nothing unusual.""The meeting is at 19:30 behind the old mill."The hidden text must be genuinely embedded inside the PDF structure (e.g., as invisible text-rendering mode, white-on-white text, text positioned off-page, text behind an opaque object, or appended after %%EOF) — it must not appear when the document is viewed in a standard PDF reader.
After creating the PDF, write a Python script /app/extract.py that:
/app/suspect.pdf/app/output.json/app/output.json must be a JSON object with the following structure:
{
"hidden_texts": [
{
"text": "The meeting is at 19:30 behind the old mill.",
"sha256": "<sha256 hex digest of the exact text bytes>"
}
]
}
hidden_texts: a JSON array containing one object per hidden text passage found.text: the exact extracted hidden string (trimmed of leading/trailing whitespace).sha256: lowercase hex SHA-256 digest of the UTF-8 encoding of the text value (no trailing newline).