CreateExcel(sheets, outputName?, options?) : Resource?

Creates Excel file as memory resource.
Each value can be a dict with Value property and any of the following styles:
    Width, Color, BgColor, BgFill, Size (font size), Bold, Italic, Wrap, Align, VAlign, Border{Left,Right,Top,Bottom}(Color,Style), NumberFormat.

CreateExcel Parameters

sheets : Dict?
Dictionary sheetName -> [] (each array item is a row, i.e. array of cells).

outputName? : String?
Output resource file name.

options? : Dict?
Supports AutoHeader, AutoFit, Freeze (‘row col’), StyleFirstRow, or any style property.

CreateExcel Examples

var rows = 64; var cols = 16;
var excel = CreateExcel({
	Sheet = Repeat(rows, row => Repeat(cols, col => {
		Value = (row - 1) * cols + col,
		BgColor = "#{row*255/rows -> (-2,,0)x}{col*255/cols -> (-2,,0)x}{((row-1)*cols+col)*255/(rows*cols) -> (-2,,0)x}"
	}))
});

CreateSlides(slides, outputName?) : Resource?

Creates Powerpoint slides file as memory resource.

CreateSlides Parameters

slides : Binary[]?
Array of images to become slides (SVG, PNG, WMF, EMF formats are supported).

outputName? : String?
Output resource file name.

DocMerge(documents, outputName?) : Resource?

Merges several documents into one (currently PDF only).

DocMerge Parameters

documents : []
Documents to merge.

outputName? : String?
Output resource file name.

DocProtect(document, password?) : Resource?

Protects document from modifications using password.

DocProtect Parameters

document : Resource?
Document to protect.

password? : String?
Password for protection.

DocToDocx(document, outputName?) : Resource?

Converts document (PDF) to Word docx.

DocToDocx Parameters

document : Resource?
Document to convert.

outputName? : String?
Output resource file name.

DocToEml(document, from?, to?, subject?, outputName?, attachment?, cc?, bcc?, options?) : Resource?

Alias: ConvertDocumentToEml

Converts document (HTML, Word, Excel) to EML.

DocToEml Parameters

document : Resource?
Document to convert.

from? : String?

to? : String?

subject? : String?

outputName? : String?
Output resource file name.

attachment? : Resource?

cc? : String?

bcc? : String?

options? : Dict?

DocToHtml(document, outputName?, options?) : Resource?

Alias: ConvertDocumentToHtml

Converts document (Word, Excel, PDF) to HTML.

DocToHtml Parameters

document : Resource?
Document to convert.

outputName? : String?
Output resource file name.

options? : Dict?
Save options.

DocToImages(document, options?, outputName?) : Resource?

Converts document (Pdf, Pptx) to series of images (one per page).

DocToImages Parameters

document : Resource?
Document to convert.

options? : Dict?
Resolution, etc.

outputName? : String?
Output resource file name.

DocToPdf(document, outputName?) : Resource?

Alias: ConvertDocumentToPdf

Converts document (Word, Excel) to PDF.

DocToPdf Parameters

document : Resource?
Document to convert.

outputName? : String?
Output resource file name.

Excel(resource, password?) : ExcelFile

Parses an Excel file.

Excel Parameters

resource : Resource?
Excel file resource (xls, xlsx, csv, ods).

password? : String?

Excel Examples

var rows = File('res:///internal/data.xlsx').Excel().Sheets.First().Value.Rows;

ExtractText(document) : String?

Extracts plain text from a document (Word, Excel, PDF, HTML).

ExtractText Parameters

document : Resource?

GetDocVars(template, removeTables = false) : []

Lists document variables.
Microsoft Word documents and PDF files are supported.

GetDocVars Parameters

template : Resource?

  • Word document with MailMerge variables or {{mustached}} variables.
  • PDF document with PDF form variables.

removeTables : Boolean = false
True to skip table variables.

PdfAnnotationsToFields(document, outputName?) : Resource?

Creates PDF form fields from annotations.
Author is options list in form ‘key=value|key=value|…|’.

PdfAnnotationsToFields Parameters

document : Resource?
PDF document with annotations.

outputName? : String?
Output resource file name.

ReadEml(document) : Dict?

Read .eml email message fields

ReadEml Parameters

document : Resource?
Document to read.

SubstituteDocVars(document, variables, outputName?, allowMissingVars = false) : Resource?

Alias: SubstituteDocumentVars

Substitutes document variables with values.
Microsoft Word documents and PDF files are supported.
PDF annotations can serve as fields (author there is options list in form ‘key=value|key=value|…|’).

SubstituteDocVars Parameters

document : Resource?

  • Word document with MailMerge variables or {{mustached}} variables.
  • PDF document with PDF form variables.

variables : Dict?
Variables to substitute in the template document.

outputName? : String?
Output resource file name.

allowMissingVars : Boolean = false
True to not throw errors if not all variables in the document are provided.

Leave a Comment

Your email address will not be published. Required fields are marked *