Detalhes do pacote

officegen-dbb

AustinAgile58MIT0.5.5

Modification of Ziv Barber's officegen, to provide a reasonable way to have line breaks in table cells.

officegen, office, microsoft, 2007

readme (leia-me)

officegen npm version Build Status Dependencies Status Join the chat at https://gitter.im/officegen/Lobby

This is an addition to Ziv-Barber's officegen (here) to provide a reasonable way to add line breaks to table cells.

Contents:

Features:

  • In addition to all features in source reop (Ziv-Barber's):
    • Set table cell value as an array of objects.

Public API:

Word:

To add a table:

var table = [
  [{
    val: "No.",
    opts: {
      cellColWidth: 4261,
      b:true,
      sz: '48',
      shd: {
        fill: "7F7F7F",
        themeFill: "text1",
        "themeFillTint": "80"
      },
      fontFamily: "Avenir Book"
    }
  },{
    val: "Title1",
    opts: {
      b:true,
      color: "A00000",
      align: "right",
      shd: {
        fill: "92CDDC",
        themeFill: "text1",
        "themeFillTint": "80"
      }
    }
  },{
    val: "Title2",
    opts: {
      align: "center",
      vAlign: "center",
      cellColWidth: 42,
      b:true,
      sz: '48',
      shd: {
        fill: "92CDDC",
        themeFill: "text1",
        "themeFillTint": "80"
      }
    }
  }],
  [1,[{"w:t":'All grown-ups were'},{"w:br":""},{"w:t":'once children'}],''],
  [2,'there is no harm in putting off a piece of work until another day.',''],
  [3,'But when it is a matter of baobabs, that always means a catastrophe.',''],
  [4,'watch out for the baobabs!','END'],
]

var tableStyle = {
  tableColWidth: 4261,
  tableSize: 24,
  tableColor: "ada",
  tableAlign: "left",
  tableFontFamily: "Comic Sans MS",
  borders: true
}

docx.createTable (table, tableStyle);

License:

(The MIT License)

Copyright (c) 2013-2017 Ziv Barber;

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credit:

  • Ziv-Barber.

Donations:

The original author is accepting tips through Gittip

changelog (log de mudanças)

  • Version 0.4.3:
    • PowerPoint:
      • Improved speaker notes support.
      • Improved title layout API.
    • Excel:
      • New API to change the width of every cell instead of changing it directly. Warning! the internal format of sheet.width been changed!!!
  • Version 0.4.2:
    • PowerPoint:
      • Support for speaker notes.
      • Advanced way to set the side of the slides.
      • Allow you to make a slide from the title slide layout.
      • Now adding all the original Office layouts to the generated pptx document.
      • Table support fixes (japneet121).
    • Word:
      • Support for header and footer.
      • Support for bookmarks and hyperlinks.
    • Design and development:
      • Document type plugins system to easy adding new features.
  • Version 0.4.1:
    • Ability to make text hyperlinks in docx - Merge pull request #154 from embrialabs/master
    • Added support for bullets (they weren't working, and were just showing numbers) - Merge pull request #151 from njcaruso/master.
    • Fixed issue with _scaling private method - Merge pull request #150 from andrewBalekha/bugfix/chart-scaling-issue
    • pptx/bug: Multiline text using \n for splitting paragraphs would style properly only first paragraph - Merge pull request #140 from tomasztunik/master
    • Merge pull request #145 from arrowing/grid-span - Merge pull request #145 from arrowing/grid-span
  • Version 0.4.0:
    • For all Microsoft Office based documents:
      • Bug fix: Changing the document's properties from the document's settings didn't work.
      • You can now change also the 'categories' and 'status' in the document's properties.
      • 'creator' now changed to 'aurthor' (but you can still use also 'creator').
    • PowerPoint:
      • Charts now working again, using jszip so no need for any external tool.
    • Word:
      • Paragraph's text new options:
        • 'shdType' and 'shdColor' (used with 'back').
        • 'border', 'borderColor' and 'borderSize'.
        • 'highlight'.
      • All inside table borders (by cgarethc).
  • Version 0.2.11:
    • Allow user to set options in addImage when they use createByJson to generate docx (peizhuang) and also to change the image type (Ziv Barber).
    • Provide varying column sizes in Word tables (cgarethc).
    • Tables in Word can have differing column widths (cgarethc).
    • The cellColWidth option that is copied to the w:w on a w:tcW only works if the w:gridCol is a non-zero value. It is now possible to set table columns to different widths by using the cellColWidth on the columns for the first row, rather than having to set a constant column with in the table options.
    • PPTX Widescreen Centering Fix (funnelwise).
    • Uses pptWidth for obj cx and x calculations instead of hard coded numbers (EricR-FW).
    • Cleaned the code and more documentations and unit tests.
  • Version 0.2.10:
    • All the community patches since 0.2.9.
  • Version 0.2.9:
    • Italic support to docx files by Vlampreia.
    • Floating point support by Van Dyvk (pptx files).
  • Version 0.2.8:
    • Drop the support for node 0.8.x for now ("startpoint" not supporting node 0.8.x).
    • New generate engine.
    • Support 16:9 presentations (thanks redders6600).
    • Fix the required archiver version to 0.4.10.
  • Version 0.2.7:
    • PowerPoint:
      • Automatic updated fields support: date and time, slide number.
      • Bug fix: The text parameter of addText now supporting also numbers.
      • addText: simple array support then before (just pass list of strings to add as a text paragraph).
    • Word:
      • putPageBreak changed to addPageBreak but you can still use the old name.
      • Patch by Antoine Proulx: fix the font size converting.
      • Patch by Antoine Proulx: Proposition for the addition of a line break inside a paragraph.
  • Version 0.2.6:
    • PowerPoint:
      • Automatically support line breaks.
      • Fixed a bug when using effects (shadows).
    • Excell:
      • Patch by arnesten: Automatically support line breaks if used in cell and also set appropriate row height depending on the number of line breaks.
  • Version 0.2.5:
    • Internal design changes that should not effect current implementations. To support future features.
    • Bugs:
      • Small typo which makes it crash. oobjOptions should be objOptions on line 464 in genpptx.js (thanks Stefan Van Dyck!).
  • Version 0.2.4:
    • PowerPoint:
      • Body properties like autoFit and margin now supported for text objects (thanks Stefan Van Dyck!).
      • You can pass now 0 to either cx or cy (good when drawing either horizontal or vertical lines).
    • Plugins developers:
      • You can now generate also tar and gzip based documents (or archive files).
      • You can generate your document resources using template engines (like jade, ejs, haml*, CoffeeKup, etc).
  • Version 0.2.3:
    • PowerPoint:
      • You can now either read or change the options of a parahraph object after creating it.
      • You can add shadow effects (both outher and inner).
  • Version 0.2.2:
    • Word:
      • You can now put images inside your document.
    • General features:
      • You can now pass callbacks to generate() instead of using node events.
    • Bugs / Optimization:
      • If you add the same image only one copy of it will be saved.
      • Missing requirement after the split of the code in version 0.2.x (thanks Seth Pollack!)
      • Fix the bug when you put number as a string for properties like y, x, cy and cx.
      • Generating invalid strings for MS-Office document properties.
      • Better shared string support in Excel (thanks vivocha!).
  • Version 0.2.0:
    • Huge design change from 'quick patch' based code to real design with much better API while still supporting also the old API.
    • Bugs:
      • You can now listen on error events.
      • Missing files in the relationships list made the Excel files unreadable to the Numbers application on the Mac (lmalheiro).
      • Minor bug fixes on the examples and the documentation.
  • Version 0.1.11:
    • PowerPoint:
      • Transparent level for solid color.
      • Rotate any object.
      • Flip vertical now working for any kind of object.
      • Line width.
    • Bugs:
      • Invalid PPTX file when adding more then one image of the same type.
  • Version 0.1.10:
    • PowerPoint:
      • Supporting more image types.
      • Supporting hidden slides.
      • Allow changing the indent for text.
    • Bug: All the text messages for all type of documents can now have '<', '>', etc.
  • Version 0.1.9:
    • Bug: Fix the invalid package.json main file.
    • PowerPoint: Allow adding shapes.
  • Version 0.1.8:
    • PowerPoint: Allow adding images (png only).
  • Version 0.1.7:
    • Excel 2007: addCell.
    • Many internal changes that are not effecting the user API.
  • Version 0.1.6:
    • Excel 2007: finished supporting shared strings.
    • Excel 2007: The interface been changed.
    • A lot of changes in the design of this module.
  • Version 0.1.5:
    • Word 2007 basic API now working.
  • Version 0.1.4:
    • WARNING: The addText function for PowerPoint been changed since version 0.1.3.
    • Many new features for PowerPoint.
    • Minor bug fixes.
  • Version 0.1.3:
    • Can generate also ppsx files.
    • Minor bug fixes.
  • Version 0.1.2:
    • HTTP server demo.
    • Can generate very limited Excel file.
    • You can change the background color of slides.
    • Minor bug fixes.