transformDocAdvHTML
- addBackgroundImage
- addFooter
- addHeader
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createDocx
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importHeadersAndFooters
- importStyles
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- addBibliography
- addBookmark
- addBreak
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addTable
- addTableContents
- addText
- addTextBox
- addWordML
- embedHTML
- clearBlocks
- deleteTemplateBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- tickCheckbox
transformDocAdvHTML
Transforms documents into HTML using native PHP classes.
This method allows to transform a DOCX document, generated or not with Javadocx, into HTML preserving, as much as possible, the original formatting options.
Tags, CSS, sizes and other transformations can be customized easily extending the classes and using plugins.
You may find more info regarding this method in the Word to HTML section.
htmlPlugin
Plugin used to transform the DOCX, TransformDocAdvHTMLDefaultPlugin as default.
options
The possible keys and values are:
Key | Type | Description |
---|---|---|
javaScriptAtTop | bool | False by default. Adds the JavaScript at the bottom of the HTML. |
returnHTMLStructure | bool | False by default. If true returns an array with the structure of the DOCX transformed to HTML: (css, document, endnotes, footnotes, headers, footers, javascript. metas). |
generateClassName
Function to generate class names.
setBaseCSS
Base CSS to be added when transforming the document. Default as empty.
setBaseHTML
Base HTML to be added when transforming the document. Default as '<!DOCTYPE html><html>'
setBaseJavaScript
Base JavaScript to be added when transforming the document. Default as empty.
setBaseMeta
Base meta tags to be added when transforming the document. Default as '<meta charset="UTF-8">'
setConversionFactor
Conversion factor to transform sizes. Default as 1.3
setExtraClasses
Extra classes to add for a tag.
setGenerateSectionTags
Default as true. If false, the transformation doesn't read section tags.
setImagesAsBase64
Default as true. If false, it generates the images as files.
setOutputFilesPath
Set the output path folder of the external files (altchunk, images...). If setImagesAsBase64 is set as true, the images aren't saved to this folder.
setTag
Set a specific tag for a OOXML tag.
transformColors
Function to transform color values.
transformSizes
Function to transform size values.
Example #1