Example #1
0
class IBlockTableStyle(interfaces.IRMLDirectiveSignature):
    """A style defining the look of a table."""
    occurence.containing(
        occurence.ZeroOrMore('blockFont', IBlockFont),
        occurence.ZeroOrMore('blockLeading', IBlockLeading),
        occurence.ZeroOrMore('blockTextColor', IBlockTextColor),
        occurence.ZeroOrMore('blockAlignment', IBlockAlignment),
        occurence.ZeroOrMore('blockLeftPadding', IBlockLeftPadding),
        occurence.ZeroOrMore('blockRightPadding', IBlockRightPadding),
        occurence.ZeroOrMore('blockBottomPadding', IBlockBottomPadding),
        occurence.ZeroOrMore('blockTopPadding', IBlockTopPadding),
        occurence.ZeroOrMore('blockBackground', IBlockBackground),
        occurence.ZeroOrMore('blockRowBackground', IBlockRowBackground),
        occurence.ZeroOrMore('blockColBackground', IBlockColBackground),
        occurence.ZeroOrMore('blockValign', IBlockValign),
        occurence.ZeroOrMore('blockSpan', IBlockSpan),
        occurence.ZeroOrMore('blockNosplit', IBlockNosplit),
        occurence.ZeroOrMore('lineStyle', ILineStyle))

    id = attr.Text(title='Id',
                   description='The name/id of the style.',
                   required=True)

    keepWithNext = attr.Boolean(
        title='Keep with Next',
        description=('When set, this paragraph will always be in the same '
                     'frame as the following flowable.'),
        required=False)
Example #2
0
class IPageDrawing(IDrawing):
    """Draws directly on the content of one page's canvas. Every call of this
    directive creates a new page."""

    occurence.containing(
        #'mergePage': IMergePage,
        *IDrawing.getTaggedValue('directives'))
Example #3
0
class IPath(IShape):
    """Create a line path."""
    occurence.containing(
        occurence.ZeroOrMore('moveto', IMoveTo),
        occurence.ZeroOrMore('curveto', ICurveTo),
        occurence.ZeroOrMore('curvesto', ICurvesTo),
    )

    points = attr.TextNodeGrid(
        title=u'Points',
        description=(u'A list of coordinate points that define th path.'),
        value_type=attr.Measurement(),
        columns=2,
        required=True)

    close = attr.Boolean(
        title=u'Close Path',
        description=(u"A flag specifying whether the path should be closed."),
        default=False,
        required=False)

    clip = attr.Boolean(
        title=u'Clip Path',
        description=(u"A flag specifying whether the path should clip "
                     u"overlapping elements."),
        default=False,
        required=False)
Example #4
0
class IParagraphBase(IMinimalParagraphBase):
    occurence.containing(
        occurence.ZeroOrMore('b', IBold), occurence.ZeroOrMore('i', IItalic),
        occurence.ZeroOrMore('u', IUnderLine),
        occurence.ZeroOrMore('br',
                             IBreak,
                             condition=occurence.laterThanReportlab21),
        occurence.ZeroOrMore('pageNumber', IPageNumber))
Example #5
0
class ISlice(ISliceBase):
    """A slice in a pie chart."""
    occurence.containing(
        occurence.ZeroOrOne('label', ISliceLabel),
        occurence.ZeroOrOne('pointer', ISlicePointer),
    )

    swatchMarker = attr.Symbol(required=False)
Example #6
0
class ITextAnnotation(interfaces.IRMLDirectiveSignature):
    """Writes a low-level text annotation into the PDF."""
    occurence.containing(occurence.ZeroOrMore('param', IParam))

    contents = attr.FirstLevelTextNode(
        title=u'Contents',
        description=u'The PDF commands that are inserted as annotation.',
        required=True)
Example #7
0
class IStylesheet(interfaces.IRMLDirectiveSignature):
    """A styleheet defines the styles that can be used in the document."""
    occurence.containing(
        occurence.ZeroOrOne('initialize', IInitialize),
        occurence.ZeroOrMore('paraStyle', IParagraphStyle),
        occurence.ZeroOrMore('blockTableStyle', IBlockTableStyle),
        # TODO:
        #occurence.ZeroOrMore('boxStyle', IBoxStyle),
    )
