extract_html

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Editor MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-editor -- dnx GroupDocs.Editor.Mcp --yes
Folders, licensing and more →

extract_html opens a document for editing: it converts the whole document — or one worksheet (worksheet), one slide (slide), or a PDF page range (pages) — into an HTML file in the output folder, keeping fonts, styles, tables and images. The agent edits that file, then calls save_from_html. Worksheets and slides are addressed by 1-based number — get_document_info gives the count, not the names. Example prompt: “Open worksheet 2 (Q3) of budget.xlsx for editing.”

Tool description (as the AI agent sees it):

Opens a document for editing: converts it — or one worksheet, one slide, or a PDF page range — into editable HTML and saves the .html file to storage, keeping fonts, styles, tables and images. Edit that file, then call save_from_html to turn it back into DOCX, XLSX, PPTX, PDF or another format. For a simple find-and-replace use replace_text instead. Supports DOCX, DOC, RTF, ODT, XLSX, XLS, ODS, CSV, PPTX, PPT, ODP, PDF, TXT, HTML, XML, Markdown, EPUB, MOBI, EML and more. Do NOT pre-check whether files exist — just pass the filename the user provided; a missing file returns the list of available files. By default the HTML is self-contained (images, CSS and fonts embedded); set embedResources=false to get .html plus a _resources folder. Returns the saved path (‘Saved to: …’), which part was extracted (e.g. ‘worksheet 2 of 3’), and a plain-text preview of the content. On failure isError is set and the text starts with ‘HTML extraction failed for’; a file that cannot be found returns the list of available files instead.

Parameters

NameTypeRequiredDescription
fileobjectyesThe document — see FileInput shape
passwordstringnoPassword, for password-protected documents
worksheetintegernoSpreadsheets only: which worksheet to extract, 1-based (default 1)
slideintegernoPresentations only: which slide to extract, 1-based (default 1)
pagesstringnoPDF only: 1-based page or inclusive range, e.g. ‘3’ or ‘2-4’ (default: all pages)
paginationbooleannoWord, PDF and text: true keeps page boundaries (paginal HTML); false (default) gives one continuous flow
skipImagesbooleannoPDF only: true leaves images out and keeps text only
embedResourcesbooleannotrue (default) embeds images, CSS and fonts in one .html file; false writes a _resources folder beside it
showHiddenbooleannoSpreadsheets and presentations: allow hidden worksheets and slides

Example call

{
  "name": "extract_html",
  "arguments": {
    "file": {
      "filePath": "budget.xlsx"
    },
    "worksheet": 2
  }
}

Result

Plain text — captured from server 26.10.0:

Evaluation mode: outputs start with an evaluation banner, saved workbooks gain
an extra worksheet, and only the first 2 PDF pages, worksheets and slides can
be edited. Set GROUPDOCS_LICENSE_PATH, or the metered keys, to remove these
limits.

Extracted worksheet 2 of 3 of 'budget.xlsx' as editable HTML
Saved to: …/budget_worksheet2.html

Next: edit the saved .html and call save_from_html to write it back as DOCX,
XLSX, PPTX, PDF or another format.

Preview (plain text):
Created with evaluation version of GroupDocs.Editor © Aspose Pty Ltd 2001-2026.
All Rights Reserved. Cost centre Planned (EUR) Owner Hosting 57600 IT Support
14400 IT Travel 9000 Sales Training 6000 HR

(Wrapped for width.) The HTML file is named after the part: <name>_worksheet2.html, <name>_slide2.html, <name>_pages1-2.html, or <name>.html for a whole document. embedResources (default true) keeps images, CSS and fonts inside the one file; pagination: true keeps page boundaries for Word and PDF.

In evaluation mode the server refuses a worksheet or slide past the second, and says why:

HTML extraction failed for 'budget.xlsx': Evaluation mode edits only the first
2 visible worksheets of a workbook; worksheet 3 is beyond them. Set
GROUPDOCS_LICENSE_PATH, or the metered keys, to edit every worksheet.

In evaluation mode a PDF is edited two pages per call: pages: "1-3" returned pages 1 and 2 and stopped at the first line of page 3, with no error beyond the evaluation line; pages: "3" on its own extracted page 3. Licensed, leave pages out to extract the whole PDF.

A hidden slide needs showHidden: true; a hidden worksheet is refused whatever showHidden says — unhide it in the workbook first. For a slide, the plain-text preview may start with the master’s placeholder text (“Click to edit Master title style”) rather than the slide’s own words; the HTML file holds the slide.

Example prompts

  • “Open worksheet 2 of budget.xlsx for editing — that is the Q3 sheet.”
  • “Give me slide 2 of the review deck as HTML.”
  • “Turn pages 1-2 of travel-policy.pdf into something I can edit.”

See it used end-to-end: Edit one worksheet or slide and put it back.