Beispiel #1
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)
Beispiel #2
0
class IBlockTable(interfaces.IRMLDirectiveSignature):
    """A typical block table."""
    occurence.containing(
        occurence.ZeroOrMore('tr', ITableRow),
        occurence.ZeroOrOne('bulkData', ITableBulkData),
        occurence.ZeroOrMore('blockTableStyle', stylesheet.IBlockTableStyle),
    )

    style = attr.Style(
        title=u'Style',
        description=(u'The table style that is applied to the table. '),
        required=False)

    rowHeights = attr.Sequence(
        title=u'Row Heights',
        description=u'A list of row heights in the table.',
        value_type=attr.Measurement(),
        required=False)

    colWidths = attr.Sequence(
        title=u'Column Widths',
        description=u'A list of column widths in the table.',
        value_type=attr.Measurement(allowPercentage=True, allowStar=True),
        required=False)

    repeatRows = attr.Integer(
        title=u'Repeat Rows',
        description=u'A flag to repeat rows upon table splits.',
        required=False)

    alignment = attr.Choice(title=u'Alignment',
                            description=u'The alignment of whole table.',
                            choices=interfaces.ALIGN_TEXT_CHOICES,
                            required=False)
Beispiel #3
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))
Beispiel #4
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),
    )
Beispiel #5
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)

    debug = attr.Boolean(
        title=u'Debug',
        description=u'A flag to activate the debug output.',
        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)
Beispiel #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)
Beispiel #7
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)
Beispiel #8
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)
Beispiel #9
0
class IStory(flowable.IFlow):
    """The story of the PDF file."""
    occurence.containing(occurence.ZeroOrMore('pto', flowable.IPTO),
                         *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)
Beispiel #10
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.Text(
        title='File Name',
        description=('The default name of the output file, if no output '
                     'file was provided.'),
        required=True)

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

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

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

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

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

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

    invariant = attr.BooleanWithDefault(
        title='Invariant',
        description=('A flag that determines whether the produced PDF '
                     'should be invariant with respect to the date and '
                     'the exact contents.'),
        required=False)
Beispiel #11
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),
        )
Beispiel #12
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)
Beispiel #13
0
            color = kwargs.pop(attrName, None)
            if color is not None:
                # CMYK has additional attributes.
                for name, value in kwargs.items():
                    setattr(color, name, value)
                manager = attr.getManager(self)
                manager.colors[id] = color
                return
        raise ValueError('At least one color definition must be specified.')

# Initialize also supports the <color> tag.
stylesheet.Initialize.factories['color'] = ColorDefinition
stylesheet.IInitialize.setTaggedValue(
    'directives',
    stylesheet.IInitialize.getTaggedValue('directives') +
    (occurence.ZeroOrMore('color', IColorDefinition),)
    )


