FreeReportv0.9.0한국어

Print, PDF, Excel, CSV

Print at the exact paper size, save PDF with embedded Korean fonts, Excel as printed or as data, CSV and Hangul HWPX from code or the toolbar.

Printing uses the browser at the exact paper size of the report, with the same line breaks as on screen. PDF embeds a subset of the TrueType fonts, so text is searchable and copyable. Excel "form" keeps the printed layout as merged cells with borders; "data" writes one row per record for further work.

import { createReport } from '@freereportjs/core';

const report = createReport(definition, { rows });
await report.ready();                    // wait for web fonts, then lay out

await report.print();                    // browser print at the paper size
const pdf = await report.toPdf();        // Blob, fonts embedded
const form = await report.toXlsx('form'); // merged cells and borders, like the printout
const data = await report.toXlsx('data'); // one row per record
await report.download('pdf', '매출 보고서'); // or save directly
NameTypeDescription
createReport(def, data, options?)ReportBind a definition to data without a viewer.
ready()Promise<LayoutResult>Wait for web fonts, then lay out. Call before the first output in browsers.
layout()LayoutResultPages, row count and time (cached).
print({ pages? })Promise<boolean>Print through the browser at the exact paper size.
toPdf()Promise<Blob | null>PDF with embedded font subsets.
toXlsx('form' | 'data')Promise<Blob | null>"form" keeps merged cells and borders; "data" writes one row per record.
toHwpx()Promise<Blob | null>Hangul document (.hwpx, KS X 6101) laid out like the printed pages.
toCsv()Promise<Blob | null>CSV (UTF-8 with BOM, so Excel shows Korean correctly).
download('pdf' | 'xlsx' | 'xlsx-data' | 'csv' | 'hwpx', name?)Promise<boolean>Create and save the file.