Example #8
0
class IStory(flowable.IFlow):
    """The story of the PDF file."""
    occurence.containing(*flowable.IFlow.getTaggedValue('directives'))

    firstPageTemplate = attr.Text(
        title=u'First Page Template',
        description=u'The first page template to be used.',
        default=None,
        required=False)
Example #9
0
class IDocInit(interfaces.IRMLDirectiveSignature):
    occurence.containing(
        occurence.ZeroOrMore('registerType1Face', IRegisterType1Face),
        occurence.ZeroOrMore('registerFont', IRegisterFont),
        occurence.ZeroOrMore('registerTTFont', IRegisterTTFont),
        occurence.ZeroOrMore('registerCidFont', IRegisterCidFont),
        occurence.ZeroOrMore('color', IColorDefinition),
        occurence.ZeroOrMore('addMapping', IAddMapping),
        )
Example #10
0
class IUnorderedList(IListBase):
    """And unordered list."""
    occurence.containing(occurence.ZeroOrMore('li', IUnorderedListItem), )

    value = attr.Choice(title=u'Bullet Value',
                        description=u'The type of bullet character.',
                        choices=interfaces.UNORDERED_BULLET_VALUES,
                        default='disc',
                        required=False)
Example #11
0
class IOrderedList(IListBase):
    """An ordered list."""
    occurence.containing(occurence.ZeroOrMore('li', IOrderedListItem), )

    bulletType = attr.Choice(title=u'Bullet Type',
                             description=u'The type of bullet formatting.',
                             choices=interfaces.ORDERED_LIST_TYPES,
                             doLower=False,
                             required=False)
Example #12
0
class IDocument(interfaces.IRMLDirectiveSignature):
    occurence.containing(
        occurence.ZeroOrOne('docinit', IDocInit),
        occurence.ZeroOrOne('stylesheet', stylesheet.IStylesheet),
        occurence.ZeroOrOne('template', template.ITemplate),
        occurence.ZeroOrOne('story', template.IStory),
        occurence.ZeroOrOne('pageInfo', canvas.IPageInfo),
        occurence.ZeroOrMore('pageDrawing', canvas.IPageDrawing),
        )

    filename = attr.String(
        title=u'File Name',
        description=(u'The default name of the output file, if no output '
                     u'file was provided.'),
        required=True)

    title = attr.String(
        title=u'Title',
        description=(u'The "Title" annotation for the PDF document.'),
        required=False)

    subject = attr.String(
        title=u'Subject',
        description=(u'The "Subject" annotation for the PDF document.'),
        required=False)

    author = attr.String(
        title=u'Author',
        description=(u'The "Author" annotation for the PDF document.'),
        required=False)

    creator = attr.String(
        title=u'Creator',
        description=(u'The "Creator" annotation for the PDF document.'),
        required=False)

    debug = attr.Boolean(
        title=u'Debug',
        description=u'A flag to activate the debug output.',
        default=False,
        required=False)

    compression = attr.BooleanWithDefault(
        title=u'Compression',
        description=(u'A flag determining whether page compression should '
                     u'be used.'),
        required=False)

    invariant = attr.BooleanWithDefault(
        title=u'Invariant',
        description=(u'A flag that determines whether the produced PDF '
                     u'should be invariant with respect to the date and '
                     u'the exact contents.'),
        required=False)
