Categories

Doc Comment to PDF Docs

Generate API documentation PDF from code comments

Extract JSDoc-style comments and format them as PDF API documentation.

Input: source text or file with /** */ blocks
Output: PDF documentation

Example Results

1 examples

Doc Comment Docs

Source comments rendered as docs PDF

doc-comment-to-pdf-docs-example1.pdf View File
View input parameters
{ "sourceText": "/**\n * Adds two values\n * @param {number} a\n * @param {number} b\n */\nfunction add(a,b){ return a+b }", "docTitle": "Utility Docs", "version": "1.0.0" }

Click to upload file or drag and drop file here

Maximum file size: 10MB Supported formats: text/plain, application/octet-stream

Key Facts

Category
Document Tools
Input Types
textarea, file, text, number, select, checkbox
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

Convert your JSDoc-style code comments into professional, readable PDF API documentation instantly. This tool extracts structured documentation blocks directly from your source code or text files, allowing you to generate clean, formatted technical manuals without manual formatting.

When to Use

  • When you need to generate quick API reference documentation from existing JSDoc comments.
  • When you want to share technical specifications with stakeholders who prefer PDF formats over raw code.
  • When you need to create versioned documentation snapshots for project releases.

How It Works

  • Paste your source code containing JSDoc blocks into the input area or upload your source file.
  • Customize your document by setting the title, version, and page layout preferences like orientation and margins.
  • Click the generate button to parse the comments and compile them into a downloadable PDF document.

Use Cases

Generating internal API reference guides for development teams.
Creating professional documentation exports for client project handovers.
Archiving technical specifications for specific software versions.

Examples

1. API Reference Generation

Software Developer
Background
A developer needs to provide a clean API reference for a new utility library to the QA team.
Problem
The documentation is currently buried in code comments and needs to be in a readable PDF format.
How to Use
Paste the code snippets into the Source Text field and set the Document Title to 'Library API Reference'.
Example Config
docTitle: 'Library API Reference', version: '1.0.0', pageSize: 'A4'
Outcome
A professionally formatted PDF containing all documented functions and parameters.

Try with Samples

pdf, text, file

Related Hubs

FAQ

What comment format does this tool support?

The tool is designed to parse standard JSDoc-style comments formatted with /** */ blocks.

Can I customize the appearance of the PDF?

Yes, you can adjust the base font size, page size, margins, and orientation to suit your documentation style.

Is there a limit to the file size I can upload?

The tool supports source file uploads up to 10MB.

Does it support multiple page sizes?

Yes, you can select from A4, Letter, Legal, or A5 page sizes.

Can I include a version number in the generated document?

Yes, you can specify a version string in the configuration options to include it in your document header.

API Documentation

Request Endpoint

POST /en/api/tools/doc-comment-to-pdf-docs

Request Parameters

Parameter Name Type Required Description
sourceText textarea No -
sourceFile file (Upload required) No -
docTitle text No -
version text No -
baseFontSize number No -
pageSize select No -
landscape checkbox No -
printBackground checkbox No -
marginTop number No -
marginBottom number No -
marginLeft number No -
marginRight number No -
waitUntil select No -
waitTime number No -

File type parameters need to be uploaded first via POST /upload/doc-comment-to-pdf-docs to get filePath, then pass filePath to the corresponding file field.

Response Format

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-doc-comment-to-pdf-docs": {
      "name": "doc-comment-to-pdf-docs",
      "description": "Generate API documentation PDF from code comments",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=doc-comment-to-pdf-docs",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

Supports URL file links or Base64 encoding for file parameters.

If you encounter any issues, please contact us at [email protected]