class IStartIndex(interfaces.IRMLDirectiveSignature):
    """Start a new index."""

    name = attr.String(
        title=u'Name',
        description=u'The name of the index.',
        default='index',
        required=True)

    offset = attr.Integer(
        title=u'Offset',
        description=u'The counting offset.',
Beispiel #14
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('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('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('imageAndFlowables', IImageAndFlowables),
        occurence.ZeroOrMore('pto', IPTO),
        occurence.ZeroOrMore('indent', IIndent),
        occurence.ZeroOrMore('fixedSize', IFixedSize),
        occurence.ZeroOrMore('bookmark', IBookmark),
        occurence.ZeroOrMore('link', ILink),
        occurence.ZeroOrMore('hr', IHorizontalRow),
        occurence.ZeroOrMore('name', special.IName),
        )
Beispiel #15
0
class ILineLabels(IPositionLabelBase):
    """A set of labels of an axis."""
    occurence.containing(occurence.ZeroOrMore('label', ILabel))
Beispiel #16
0
class IAxis(interfaces.IRMLDirectiveSignature):
    occurence.containing(occurence.ZeroOrMore('labels', ILabels))

    visible = attr.Boolean(
        title='Visible',
        description='When true, draw the entire axis with all details.',
        required=False)

    visibleAxis = attr.Boolean(title='Visible Axis',
                               description='When true, draw the axis line.',
                               required=False)

    visibleTicks = attr.Boolean(
        title='Visible Ticks',
        description='When true, draw the axis ticks on the line.',
        required=False)

    visibleLabels = attr.Boolean(
        title='Visible Labels',
        description='When true, draw the axis labels.',
        required=False)

    visibleGrid = attr.Boolean(
        title='Visible Grid',
        description='When true, draw the grid lines for the axis.',
        required=False)

    strokeWidth = attr.Measurement(
        title='Stroke Width',
        description='The width of axis line and ticks.',
        required=False)

    strokeColor = attr.Color(
        title='Stroke Color',
        description='The color in which the axis line and ticks are drawn.',
        required=False)

    strokeDashArray = attr.Sequence(
        title='Stroke Dash Array',
        description='The dash array that is used for the axis line and ticks.',
        value_type=attr.Float(),
        required=False)

    gridStrokeWidth = attr.Measurement(
        title='Grid Stroke Width',
        description='The width of the grid lines.',
        required=False)

    gridStrokeColor = attr.Color(
        title='Grid Stroke Color',
        description='The color in which the grid lines are drawn.',
        required=False)

    gridStrokeDashArray = attr.Sequence(
        title='Grid Stroke Dash Array',
        description='The dash array that is used for the grid lines.',
        value_type=attr.Float(),
        required=False)

    gridStart = attr.Measurement(
        title='Grid Start',
        description=('The start of the grid lines with respect to the '
                     'axis origin.'),
        required=False)

    gridEnd = attr.Measurement(
        title='Grid End',
        description=('The end of the grid lines with respect to the '
                     'axis origin.'),
        required=False)

    style = attr.Choice(title='Style',
                        description='The plot style of the common categories.',
                        choices=('parallel', 'stacked', 'parallel_3d'),
                        required=False)
Beispiel #17
0
class IBarLabels(ILabelBase):
    """A set of labels for a bar chart"""
    occurence.containing(occurence.ZeroOrMore('label', ILabel))
Beispiel #18
0
class IBars(IBar):
    """Collection of bar subscriptions."""
    occurence.containing(occurence.ZeroOrMore('bar', IBar))
Beispiel #19
0
class ITexts(interfaces.IRMLDirectiveSignature):
    """A set of texts drawn on the chart."""
    occurence.containing(occurence.ZeroOrMore('text', IText))
Beispiel #20
0

class IncludePdfPages(flowable.Flowable):
    signature = IIncludePdfPages

    def getProcessor(self):
        manager = attr.getManager(self, interfaces.IPostProcessorManager)
        procs = dict(manager.postProcessors)
        if 'CONCAT' not in procs:
            proc = ConcatenationPostProcessor()
            manager.postProcessors.append(('CONCAT', proc))
            return proc
        return procs['CONCAT']

    def process(self):
        if PyPDF2 is None:
            raise Exception(
                'PyPDF2 is not installed, so this feature is not available.')
        args = dict(self.getAttributeValues())
        proc = self.getProcessor()
        self.parent.flow.append(
            IncludePdfPagesFlowable(args['filename'], args.get('pages'), proc))


flowable.Flow.factories['includePdfPages'] = IncludePdfPages
flowable.IFlow.setTaggedValue(
    'directives',
    flowable.IFlow.getTaggedValue('directives') +
    (occurence.ZeroOrMore('includePdfPages', IIncludePdfPages),)
    )
Beispiel #21
0
class DocWhile(flowable.Flow):
    signature = IDocAssert
    klass = reportlab.platypus.flowables.DocWhile

    def process(self):
        args = dict(self.getAttributeValues())
        self.processSubDirectives()
        dwhile = self.klass(whileBlock=self.flow, **args)
        self.parent.flow.append(dwhile)


flowable.Flow.factories['docAssign'] = DocAssign
flowable.Flow.factories['docExec'] = DocExec
flowable.Flow.factories['docPara'] = DocPara
flowable.Flow.factories['docAssert'] = DocAssert
flowable.Flow.factories['docIf'] = DocIf
flowable.Flow.factories['docElse'] = DocElse
flowable.Flow.factories['docWhile'] = DocWhile

flowable.IFlow.setTaggedValue(
    'directives',
    flowable.IFlow.getTaggedValue('directives') + (
        occurence.ZeroOrMore('docAssign', IDocAssign),
        occurence.ZeroOrMore('docExec', IDocExec),
        occurence.ZeroOrMore('docPara', IDocPara),
        occurence.ZeroOrMore('docIf', IDocIf),
        occurence.ZeroOrMore('docElse', IDocElse),
        occurence.ZeroOrMore('docWhile', IDocWhile),
    ))
Beispiel #22
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('lineStyle', ILineStyle))

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

    keepWithNext = attr.Boolean(
        title=u'Keep with Next',
        description=(u'When set, this paragraph will always be in the same '
                     u'frame as the following flowable.'),
        required=False)
Beispiel #23
0
class IInitialize(interfaces.IRMLDirectiveSignature):
    """Do some RML processing initialization."""
    occurence.containing(
        occurence.ZeroOrMore('name', special.IName),
        occurence.ZeroOrMore('alias', special.IAlias),
    )
Beispiel #24
0
        title='Height',
        description='The height of the place.',
        required=False)

    origin = attr.Choice(
        title='Origin',
        description='The origin of the coordinate system for the story.',
        choices=('page', 'frame', 'local'),
        default = 'page',
        required=False)

class StoryPlace(flowable.Flowable):
    signature = IStoryPlace

    def process(self):
        x, y, width, height, origin = self.getAttributeValues(
            select=('x', 'y', 'width', 'height', 'origin'), valuesOnly=True)

        flows = flowable.Flow(self.element, self.parent)
        flows.process()
        self.parent.flow.append(
            StoryPlaceFlowable(x, y, width, height, origin, flows))


flowable.Flow.factories['storyPlace'] = StoryPlace
flowable.IFlow.setTaggedValue(
    'directives',
    flowable.IFlow.getTaggedValue('directives') +
    (occurence.ZeroOrMore('storyPlace', IStoryPlace),)
    )
