Text File Viewer

View .txt, .csv, and .xml files in the Nutrient viewer by converting them to PDF via the DWS API

Text to HTML

Text to HTML

Wraps plain text lines in styled HTML with readability-focused formatting

CSV Tables

CSV Tables

CSV files are rendered as styled HTML tables for clear, structured data presentation

DWS PDF Conversion

DWS PDF Conversion

HTML is converted to PDF using the Nutrient DWS API /build endpoint

Select a Text File

server-log.txtOriginal file preview
How It Works
  1. Select a text-based file (.txt, .csv, or .xml)
  2. The file content is converted to styled HTML on the server:

    .txt lines are wrapped in paragraph tags

    .csv data is rendered as a styled HTML table

    .xml content gets syntax highlighting

  3. The HTML is sent to the Nutrient DWS API /build endpoint for PDF conversion
  4. The resulting PDF is displayed in the Nutrient Web SDK viewer

This sample demonstrates converting text-based files to PDF using the Nutrient DWS API. Requires NUTRIENT_API_KEY environment variable.