Example #13
0
class ITemplate(interfaces.IRMLDirectiveSignature):
    """Define a page template."""
    occurence.containing(occurence.OneOrMore('pageTemplate', IPageTemplate), )

    pagesize = attr.PageSize(title=u'Page Size',
                             description=u'The Page Size.',
                             required=False)

    rotation = attr.Integer(
        title=u'Rotation',
        description=u'The rotation of the page in multiples of 90 degrees.',
        required=False)

    leftMargin = attr.Measurement(
        title=u'Left Margin',
        description=u'The left margin of the template.',
        default=0,
        required=False)

    rightMargin = attr.Measurement(
        title=u'Right Margin',
        description=u'The right margin of the template.',
        default=0,
        required=False)

    topMargin = attr.Measurement(
        title=u'Top Margin',
        description=u'The top margin of the template.',
        default=0,
        required=False)

    bottomMargin = attr.Measurement(
        title=u'Bottom Margin',
        description=u'The bottom margin of the template.',
        default=0,
        required=False)

    showBoundary = attr.Boolean(
        title=u'Show Boundary',
        description=u'A flag to show the boundary of the template.',
        required=False)

    allowSplitting = attr.Boolean(
        title=u'Allow Splitting',
        description=u'A flag to allow splitting over multiple templates.',
        required=False)

    title = attr.Text(title=u'Title',
                      description=u'The title of the PDF document.',
                      required=False)

    author = attr.Text(title=u'Author',
                       description=u'The author of the PDF document.',
                       required=False)
Example #14
0
class IPieChart(IChart):
    """A pie chart."""
    occurence.containing(occurence.One('data', ISingleData1D),
                         occurence.ZeroOrOne('slices', ISlices),
                         occurence.ZeroOrOne('labels', ISimpleLabels),
                         *IChart.queryTaggedValue('directives', ()))

    startAngle = attr.Integer(
        title=u'Start Angle',
        description=u'The start angle in the chart of the first slice '
        u'in degrees.',
        required=False)

    direction = attr.Choice(
        title=u'Direction',
        description=u'The direction in which the pie chart will be built.',
        choices=('clockwise', 'anticlockwise'),
        required=False)

    checkLabelOverlap = attr.Boolean(
        title=u'Check Label Overlap',
        description=(u'When true, check and attempt to fix standard '
                     u'label overlaps'),
        required=False)

    pointerLabelMode = attr.Choice(
        title=u'Pointer Label Mode',
        description=(u'The location relative to the slace the label should '
                     u'be placed.'),
        choices={
            'none': None,
            'leftright': 'LeftRight',
            'leftandright': 'LeftAndRight'
        },
        required=False)

    sameRadii = attr.Boolean(
        title=u'Same Radii',
        description=u'When true, make x/y radii the same.',
        required=False)

    orderMode = attr.Choice(title=u'Order Mode',
                            description=u'',
                            choices=('fixed', 'alternate'),
                            required=False)

    xradius = attr.Measurement(title=u'X-Radius',
                               description=u'The radius of the X-directions',
                               required=False)

    yradius = attr.Measurement(title=u'Y-Radius',
                               description=u'The radius of the Y-directions',
                               required=False)
