pdf_make_unsearchable
Remove the text layer from PDF documents to make them non-searchable and protect sensitive information from text extraction.
Instructions
Make existing PDF document non-searchable by removing the text layer from it.
Ref: https://developer.pdf.co/api-reference/pdf-change-text-searchable/unsearchable.md
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to the source file. Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files. | |
| httpusername | No | HTTP auth user name if required to access source url. (Optional) | |
| httppassword | No | HTTP auth password if required to access source url. (Optional) | |
| pages | No | Comma-separated page indices (e.g., '0, 1, 2-' or '1, 3-7'). Use '!' for inverted page numbers (e.g., '!0' for last page). Processes all pages if None. (Optional) | |
| password | No | Password of the PDF file. (Optional) | |
| name | No | File name for the generated output. (Optional) | |
| api_key | No | PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional) |
Implementation Reference
- pdfco/mcp/tools/apis/searchable.py:58-99 (handler)The primary MCP tool handler for 'pdf_make_unsearchable'. Decorated with @mcp.tool() for registration, defines the input schema via Pydantic Fields, constructs ConversionParams, and calls the service helper.@mcp.tool() async def pdf_make_unsearchable( url: str = Field( description="URL to the source file. Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files." ), httpusername: str = Field( description="HTTP auth user name if required to access source url. (Optional)", default="", ), httppassword: str = Field( description="HTTP auth password if required to access source url. (Optional)", default="", ), pages: str = Field( description="Comma-separated page indices (e.g., '0, 1, 2-' or '1, 3-7'). Use '!' for inverted page numbers (e.g., '!0' for last page). Processes all pages if None. (Optional)", default="", ), password: str = Field( description="Password of the PDF file. (Optional)", default="" ), name: str = Field( description="File name for the generated output. (Optional)", default="" ), api_key: str = Field( description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)", default="", ), ) -> BaseResponse: """ Make existing PDF document non-searchable by removing the text layer from it. Ref: https://developer.pdf.co/api-reference/pdf-change-text-searchable/unsearchable.md """ params = ConversionParams( url=url, httpusername=httpusername, httppassword=httppassword, pages=pages, password=password, name=name, ) return await make_pdf_unsearchable(params, api_key=api_key)
- pdfco/mcp/__init__.py:3-15 (registration)Import statement that loads the 'searchable' module, triggering the @mcp.tool() decorator to register the 'pdf_make_unsearchable' tool with the MCP server.from pdfco.mcp.tools.apis import ( conversion, job, file, modification, form, search, searchable, security, document, extraction, editing, )
- pdfco/mcp/services/pdf.py:91-94 (helper)Helper service function that performs the core logic by calling the PDF.co API endpoint '/v1/pdf/makeunsearchable' via the generic 'request' utility.async def make_pdf_unsearchable( params: ConversionParams, api_key: str | None = None ) -> BaseResponse: return await request("pdf/makeunsearchable", params, api_key=api_key)
- pdfco/mcp/models.py:5-10 (schema)Pydantic model for the tool's output response schema.class BaseResponse(BaseModel): status: str content: Any credits_used: int | None = None credits_remaining: int | None = None tips: str | None = None
- pdfco/mcp/models.py:13-52 (schema)Pydantic model defining the common input parameters used by the tool, including fields mapped in the handler.class ConversionParams(BaseModel): url: str = Field( description="URL to the source file. Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files.", default="", ) httpusername: str = Field( description="HTTP auth user name if required to access source url. (Optional)", default="", ) httppassword: str = Field( description="HTTP auth password if required to access source url. (Optional)", default="", ) pages: str = Field( description="Comma-separated page indices (e.g., '0, 1, 2-' or '1, 3-7'). Use '!' for inverted page numbers (e.g., '!0' for last page). Processes all pages if None. (Optional)", default="", ) unwrap: bool = Field( description="Unwrap lines into a single line within table cells when lineGrouping is enabled. Must be true or false. (Optional)", default=False, ) rect: str = Field( description="Defines coordinates for extraction (e.g., '51.8,114.8,235.5,204.0'). (Optional)", default="", ) lang: str = Field( description="Language for OCR for scanned documents. Default is 'eng'. See PDF.co docs for supported languages. (Optional, Default: 'eng')", default="eng", ) line_grouping: str = Field( description="Enables line grouping within table cells when set to '1'. (Optional)", default="0", ) password: str = Field( description="Password of the PDF file. (Optional)", default="" ) name: str = Field( description="File name for the generated output. (Optional)", default="" ) autosize: bool = Field(