word

null

Лицензия

Лицензия

Группа

Группа

com.craigburke.document
Идентификатор

Идентификатор

word
Последняя версия

Последняя версия

0.5.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

word
null
Ссылка на сайт

Ссылка на сайт

https://github.com/craigburke/document-builder
Система контроля версий

Система контроля версий

https://github.com/craigburke/document-builder

Скачать word

Имя Файла Размер
word-0.5.0.pom
word-0.5.0.jar 17 KB
word-0.5.0-sources.jar 2 KB
word-0.5.0-javadoc.jar 261 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.craigburke.document/word/ -->
<dependency>
    <groupId>com.craigburke.document</groupId>
    <artifactId>word</artifactId>
    <version>0.5.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.craigburke.document/word/
implementation 'com.craigburke.document:word:0.5.0'
// https://jarcasting.com/artifacts/com.craigburke.document/word/
implementation ("com.craigburke.document:word:0.5.0")
'com.craigburke.document:word:jar:0.5.0'
<dependency org="com.craigburke.document" name="word" rev="0.5.0">
  <artifact name="word" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.craigburke.document', module='word', version='0.5.0')
)
libraryDependencies += "com.craigburke.document" % "word" % "0.5.0"
[com.craigburke.document/word "0.5.0"]

Зависимости

provided (1)

Идентификатор библиотеки Тип Версия
org.codehaus.groovy : groovy-all jar 2.4.5

runtime (1)

Идентификатор библиотеки Тип Версия
com.craigburke.document : core jar 0.5.0

Модули Проекта

Данный проект не имеет модулей.

Groovy Document Builder

A document builder for Groovy for PDF or Word documents. This is still very much a work in progress.

Note
Because of the use of Groovy traits within the project, the minimum version of Groovy required is 2.3.

Example

@Grab(group='com.craigburke.document', module='pdf', version='0.5.0')
@Grab(group='com.craigburke.document', module='word', version='0.5.0')

import com.craigburke.document.builder.PdfDocumentBuilder
import com.craigburke.document.builder.WordDocumentBuilder

def builders = [
    new PdfDocumentBuilder(new File('example.pdf')),
    new WordDocumentBuilder(new File('example.docx'))
]

String[] COLORS = ['#FF0000', '#FF7F00', '#FFFF00', '#00FF00', '#0000FF', '#4B0082', '#8B00FF']

String GROOVY_IMAGE_URL = 'http://www.craigburke.com/images/posts/groovy-logo.png'
byte[] groovyImageData = new URL(GROOVY_IMAGE_URL).bytes

builders.each { builder ->
    builder.create {
        document(font: [family: 'Helvetica', size: 14.pt], margin: [top: 0.75.inches]) {

        heading1 "Groovy Document Builder v.0.5.0", font: [color: '#990000', size: 22.pt]

        heading2 "Paragraphs"

        paragraph {
            font.size = 42.pt
            "Hello World".eachWithIndex { letter, index ->
                font.color = COLORS[ index % COLORS.size() ]
                text letter
                font.size--
            }
            lineBreak()
            text "Current font size is ${font.size}pt"
        }

        paragraph "Back to default font and aligned to the right", align: 'right'

        paragraph(margin: [left: 1.25.inches, right: 1.inch, top: 0.25.inches, bottom: 0.25.inches]) {
            font << [family: 'Times-Roman', bold: true, italic: true, color: '#333333']
            text "A paragraph with a different font and margins"
        }

        paragraph(align: 'center') {
            image(data: groovyImageData, width: 250.px, height: 125.px)
            lineBreak()
            text "Figure 1: Groovy Logo", font: [italic: true, size: 9.pt]
        }

        heading2 "Tables"

        table(width: 6.inches, padding: 4.px, border: [size: 3.px, color: '#990000']) {
            row {
                cell('Left Aligned', width:1.5.inches, align:'left')
                cell('Center Aligned', width:2.inches, align:'center')
                cell(align:'right') {
                    text 'Right Aligned'
                }
            }
        }
    }}
}

License

The core project as well as the Word document and Pdf builder are all available under the MPL2 license.

Версии библиотеки

Версия
0.5.0
0.4.15
0.4.13
0.4.12
0.4.10
0.4.9
0.4.8
0.4.7
0.4.6
0.4.5
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1