Example #15
0
class IDrawing(interfaces.IRMLDirectiveSignature):
    """A container directive for all directives that draw directly on the
    cnavas."""
    occurence.containing(
        # State Manipulation
        occurence.ZeroOrMore('saveState', ISaveState),
        occurence.ZeroOrMore('restoreState', IRestoreState),
        # String Drawing
        occurence.ZeroOrMore('drawString', IDrawString),
        occurence.ZeroOrMore('drawRightString', IDrawRightString),
        occurence.ZeroOrMore('drawCenteredString', IDrawCenteredString),
        occurence.ZeroOrMore('drawCentredString', IDrawCenteredString),
        occurence.ZeroOrMore('drawAlignedString', IDrawAlignedString),
        # Drawing Operations
        occurence.ZeroOrMore('ellipse', IEllipse),
        occurence.ZeroOrMore('circle', ICircle),
        occurence.ZeroOrMore('rect', IRectangle),
        occurence.ZeroOrMore('grid', IGrid),
        occurence.ZeroOrMore('lines', ILines),
        occurence.ZeroOrMore('curves', ICurves),
        occurence.ZeroOrMore('image', IImage),
        occurence.ZeroOrMore('place', IPlace),
        occurence.ZeroOrMore('textAnnotation', ITextAnnotation),
        occurence.ZeroOrMore('path', IPath),
        # State Change Operations
        occurence.ZeroOrMore('fill', IFill),
        occurence.ZeroOrMore('stroke', IStroke),
        occurence.ZeroOrMore('setFont', ISetFont),
        occurence.ZeroOrMore('setFontSize', ISetFontSize),
        occurence.ZeroOrMore('scale', IScale),
        occurence.ZeroOrMore('translate', ITranslate),
        occurence.ZeroOrMore('rotate', IRotate),
        occurence.ZeroOrMore('skew', ISkew),
        occurence.ZeroOrMore('transform', ITransform),
        occurence.ZeroOrMore('lineMode', ILineMode),
        # Form Field Elements
        occurence.ZeroOrMore('barCode', form.IBarCode),
        occurence.ZeroOrMore('textField', form.ITextField),
        occurence.ZeroOrMore('buttonField', form.IButtonField),
        occurence.ZeroOrMore('selectField', form.ISelectField),
        # Charts
        occurence.ZeroOrMore('barChart', chart.IBarChart),
        occurence.ZeroOrMore('barChart3D', chart.IBarChart3D),
        occurence.ZeroOrMore('linePlot', chart.ILinePlot),
        occurence.ZeroOrMore('linePlot3D', chart.ILinePlot3D),
        occurence.ZeroOrMore('pieChart', chart.IPieChart),
        occurence.ZeroOrMore('pieChart3D', chart.IPieChart3D),
        occurence.ZeroOrMore('spiderChart', chart.ISpiderChart),
        # Misc
        occurence.ZeroOrMore('bookmark', IBookmark),
        occurence.ZeroOrMore('plugInGraphic', IPlugInGraphic),
    )
Example #16
0
class ISelectField(IField):
    """A selection field within the PDF"""
    occurence.containing(occurence.ZeroOrMore('option', IOption))

    width = attr.Measurement(title=u'Width',
                             description=u'The width of the select field.',
                             required=True)

    height = attr.Measurement(title=u'Height',
                              description=u'The height of the select field.',
                              required=True)

    value = attr.Text(title=u'Value',
                      description=u'The default value of the field.',
                      required=False)
Example #17
0
class IPieChart3D(IPieChart):
    """A 3-D pie chart."""
    occurence.containing(occurence.One('slices', ISlices3D),
                         *IChart.queryTaggedValue('directives', ()))

    perspective = attr.Float(title='Perspsective',
                             description='The flattening parameter.',
                             required=False)

    depth_3d = attr.Measurement(title='3-D Depth',
                                description='The depth of the pie.',
                                required=False)

    angle_3d = attr.Float(title='3-D Angle',
                          description='The view angle in the Z-coordinate.',
                          required=False)