Beispiel #25
0
    value = attr.Choice(
        title='Bullet Value',
        description='The type of bullet character.',
        choices=interfaces.UNORDERED_BULLET_VALUES,
        default='circle',
        required=False)

class UnorderedList(ListBase):
    signature = IUnorderedList
    attrMapping = {'value': 'start'}
    factories = {'li': UnorderedListItem}

    def getAttributeValues(self, *args, **kw):
        res = super().getAttributeValues(*args, **kw)
        res.append(('bulletType', 'bullet'))
        return res

flowable.Flow.factories['ol'] = OrderedList
flowable.IFlow.setTaggedValue(
    'directives',
    flowable.IFlow.getTaggedValue('directives') +
    (occurence.ZeroOrMore('ol', IOrderedList),)
    )

flowable.Flow.factories['ul'] = UnorderedList
flowable.IFlow.setTaggedValue(
    'directives',
    flowable.IFlow.getTaggedValue('directives') +
    (occurence.ZeroOrMore('ul', IUnorderedList),)
    )
Beispiel #26
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),
    )
Beispiel #27
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),
    )
Beispiel #28
0
class IDocInit(interfaces.IRMLDirectiveSignature):
    occurence.containing(
        occurence.ZeroOrMore('color', IColorDefinition),
        occurence.ZeroOrMore('name', special.IName),
        occurence.ZeroOrMore('registerType1Face', IRegisterType1Face),
        occurence.ZeroOrMore('registerFont', IRegisterFont),
        occurence.ZeroOrMore('registerCidFont', IRegisterCidFont),
        occurence.ZeroOrMore('registerTTFont', IRegisterTTFont),
        occurence.ZeroOrMore('registerFontFamily', IRegisterFontFamily),
        occurence.ZeroOrMore('addMapping', IAddMapping),
        occurence.ZeroOrMore('logConfig', ILogConfig),
        occurence.ZeroOrMore('cropMarks', ICropMarks),
        occurence.ZeroOrMore('startIndex', IStartIndex),
        )

    pageMode = attr.Choice(
        title=u'Page Mode',
        description=(u'The page mode in which the document is opened in '
                     u'the viewer.'),
        choices=('UseNone', 'UseOutlines', 'UseThumbs', 'FullScreen'),
        required=False)

    pageLayout = attr.Choice(
        title=u'Page Layout',
        description=(u'The layout in which the pages are displayed in '
                     u'the viewer.'),
        choices=('SinglePage', 'OneColumn', 'TwoColumnLeft', 'TwoColumnRight'),
        required=False)

    useCropMarks = attr.Boolean(
        title=u'Use Crop Marks',
        description=u'A flag when set shows crop marks on the page.',
        required=False)

    hideToolbar = attr.TextBoolean(
        title=u'Hide Toolbar',
        description=(u'A flag indicating that the toolbar is hidden in '
                     u'the viewer.'),
        required=False)

    hideMenubar = attr.TextBoolean(
        title=u'Hide Menubar',
        description=(u'A flag indicating that the menubar is hidden in '
                     u'the viewer.'),
        required=False)

    hideWindowUI = attr.TextBoolean(
        title=u'Hide Window UI',
        description=(u'A flag indicating that the window UI is hidden in '
                     u'the viewer.'),
        required=False)

    fitWindow = attr.TextBoolean(
        title=u'Fit Window',
        description=u'A flag indicating that the page fits in the viewer.',
        required=False)

    centerWindow = attr.TextBoolean(
        title=u'Center Window',
        description=(u'A flag indicating that the page fits is centered '
                     u'in the viewer.'),
        required=False)

    displayDocTitle = attr.TextBoolean(
        title=u'Display Doc Title',
        description=(u'A flag indicating that the document title is displayed '
                     u'in the viewer.'),
        required=False)

    nonFullScreenPageMode = attr.Choice(
        title=u'Non-Full-Screen Page Mode',
        description=(u'Non-Full-Screen page mode in the viewer.'),
        choices=('UseNone', 'UseOutlines', 'UseThumbs', 'UseOC'),
        required=False)

    direction = attr.Choice(
        title=u'Text Direction',
        description=(u'The text direction of the PDF.'),
        choices=('L2R', 'R2L'),
        required=False)

    viewArea = attr.Choice(
        title=u'View Area',
        description=(u'View Area setting used in the viewer.'),
        choices=('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'),
        required=False)

    viewClip = attr.Choice(
        title=u'View Clip',
        description=(u'View Clip setting used in the viewer.'),
        choices=('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'),
        required=False)

    printArea = attr.Choice(
        title=u'Print Area',
        description=(u'Print Area setting used in the viewer.'),
        choices=('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'),
        required=False)

    printClip = attr.Choice(
        title=u'Print Clip',
        description=(u'Print Clip setting used in the viewer.'),
        choices=('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'),
        required=False)

    printScaling = attr.Choice(
        title=u'Print Scaling',
        description=(u'The print scaling mode in which the document is opened '
                     u'in the viewer.'),
        choices=('None', 'AppDefault'),
        required=False)