C# Class TemplNET.TemplDoc

Represents an instance of a document
Afficher le fichier Open project: CPonty/templ-dot-net Class Usage Examples

Méthodes publiques

Свойство Type Description
Docx Novacode.DocX
Stream System.IO.MemoryStream

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
CellClear ( Cell cell, bool deleteAllParagraphs = false ) : void

Clear text and images from all paragraphs in cell. Optional: Delete all paragraph objects. Keep in mind, cells with zero paragraphs are considered malformed by Word! Also keep in mind, you will lose formatting info (e.g. font). Special cases of content other than text or images may not be removed; If this becomes a problem, we can develop it.

CellCopyContents ( Cell srcCell, Cell dstCell ) : void

Copy (text) contents of srcCell into dstCell. Clears text of dstCell plus all but first paragraph instance before copying.

CellCopyProperties ( Cell fromCell, Cell toCell ) : void
Commit ( ) : TemplDoc

Save to internal memory. Initialising a *new* stream is important due to the internal structure of DocX's load/save.

Copy ( ) : TemplDoc

Clone

Paragraphs ( DocX doc ) : IEnumerable

Retrieves all paragraph references from the document body, header, footer, and table content.

SaveAs ( string fileName ) : void

Save to disk. Supplied file name is sanitized and converted to '.zip'

TemplDoc ( DocX document ) : System.Collections.Generic

Start with passed-in doc

TemplDoc ( Stream stream ) : System.Collections.Generic

New document from data stream

TemplDoc ( byte data ) : System.Collections.Generic

New document from file data

TemplDoc ( string filename ) : System.Collections.Generic

New document from filename

Method Details

CellClear() public static méthode

Clear text and images from all paragraphs in cell. Optional: Delete all paragraph objects. Keep in mind, cells with zero paragraphs are considered malformed by Word! Also keep in mind, you will lose formatting info (e.g. font). Special cases of content other than text or images may not be removed; If this becomes a problem, we can develop it.
public static CellClear ( Cell cell, bool deleteAllParagraphs = false ) : void
cell Novacode.Cell
deleteAllParagraphs bool
Résultat void

CellCopyContents() public static méthode

Copy (text) contents of srcCell into dstCell. Clears text of dstCell plus all but first paragraph instance before copying.
public static CellCopyContents ( Cell srcCell, Cell dstCell ) : void
srcCell Novacode.Cell
dstCell Novacode.Cell
Résultat void

CellCopyProperties() public static méthode

public static CellCopyProperties ( Cell fromCell, Cell toCell ) : void
fromCell Novacode.Cell
toCell Novacode.Cell
Résultat void

Commit() public méthode

Save to internal memory. Initialising a *new* stream is important due to the internal structure of DocX's load/save.
public Commit ( ) : TemplDoc
Résultat TemplDoc

Copy() public méthode

Clone
public Copy ( ) : TemplDoc
Résultat TemplDoc

Paragraphs() public static méthode

Retrieves all paragraph references from the document body, header, footer, and table content.
public static Paragraphs ( DocX doc ) : IEnumerable
doc Novacode.DocX
Résultat IEnumerable

SaveAs() public méthode

Save to disk. Supplied file name is sanitized and converted to '.zip'
public SaveAs ( string fileName ) : void
fileName string
Résultat void

TemplDoc() public méthode

Start with passed-in doc
public TemplDoc ( DocX document ) : System.Collections.Generic
document Novacode.DocX
Résultat System.Collections.Generic

TemplDoc() public méthode

New document from data stream
public TemplDoc ( Stream stream ) : System.Collections.Generic
stream System.IO.Stream
Résultat System.Collections.Generic

TemplDoc() public méthode

New document from file data
public TemplDoc ( byte data ) : System.Collections.Generic
data byte
Résultat System.Collections.Generic

TemplDoc() public méthode

New document from filename
public TemplDoc ( string filename ) : System.Collections.Generic
filename string
Résultat System.Collections.Generic

Property Details

Docx public_oe property

Underlying DocX document instance
public DocX,Novacode Docx
Résultat Novacode.DocX

Stream public_oe property

Document as memory stream. Automatically updates from the underlying DocX document on Commit(), SaveAs(), Copy()
public MemoryStream,System.IO Stream
Résultat System.IO.MemoryStream