Example #18
0
class IFlow(interfaces.IRMLDirectiveSignature):
    """A list of flowables."""
    occurence.containing(
        occurence.ZeroOrMore('spacer', ISpacer),
        occurence.ZeroOrMore('illustration', IIllustration),
        occurence.ZeroOrMore('pre', IPreformatted),
        occurence.ZeroOrMore('xpre', IXPreformatted),
        occurence.ZeroOrMore('codesnippet', ICodeSnippet),
        occurence.ZeroOrMore('plugInFlowable', IPluginFlowable),
        occurence.ZeroOrMore('barCodeFlowable', IBarCodeFlowable),
        occurence.ZeroOrMore('outlineAdd', IOutlineAdd),
        occurence.ZeroOrMore('title', ITitle),
        occurence.ZeroOrMore('h1', IHeading1),
        occurence.ZeroOrMore('h2', IHeading2),
        occurence.ZeroOrMore('h3', IHeading3),
        occurence.ZeroOrMore('h4', IHeading4),
        occurence.ZeroOrMore('h5', IHeading5),
        occurence.ZeroOrMore('h6', IHeading6),
        occurence.ZeroOrMore('para', IParagraph),
        occurence.ZeroOrMore('blockTable', IBlockTable),
        occurence.ZeroOrMore('nextFrame', INextFrame),
        occurence.ZeroOrMore('setNextFrame', ISetNextFrame),
        occurence.ZeroOrMore('nextPage', INextPage),
        occurence.ZeroOrMore('setNextTemplate', ISetNextTemplate),
        occurence.ZeroOrMore('condPageBreak', IConditionalPageBreak),
        occurence.ZeroOrMore('keepInFrame', IKeepInFrame),
        occurence.ZeroOrMore('keepTogether', IKeepTogether),
        occurence.ZeroOrMore('img', IImage),
        occurence.ZeroOrMore('imageAndFlowables', IImageAndFlowables),
        occurence.ZeroOrMore('pto', IPTO),
        occurence.ZeroOrMore('indent', IIndent),
        occurence.ZeroOrMore('fixedSize', IFixedSize),
        occurence.ZeroOrMore('bookmarkPage', IBookmarkPage),
        occurence.ZeroOrMore('bookmark', IBookmark),
        occurence.ZeroOrMore('link', ILink),
        occurence.ZeroOrMore('hr', IHorizontalRow),
        occurence.ZeroOrMore('showIndex', IShowIndex),
        occurence.ZeroOrMore('name', special.IName),
        occurence.ZeroOrMore('namedString', INamedString),
        occurence.ZeroOrMore('log', ILog),
        occurence.ZeroOrMore('debug', IDebug),
        occurence.ZeroOrMore('info', IInfo),
        occurence.ZeroOrMore('warning', IWarning),
        occurence.ZeroOrMore('error', IError),
        occurence.ZeroOrMore('critical', ICritical),
    )
Example #19
0
class IPageTemplate(interfaces.IRMLDirectiveSignature):
    """Define a page template."""
    occurence.containing(
        occurence.OneOrMore('frame', IFrame),
        occurence.ZeroOrOne('pageGraphics', IPageGraphics),
    )

    id = attr.Text(title=u'Id',
                   description=u'The id of the template.',
                   required=True)

    pagesize = attr.PageSize(title=u'Page Size',
                             description=u'The Page Size.',
                             required=False)

    rotation = attr.Integer(
        title=u'Rotation',
        description=u'The rotation of the page in multiples of 90 degrees.',
        required=False)
Example #20
0
class ILinePlot3D(ILinePlot):
    """Creates a three-dimensional line plot."""
    occurence.containing(*ILinePlot.queryTaggedValue('directives', ()))

    thetaX = attr.Float(title='Theta-X',
                        description='Fraction of dx/dz.',
                        required=False)

    thetaY = attr.Float(title='Theta-Y',
                        description='Fraction of dy/dz.',
                        required=False)

    zDepth = attr.Measurement(title='Z-Depth',
                              description='Depth of an individual series/bar.',
                              required=False)

    zSpace = attr.Measurement(title='Z-Space',
                              description='Z-Gap around a series/bar.',
                              required=False)
Example #21
0
class IBarChart(IChart):
    """Creates a two-dimensional bar chart."""
    occurence.containing(occurence.One('data', IData1D),
                         occurence.ZeroOrOne('bars', IBars),
                         occurence.ZeroOrOne('categoryAxis', ICategoryAxis),
                         occurence.ZeroOrOne('valueAxis', IValueAxis),
                         occurence.ZeroOrOne('barLabels', IBarLabels),
                         *IChart.queryTaggedValue('directives', ()))

    direction = attr.Choice(
        title=u'Direction',
        description=u'The direction of the bars within the chart.',
        choices=('horizontal', 'vertical'),
        default='horizontal',
        required=False)

    useAbsolute = attr.Boolean(
        title=u'Use Absolute Spacing',
        description=u'Flag to use absolute spacing values.',
        default=False,
        required=False)

    barWidth = attr.Measurement(title=u'Bar Width',
                                description=u'The width of an individual bar.',
                                default=10,
                                required=False)

    groupSpacing = attr.Measurement(
        title=u'Group Spacing',
        description=u'Width between groups of bars.',
        default=5,
        required=False)

    barSpacing = attr.Measurement(
        title=u'Bar Spacing',
        description=u'Width between individual bars.',
        default=0,
        required=False)

    barLabelFormat = attr.String(
        title=u'Bar Label Text Format',
        description=u'Formatting string for bar labels.',
        required=False)
Example #22
0
class IPageTemplate(interfaces.IRMLDirectiveSignature):
    """Define a page template."""
    occurence.containing(
        occurence.OneOrMore('frame', IFrame),
        occurence.ZeroOrOne('pageGraphics', IPageGraphics),
    )

    id = attr.Text(title=u'Id',
                   description=u'The id of the template.',
                   required=True)

    pagesize = attr.PageSize(title=u'Page Size',
                             description=u'The Page Size.',
                             required=False)

    autoNextTemplate = attr.String(
        title=u'Auto Next Page Template',
        description=
        u'The page template to use automatically for the next page.',
        required=False)
Example #23
0
class ISpiderChart(IChart):
    """A spider chart."""
    occurence.containing(occurence.One('data', IData1D),
                         occurence.ZeroOrOne('strands', IStrands),
                         occurence.ZeroOrOne('strandLabels', IStrandLabels),
                         occurence.ZeroOrOne('spokes', ISpokes),
                         occurence.ZeroOrOne('spokeLabels', ISpokeLabels),
                         occurence.ZeroOrOne('labels', ISimpleLabels),
                         *IChart.queryTaggedValue('directives', ()))

    startAngle = attr.Integer(
        title='Start Angle',
        description='The start angle in the chart of the first strand '
        'in degrees.',
        required=False)

    direction = attr.Choice(
        title='Direction',
        description='The direction in which the spider chart will be built.',
        choices=('clockwise', 'anticlockwise'),
        required=False)
Example #24
0
class ICategoryAxis(IAxis):
    """An axis displaying categories (instead of numerical values)."""
    occurence.containing(occurence.ZeroOrOne('categoryNames', ICategoryNames),
                         *IAxis.queryTaggedValue('directives', ()))

    categoryNames = attr.Sequence(
        title='Category Names',
        description='A simple list of category names.',
        value_type=attr.Text(),
        required=False)

    joinAxis = attr.Boolean(title='Join Axis',
                            description='When true, both axes join together.',
                            required=False)

    joinAxisPos = attr.Measurement(
        title='Join Axis Position',
        description='The position at which the axes should join together.',
        required=False)

    reverseDirection = attr.Boolean(
        title='Reverse Direction',
        description='A flag to reverse the direction of category names.',
        required=False)

    labelAxisMode = attr.Choice(
        title='Label Axis Mode',
        description='Defines the relative position of the axis labels.',
        choices=('high', 'low', 'axis'),
        required=False)

    tickShift = attr.Boolean(
        title='Tick Shift',
        description=('When true, place the ticks in the center of a '
                     'category instead the beginning and end.'),
        required=False)
Example #25
0
class ISimpleLabels(interfaces.IRMLDirectiveSignature):
    """A set of simple labels for a chart."""
    occurence.containing(occurence.OneOrMore('label', ISimpleLabel), )
Example #26
0
class ISlices3D(ISliceBase):
    """The collection of all 3-D slice descriptions."""
    occurence.containing(occurence.OneOrMore('slice', ISlice3D), )

    fillColorShaded = attr.Color(required=False)
Example #27
0
class ISlices(ISliceBase):
    """The collection of all 2-D slice descriptions."""
    occurence.containing(occurence.OneOrMore('slice', ISlice), )
Example #28
0
class ILines(ILineBase):
    """The set of all line descriptions in the line plot."""
    occurence.containing(occurence.OneOrMore('line', ILine), )
Example #29
0
class ILineLabels(IPositionLabelBase):
    """A set of labels of an axis."""
    occurence.containing(occurence.ZeroOrMore('label', ILabel))
Example #30
0
class ICategoryNames(interfaces.IRMLDirectiveSignature):
    """A list of category names."""
    occurence.containing(occurence.OneOrMore('name', IName), )